-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (72 loc) · 2.2 KB
/
Copy pathMakefile
File metadata and controls
92 lines (72 loc) · 2.2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
CC=gcc
CXX=g++
LD=$(CXX)
CFLAGS=-Wall -g -fexceptions -O2 -fno-guess-branch-probability
#uncomment to enable extra debug messages
#CFLAGS+=-DPROJ_DEBUG
LDFLAGS=-lpthread
#used for unit tests
export PYTHONPATH := $(PWD)/pexpect-2.3
#pretty printing of CXX and LD
ifeq ($(HIDE),)
HIDE:= @
endif
BINLIST=echoserv Message_test router PCE
COMMON_OBJECTS=PCEconfig.o Socket.o usage.o Message.o
default: $(BINLIST)
# default compile rule
.cpp.o:
@ mkdir -p .depend
@ echo CXX $@
$(HIDE) $(CXX) $(CFLAGS) -c -o $@ -MMD -MF $(@:%.o=.depend/%.d) $(firstword $^)
#include generated dependency files
-include .depend/*.d
echoserv: echoserv.o
@ echo LD $@
$(HIDE) $(LD) $(LDFLAGS) -o $@ $^
Message_test: Message_test.o $(COMMON_OBJECTS)
@ echo LD $@
$(HIDE) $(LD) $(LDFLAGS) -o $@ $^
router: router.o $(COMMON_OBJECTS)
@ echo LD $@
$(HIDE) $(LD) $(LDFLAGS) -o $@ $^
PCE: PCE.o $(COMMON_OBJECTS)
@ echo LD $@
$(HIDE) $(LD) $(LDFLAGS) -o $@ $^
clean:
rm -f *.map *.o $(BINLIST) core.* *.exe.stackdump *.pyc
distclean: clean
rm -rf .depend
rm -rf mjs010200 mjs010200.zip
rm -rf pexpect-2.3
rm -rf .log
dist:
rm -rf mjs010200 mjs010200.zip
mkdir -p mjs010200
cp *.cpp *.h *.py README Makefile pexpect-2.3.tar.gz local.cfg mjs010200/
zip mjs010200.zip mjs010200/*
# from here down is unit test rules
message_unit_test: echoserv Message_test pexpect-2.3/.mkdir
$(HIDE) mkdir -p .log
$(HIDE) echo -n "Running message_test.py..."
$(HIDE) python message_test.py > .log/message_test.log
$(HIDE) echo "PASS"
single_pce_test: PCE router pexpect-2.3/.mkdir
$(HIDE) mkdir -p .log
$(HIDE) echo -n "Running single_pce_test.py..."
$(HIDE) python single_pce_test.py > .log/single_pce_test.log
$(HIDE) echo "PASS"
multi_pce_test: single_pce_test
$(HIDE) mkdir -p .log
$(HIDE) echo -n "Running multi_pce_test.py..."
$(HIDE) python multi_pce_test.py > .log/multi_pce_test.log
$(HIDE) echo "PASS"
star_pce_test: multi_pce_test
$(HIDE) mkdir -p .log
$(HIDE) echo -n "Running star_pce_test.py..."
$(HIDE) python star_pce_test.py > .log/star_pce_test.log
$(HIDE) echo "PASS"
pexpect-2.3/.mkdir: pexpect-2.3.tar.gz
tar -xzf pexpect-2.3.tar.gz
touch pexpect-2.3/.mkdir
tests: message_unit_test single_pce_test multi_pce_test star_pce_test