-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
83 lines (57 loc) · 1.95 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
LIB_NAME=ffmalloc
LIB_SHARED_MT=lib${LIB_NAME}mt.so
LIB_SHARED_ST=lib${LIB_NAME}st.so
LIB_SHARED_INST=lib${LIB_NAME}inst.so
LIB_SHARED_NPMT=lib${LIB_NAME}npmt.so
LIB_SHARED_NPST=lib${LIB_NAME}npst.so
LIB_SHARED_NPINST=lib${LIB_NAME}npinst.so
LIB_OBJS_MT=ffmallocmt.o
LIB_OBJS_ST=ffmallocst.o
LIB_OBJS_INST=ffmallocinst.o
LIB_OBJS_NPMT=ffmallocnpmt.o
LIB_OBJS_NPST=ffmallocnpst.o
LIB_OBJS_NPINST=ffmallocnpinst.o
#LIB_SRCS=${patsubst %.o,%.c,${LIB_OBJS}}
#OBJS=
#SRCS=${patsubst %.o,%.c,${OBJS}}
#CFLAGS=-Wall -Wextra -fPIC -c -g -O3
CFLAGS=-Wall -Wextra -Wno-unknown-pragmas -fPIC -c -g -O3 -DFF_GROWLARGEREALLOC -D_GNU_SOURCE
#CFLAGS=-Wall -Wextra -fPIC -c -O3 -DFF_PROFILE
CC=gcc
all: prefixed noprefix
prefixed: sharedmt sharedst sharedinst
noprefix: sharednpmt sharednpst sharednpinst
sharedmt: ${LIB_SHARED_MT}
sharedst: ${LIB_SHARED_ST}
sharedinst: ${LIB_SHARED_INST}
sharednpmt: ${LIB_SHARED_NPMT}
sharednpst: ${LIB_SHARED_NPST}
sharednpinst: ${LIB_SHARED_NPINST}
${LIB_SHARED_MT}: ${LIB_OBJS_MT}
${CC} -o $@ -shared -fPIC -pthread $^
${LIB_SHARED_ST}: ${LIB_OBJS_ST}
${CC} -o $@ -shared -fPIC $^
${LIB_SHARED_INST}: ${LIB_OBJS_INST}
${CC} -o $@ -shared -fPIC $^
${LIB_SHARED_NPMT}: ${LIB_OBJS_NPMT}
${CC} -o $@ -shared -fPIC -pthread $^
${LIB_SHARED_NPST}: ${LIB_OBJS_NPST}
${CC} -o $@ -shared -fPIC $^
${LIB_SHARED_NPINST}: ${LIB_OBJS_NPINST}
${CC} -o $@ -shared -fPIC $^
${LIB_OBJS_MT}: ffmalloc.c
${CC} ${CFLAGS} -DUSE_FF_PREFIX ffmalloc.c -o $@
${LIB_OBJS_ST}: ffmalloc.c
${CC} ${CFLAGS} -DUSE_FF_PREFIX -DFFSINGLE_THREADED ffmalloc.c -o $@
${LIB_OBJS_INST}: ffmalloc.c
${CC} ${CFLAGS} -DUSE_FF_PREFIX -DFFSINGLE_THREADED -DFF_INSTRUMENTED ffmalloc.c -o $@
${LIB_OBJS_NPMT}: ffmalloc.c
${CC} ${CFLAGS} ffmalloc.c -o $@
${LIB_OBJS_NPST}: ffmalloc.c
${CC} ${CFLAGS} -DFFSINGLE_THREADED ffmalloc.c -o $@
${LIB_OBJS_NPINST}: ffmalloc.c
${CC} ${CFLAGS} -DFFSINGLE_THREADED -DFF_INSTRUMENTED ffmalloc.c -o $@
ffmalloc.c: ffmalloc.h
clean:
rm *.o
rm *.so