blob: 11c75136dc1959daf43a8dd2d0ffb4ec017e1983 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
ROOT = ../..
include $(ROOT)/config.mk
H_FILE_LIST = $(sort $(wildcard *.h))
C_FILE_LIST = $(sort $(wildcard *.c))
OBJS = $(C_FILE_LIST:.c=.o)
BINOBJS = $(foreach file, $(OBJS), $file)
CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' -fstack-protector-all -D_FORTIFY_SOURCE=2 -fPIC -Wformat -Wformat-security
LDFLAGS += -pie -fPIE -Wl,-z,relro -Wl,-z,now
.PHONY: all
all: libtrace.so
%.o : %.c $(H_FILE_LIST)
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
libtrace.so: $(OBJS)
$(CC) $(LDFLAGS) -shared -fPIC -z relro -o $@ $(OBJS) -ldl
.PHONY: clean
clean:; rm -fr $(OBJS) libtrace.so *.plist
.PHONY: distclean
distclean: clean
|