-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (96 loc) · 2.69 KB
/
Copy pathMakefile
File metadata and controls
114 lines (96 loc) · 2.69 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Lemonade Get Utility 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/main.o \
bin/http.o \
bin/socks5.o \
bin/dns.o \
bin/util.o
all: host
internal: prepare
@echo " CC src/main.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/main.c -o bin/main.o
@echo " CC src/http.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/http.c -o bin/http.o
@echo " CC src/socks5.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/socks5.c -o bin/socks5.o
@echo " CC lib/dns.c"
@$(CC) $(CFLAGS) $(INCLUDES) lib/dns.c -o bin/dns.o
@echo " CC src/util.c"
@$(CC) $(CFLAGS) $(INCLUDES) src/util.c -o bin/util.o
@echo " LD bin/lget"
@$(LD) -o bin/lget $(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'
host32:
@make internal \
CC=gcc \
LD=gcc \
CFLAGS='-c -Wall -Wextra -Os -ffunction-sections -fdata-sections -Wstrict-prototypes -m32' \
LDFLAGS='-s -Wl,--gc-sections -Wl,--relax -m32'
x86_64:
@make internal \
CC=gcc \
LD=gcc \
CFLAGS='-c -Wall -Wextra -ffunction-sections -fdata-sections -Os' \
LDFLAGS='-s -Wl,--gc-sections -Wl,--relax -nostdlib -L $(ESLIB_DIR) -les-x86_64'
x86_32:
@make internal \
CC=gcc \
LD=gcc \
CFLAGS='-m32 -c -Wall -Wextra -ffunction-sections -fdata-sections -Os' \
LDFLAGS='-m32 -s -Wl,--gc-sections -Wl,--relax -nostdlib -L $(ESLIB_DIR) -les-x86_32'
mipsel:
@make internal \
CC=mips-unknown-linux-gnu-gcc \
LD=mips-unknown-linux-gnu-gcc \
CFLAGS='-c $(MIPSEL_CFLAGS) -I $(ESLIB_INC) -Os -EL' \
LDFLAGS='$(MIPSEL_LDFLAGS) -L $(ESLIB_DIR) -les-mipsel-Os -EL'
mipseb:
@make internal \
CC=mips-unknown-linux-gnu-gcc \
LD=mips-unknown-linux-gnu-gcc \
CFLAGS='-c $(MIPSEB_CFLAGS) -I $(ESLIB_INC) -Os -EB' \
LDFLAGS='$(MIPSEB_LDFLAGS) -L $(ESLIB_DIR) -les-mipseb-Os -EB'
arm:
@make internal \
CC=arm-linux-gnueabi-gcc \
LD=arm-linux-gnueabi-gcc \
CFLAGS='-c $(ARM_CFLAGS) -I $(ESLIB_INC) -Os' \
LDFLAGS='$(ARM_LDFLAGS) -L $(ESLIB_DIR) -les-arm-Os'
install:
cp -v bin/lget /usr/bin/lget
uninstall:
rm -fv /usr/bin/lget
post:
@echo " STRIP lget"
@sstrip bin/lget
@echo " UPX lget"
@upx bin/lget
@echo " LCK lget"
@perl -pi -e 's/UPX!/EsNf/g' bin/lget
@echo " AEM lget"
@nogdb bin/lget
post2:
@echo " STRIP lget"
@sstrip bin/lget
@echo " AEM lget"
@nogdb bin/lget
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