source: chevmsgr/trunk/makefile@ 4

Last change on this file since 4 was 4, checked in by cheese, 9 years ago

자 이제 시작이야 (졸작을)

File size: 1.7 KB
Line 
1#----------------------------------------------------------
2# platform
3#----------------------------------------------------------
4include ../makeinclude/userdefine.mk
5include ../makeinclude/platform.mk
6
7memcheck = no
8profiling = no
9host = "localhost"
10port = 1234
11
12#----------------------------------------------------------
13# env
14#----------------------------------------------------------
15SERVER_FILES = msgsrv.cpp \
16 msg.cpp \
17 json.cpp \
18
19CLIENT_FILES = msgclnt.cpp \
20 msg.cpp \
21 json.cpp \
22
23INCLUDES = -I../include
24
25LIBCF = -L$(BUILD_PATH) -lcf++
26LIBNCURSES = -lncurses
27LIBRARIES = $(LIBS) $(LIBCF)
28
29ifeq ($(memcheck),yes)
30 VALGRIND = valgrind -v --leak-check=full --trace-children=yes --show-reachable=yes --track-origins=yes
31endif
32
33ifeq ($(profiling),yes)
34 VALGRIND = valgrind --tool=callgrind
35 CDEFS += -D_PROFILING
36endif
37
38#----------------------------------------------------------
39# label
40#----------------------------------------------------------
41all: server client
42 @echo ========== Complete test ==========
43
44server: 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
49client: 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
54kill: 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
60clean: dummy
61 rm -rf $(BUILD_PATH)/*.*
62 cd ../src; make clean
63
64dummy:
65
Note: See TracBrowser for help on using the repository browser.