-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (83 loc) · 2.27 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# AxProxy Makefile
INCLUDES=-I include -I lib
INDENT_FLAGS=-br -ce -i4 -bl -bli0 -bls -c4 -cdw -ci4 -cs -nbfda -l100 -lp -prs -nlp -nut -nbfde -npsl -nss
OBJS = \
bin/startup.o \
bin/util.o \
bin/proxy.o \
bin/nscache.o \
bin/dns.o
all: host
up:
@cp -pv ../proxy-util/util.h include/util.h
@cp -pv ../proxy-util/util.c src/util.c
internal: prepare
@echo " CC src/startup.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/startup.c -o bin/startup.o
@echo " CC src/util.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/util.c -o bin/util.o
@echo " CC src/proxy.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/proxy.c -o bin/proxy.o
@echo " CC src/nscache.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/nscache.c -o bin/nscache.o
@echo " CC lib/dns.c"
@$(CC) $(CFLAGS) $(INCLUDES) lib/dns.c -o bin/dns.o
@echo " LD bin/axproxy"
@$(LD) -o bin/axproxy $(OBJS) $(LDFLAGS)
prepare:
@mkdir -p bin
host:
@make internal \
CC=gcc \
LD=gcc \
CFLAGS='-c -Wall -Wextra -O2 -ffunction-sections -fdata-sections -Wstrict-prototypes' \
LDFLAGS='-s -Wl,--gc-sections -Wl,--relax'
mipsel:
@make internal \
CC=mips-unknown-linux-gnu-gcc \
LD=mips-unknown-linux-gnu-gcc \
CFLAGS='-c $(MIPSEL_CFLAGS) -I $(ESLIB_INC) -O2 -EL' \
LDFLAGS='$(MIPSEL_LDFLAGS) -L $(ESLIB_DIR) -les-mipsel -EL'
mipseb:
@make internal \
CC=mips-unknown-linux-gnu-gcc \
LD=mips-unknown-linux-gnu-gcc \
CFLAGS='-c $(MIPSEB_CFLAGS) -I $(ESLIB_INC) -O2 -EB' \
LDFLAGS='$(MIPSEB_LDFLAGS) -L $(ESLIB_DIR) -les-mipseb -EB'
arm:
@make internal \
CC=arm-linux-gnueabi-gcc \
LD=arm-linux-gnueabi-gcc \
CFLAGS='-c $(ARM_CFLAGS) -I $(ESLIB_INC) -O2' \
LDFLAGS='$(ARM_LDFLAGS) -L $(ESLIB_DIR) -les-arm'
install:
@cp -v bin/axproxy /usr/bin/axproxy
uninstall:
@rm -fv /usr/bin/axproxy
post:
@echo " STRIP axproxy"
@sstrip bin/axproxy
@echo " UPX axproxy"
@upx bin/axproxy
@echo " LCK axproxy"
@perl -pi -e 's/UPX!/EsNf/g' bin/axproxy
@echo " AEM axproxy"
@nogdb bin/axproxy
post2:
@echo " STRIP axproxy"
@sstrip bin/axproxy
@echo " AEM axproxy"
@nogdb bin/axproxy
indent:
@indent $(INDENT_FLAGS) ./*/*.h
@indent $(INDENT_FLAGS) ./*/*.c
@rm -rf ./*/*~
clean:
@echo " CLEAN ."
@rm -rf bin
analysis:
@scan-build make
@cppcheck --force */*.h
@cppcheck --force */*.c
gendoc:
@doxygen aux/doxygen.conf