forked from mengning/nezha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (38 loc) · 1.39 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
# Makefile for Nezha project
TARGETS = testdbapi testswserver testswclient testprotocol \
nezha nezhaserver nezhaclient
all: nezha nezhaserver nezhaclient
# nezhaserver:database service
nezhaserver:dbapi.o socketwrapper.o protocol.o dbserver.o
gcc -o $@ $^ -ltokyocabinet
# nezhaclient:database remote command line
nezhaclient:socketwrapper.o protocol.o remotedbapi.o cmdline.o
gcc -o $@ $^
@printf '#=====================================\n'
@printf '# nezha:C/S version\n'
@printf '# execute ./nezhaserver & ./nezhaclient\n'
@printf '#=====================================\n'
# nezha:local command line version
nezha: dbapi.o cmdline.o
gcc -o $@ $^ -ltokyocabinet
@printf '#=====================================\n'
@printf '# nezha:local command line version\n'
@printf '# execute ./nezha\n'
@printf '#=====================================\n'
test: dbapi.o testdbapi.o \
socketwrapper.o testsocketwrapperserver.o testsocketwrapperclient.o \
protocol.o testprotocol.o
gcc -o testdbapi dbapi.o testdbapi.o -ltokyocabinet
./testdbapi
gcc -o testswserver socketwrapper.o testsocketwrapperserver.o
gcc -o testswclient socketwrapper.o testsocketwrapperclient.o
./testswserver &
sleep 1
./testswclient
killall testswserver
gcc -o testprotocol protocol.o testprotocol.o
./testprotocol
.c.o:
gcc -c $<
clean:
rm -rf *.o $(TARGETS) *.bak