-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (33 loc) · 1.19 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
include ./Makefile.inc
SERVER_SOURCES=$(wildcard src/*.c src/negotiation/*.c src/auth/*.c src/request/*.c src/mgmt/*.c src/logging/*.c)
CLIENT_SOURCES=$(wildcard src/client/*.c)
SERVER_OBJECTS=$(SERVER_SOURCES:src/%.c=obj/%.o)
CLIENT_OBJECTS=$(CLIENT_SOURCES:src/%.c=obj/%.o)
OUTPUT_FOLDER=./bin
OBJECTS_FOLDER=./obj
SERVER_OUTPUT_FILE=$(OUTPUT_FOLDER)/socks5v
CLIENT_OUTPUT_FILE=$(OUTPUT_FOLDER)/client
all: server client
server: $(SERVER_OUTPUT_FILE)
client: $(CLIENT_OUTPUT_FILE)
$(SERVER_OUTPUT_FILE): $(SERVER_OBJECTS)
mkdir -p $(@D)
$(CC) $(CFLAGS) $(LDFLAGS) $(SERVER_OBJECTS) -o $(SERVER_OUTPUT_FILE)
$(CLIENT_OUTPUT_FILE): $(CLIENT_OBJECTS)
mkdir -p $(@D)
$(CC) $(CFLAGS) $(LDFLAGS) $(CLIENT_OBJECTS) -o $(CLIENT_OUTPUT_FILE)
obj/%.o: src/%.c
mkdir -p $(@D)
$(CC) $(GCCFLAGS) -c $< -o $@
clean:
rm -rf $(OUTPUT_FOLDER)
rm -rf $(OBJECTS_FOLDER)
check:
mkdir -p check
cppcheck --quiet --enable=all --force --inconclusive . 2> ./check/cppout.txt
pvs-studio-analyzer trace -- make
pvs-studio-analyzer analyze
plog-converter -a '64:1,2,3;GA:1,2,3;OP:1,2,3' -t tasklist -o ./check/report.tasks ./PVS-Studio.log
rm PVS-Studio.log
mv strace_out check
.PHONY: all server client clean check