-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 1.07 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
#
# Service Discovery Protocol - Makefile
# @author: Sebastien Soudan <sebastien.soudan@gmail.com>
#
# CPPFLAGS=-I. -Ixbee_local -ggdb -g3 -DLOCAL -I/usr/local/include/boost/
CPPFLAGS=-I. -Ixbee_local -ggdb -g3 -DDEBUG -DLOCAL -I/usr/local/include/boost/
#CPPFLAGS=-I. -g3 -ggdb
LDFLAGS=
LDLIBS=-L/usr/local/lib/ -lboost_iostreams -lboost_system
SRCS=util.cpp message.cpp SDP.cpp xbee_local/XBee.cpp xbee_local/Serial.cpp
TEST_SRCS=tests/test.cpp
SERVER_SRCS=servers/collector.cpp
OBJS=$(subst .cpp,.o,$(SRCS))
TEST_OBJS=$(subst .cpp,.o,$(TEST_SRCS))
SERVER_OBJS=$(subst .cpp,.o,$(SERVER_SRCS))
%.o: %.cpp
g++ $(CFLAGS) $(CPPFLAGS) -c $< -o $@
%.o: %.xxx
g++ -x cpp $(CFLAGS) $(CPPFLAGS) -c $< -o $@
all: test collector
./test
cd examples ; $(MAKE)
test: $(OBJS) $(TEST_OBJS)
g++ $(LDFLAGS) -o test $(OBJS) $(TEST_OBJS) $(LDLIBS)
collector: $(OBJS) $(SERVER_OBJS)
g++ $(LDFLAGS) -o collector $(OBJS) $(SERVER_OBJS) $(LDLIBS)
examples:
cd examples ; $(MAKE)
clean:
cd examples ; $(MAKE) clean
rm -f tests/*.o *.o test
rm -f xbee_local/*.o
rm -f servers/*.o *.o collector