Line | |
---|
1 | #----------------------------------------------------------
|
---|
2 | # platform
|
---|
3 | #----------------------------------------------------------
|
---|
4 | include ../makeinclude/userdefine.mk
|
---|
5 | include ../makeinclude/platform.mk
|
---|
6 |
|
---|
7 | memcheck = no
|
---|
8 | profiling = no
|
---|
9 | host = "localhost"
|
---|
10 | port = 1234
|
---|
11 |
|
---|
12 | #----------------------------------------------------------
|
---|
13 | # env
|
---|
14 | #----------------------------------------------------------
|
---|
15 | SERVER_FILES = msgsrv.cpp \
|
---|
16 | msg.cpp \
|
---|
17 | json.cpp \
|
---|
18 |
|
---|
19 | CLIENT_FILES = msgclnt.cpp \
|
---|
20 | msg.cpp \
|
---|
21 | json.cpp \
|
---|
22 |
|
---|
23 | INCLUDES = -I../include
|
---|
24 |
|
---|
25 | LIBCF = -L$(BUILD_PATH) -lcf++
|
---|
26 | LIBNCURSES = -lncurses
|
---|
27 | LIBRARIES = $(LIBS) $(LIBCF)
|
---|
28 |
|
---|
29 | ifeq ($(memcheck),yes)
|
---|
30 | VALGRIND = valgrind -v --leak-check=full --trace-children=yes --show-reachable=yes --track-origins=yes
|
---|
31 | endif
|
---|
32 |
|
---|
33 | ifeq ($(profiling),yes)
|
---|
34 | VALGRIND = valgrind --tool=callgrind
|
---|
35 | CDEFS += -D_PROFILING
|
---|
36 | endif
|
---|
37 |
|
---|
38 | #----------------------------------------------------------
|
---|
39 | # label
|
---|
40 | #----------------------------------------------------------
|
---|
41 | all: server client
|
---|
42 | @echo ========== Complete test ==========
|
---|
43 |
|
---|
44 | server: dummy
|
---|
45 | cd ../src; make all
|
---|
46 | $(CXX) $(CFLAGS) $(CDEFS) -o $(BUILD_PATH)/$@.ex $(SERVER_FILES) $(INCLUDES) $(LIBRARIES)
|
---|
47 | cd $(BUILD_PATH); LD_LIBRARY_PATH=. ./$@.ex $(port) &
|
---|
48 |
|
---|
49 | client: dummy
|
---|
50 | cd ../src; make all
|
---|
51 | $(CXX) $(CFLAGS) $(CDEFS) -o $(BUILD_PATH)/$@.ex $(CLIENT_FILES) $(INCLUDES) $(LIBRARIES) $(LIBNCURSES)
|
---|
52 | cd $(BUILD_PATH); LD_LIBRARY_PATH=. ./$@.ex $(host) $(port) || stty sane
|
---|
53 |
|
---|
54 | kill: dummy
|
---|
55 | ps aux | grep "server.ex\|client.ex" | grep -v grep | head -1 | awk -F" " '{print $$2}' | xargs kill -9
|
---|
56 |
|
---|
57 | $(BUILD_PATH)/%.o: %.cpp
|
---|
58 | $(CXX) $(CFLAGS) $(CDEFS) $(INCLUDES) -c -o $@ $<
|
---|
59 |
|
---|
60 | clean: dummy
|
---|
61 | rm -rf $(BUILD_PATH)/*.*
|
---|
62 | cd ../src; make clean
|
---|
63 |
|
---|
64 | dummy:
|
---|
65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.