-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmake.bak
More file actions
60 lines (43 loc) · 1.37 KB
/
make.bak
File metadata and controls
60 lines (43 loc) · 1.37 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
CC=gcc
DEPS = core.h librdp/rdp.h liblist/list.h
BUILD = release
CFLAGS_release =
CFLAGS_debug = -g -O0
CFLAGS = ${CFLAGS_${BUILD}}
# EXAMPLE:
# $ make clean && make BUILD=debug
all: procurator-local procurator-server
static: procurator-local-static procurator-server-static
%.o: %.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $<
librdp/librdp.a: librdp/rdp.h librdp/rdp.c
cd librdp && make BUILD=$(BUILD)
ctest.o: ctest.c
$(CC) -c -o $@ $<
procurator-local: local.o core.o crypto.o librdp/librdp.a liblist/list.o
$(CC) -o $@ $^ -lcrypto
procurator-server: server.o core.o crypto.o librdp/librdp.a liblist/list.o
$(CC) -o $@ $^ -lcrypto
procurator-local-static: local.o core.o crypto.o librdp/librdp.a liblist/list.o
$(CC) -o $@ $^ -l:libcrypto.a -ldl -lpthread
procurator-server-static: server.o core.o crypto.o librdp/librdp.a liblist/list.o
$(CC) -o $@ $^ -l:libcrypto.a -ldl -lpthread
ctest: ctest.o
$(CC) -o $@ $^
.PHONY: test
test: clean ctest procurator-local procurator-server
./ctest
.PHONY: pretty
pretty:
clang-format -i *.c *.h
.PHONY: anyway
anyway: clean all
.PHONY: install
install:
mkdir -p /bin
install -m 755 -T procurator-local /bin/procurator-local
install -m 755 -T procurator-server /bin/procurator-server
.PHONY: clean
clean:
rm -f *.o **/*.o procurator-local-static procurator-server-static procurator-local procurator-server ctest
cd librdp/ && make clean