-
Notifications
You must be signed in to change notification settings - Fork 253
/
Makefile.linux
68 lines (43 loc) · 1.67 KB
/
Makefile.linux
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
CFLAGS=-ffunction-sections -fdata-sections -Wno-unused-result -I./src -I./libs -I./libs/miniupnpc -I./libs/libnatpmp -I./libs/zlib -D NO_GZIP=1 -D GNB_LINUX_BUILD=1
CLI_LDFLAGS=-Wl,--gc-sections -L/usr/lib -pthread
GNB_ES_LDFLAGS=-Wl,--gc-sections -L/usr/lib -pthread
ifeq ($(DEBUG),1)
CFLAGS += -g
else
CFLAGS += -O2
CLI_LDFLAGS += -s
GNB_ES_LDFLAGS += -s
endif
GNB_CRYPTO=gnb_crypto
GNB_CTL=gnb_ctl
GNB_ES=gnb_es
GNB_CLI=gnb
include Makefile.inc
GNB_CLI_OBJS = \
./src/cli/gnb.o \
./src/gnb_argv.o \
./src/unix/unix_platform.o \
./src/linux/gnb_drv_linux.o
GNB_ES_OBJS += ./src/unix/unix_platform.o
all:${GNB_CLI} ${GNB_CRYPTO} ${GNB_ES} ${GNB_CTL}
$(GNB_CTL): $(GNB_CTL_OBJS)
${CC} -o ${GNB_CTL} ${GNB_CTL_OBJS} ${CLI_LDFLAGS}
$(GNB_ES): $(GNB_ES_OBJS) ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS}
${CC} -o ${GNB_ES} ${GNB_ES_OBJS} ${CRYPTO_OBJS} ${MINIUPNP_OBJS} ${LIBNATPMP_OBJS} ${GNB_ES_LDFLAGS}
$(GNB_CRYPTO): $(CRYPTO_OBJS) ./src/cli/gnb_crypto.o
${CC} -o ${GNB_CRYPTO} ./src/cli/gnb_crypto.o ${CRYPTO_OBJS} ${CLI_LDFLAGS}
$(GNB_CLI): $(GNB_OBJS) $(GNB_CLI_OBJS) $(GNB_PF_OBJS) ${CRYPTO_OBJS} ${ZLIB_OBJS}
${CC} -o ${GNB_CLI} ${GNB_OBJS} ${GNB_CLI_OBJS} ${GNB_PF_OBJS} ${CRYPTO_OBJS} ${ZLIB_OBJS} ${CLI_LDFLAGS}
%.o:%.c
${CC} ${CFLAGS} -c -o $@ $<
install:${GNB_CLI} ${GNB_CRYPTO} ${GNB_ES} ${GNB_CTL}
mkdir -p ./bin/
cp ${GNB_CLI} ./bin/
cp ${GNB_CTL} ./bin/
cp ${GNB_CRYPTO} ./bin/
cp ${GNB_ES} ./bin/
clean:
find . -name "*.o" -exec rm -f {} \;
rm -f ${GNB_CLI} ${GNB_CRYPTO} ${GNB_ES} ${GNB_CTL}
rm -f core core.*
rm -f *.exe