-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
30 lines (24 loc) · 666 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
HAVE_LIBUNWIND=1
ifeq ($(HAVE_LIBUNWIND), 1)
optional_libs=libunwind
BUILD_OPTIONS+=-DHAVE_LIBUNWIND
else
optional_libs=
endif
CC ?= cc
FLAGS=`pkg-config --cflags gobject-2.0`
LIBS=`pkg-config --libs gobject-2.0 $(optional_libs)`
OBJS = gobject-list.o
all: libgobject-list.so
.PHONY: all clean
clean:
rm -f libgobject-list.so $(OBJS)
%.o: %.c
$(CC) -fPIC -rdynamic -g -c -Wall -Wextra ${FLAGS} ${BUILD_OPTIONS} $<
libgobject-list.so: $(OBJS)
ifeq ($(HAVE_LIBUNWIND), 1)
@echo "Building with backtrace support (libunwind)"
else
@echo "Building without backtrace support (libunwind disabled)"
endif
$(CC) -shared -Wl,-soname,$@ -o $@ $^ -lc -ldl ${LIBS}