|
1 # |
|
2 # Copyright 2004-2006 Intel Corporation |
|
3 # |
|
4 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 # you may not use this file except in compliance with the License. |
|
6 # You may obtain a copy of the License at |
|
7 # |
|
8 # http://www.apache.org/licenses/LICENSE-2.0 |
|
9 # |
|
10 # Unless required by applicable law or agreed to in writing, software |
|
11 # distributed under the License is distributed on an "AS IS" BASIS, |
|
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 # See the License for the specific language governing permissions and |
|
14 # limitations under the License. |
|
15 # |
|
16 |
|
17 # |
|
18 # Makefile for DTN2/test |
|
19 # |
|
20 |
|
21 # |
|
22 # Make sure SRCDIR is set. |
|
23 # |
|
24 ifeq ($(SRCDIR),) |
|
25 SRCDIR := .. |
|
26 BUILDDIR := .. |
|
27 endif |
|
28 |
|
29 # |
|
30 # Default target is to build all unit tests |
|
31 # |
|
32 dtn-tests: unit_tests |
|
33 all: dtn-tests |
|
34 |
|
35 BINFILES := \ |
|
36 unit_tests/bundle-list-test \ |
|
37 unit_tests/bundle-payload-test \ |
|
38 unit_tests/bundle-protocol-test \ |
|
39 unit_tests/bundle-timestamp-test \ |
|
40 unit_tests/endpoint-id-test \ |
|
41 unit_tests/gbofid-test \ |
|
42 unit_tests/prophet-bundle-core-test \ |
|
43 unit_tests/prophet-bundle-offer-test \ |
|
44 unit_tests/prophet-controller-test \ |
|
45 unit_tests/prophet-decider-test \ |
|
46 unit_tests/prophet-encounter-test \ |
|
47 unit_tests/prophet-list-test \ |
|
48 unit_tests/prophet-node-test \ |
|
49 unit_tests/prophet-policy-test \ |
|
50 unit_tests/prophet-repository-test \ |
|
51 unit_tests/prophet-stats-test \ |
|
52 unit_tests/prophet-strategy-test \ |
|
53 unit_tests/prophet-tlv-test \ |
|
54 unit_tests/route-multigraph-test \ |
|
55 unit_tests/route-table-test \ |
|
56 unit_tests/sdnv-test \ |
|
57 unit_tests/sequence-id-test \ |
|
58 |
|
59 unit_tests: $(BINFILES) |
|
60 |
|
61 # |
|
62 # Include the servlib Makefile to get the list of servlib objects |
|
63 # |
|
64 SERVLIB_MAKEFILE_INCLUDE := true |
|
65 include $(SRCDIR)/servlib/Makefile |
|
66 SERVLIB_OBJS := $(patsubst %,$(SRCDIR)/servlib/%,$(SERVLIB_OBJS)) |
|
67 |
|
68 echoobjs: |
|
69 @echo $(SERVLIB_OBJS) |
|
70 |
|
71 COMPONENT_LIBS := \ |
|
72 $(BUILDDIR)/applib/libdtnapisrv.a \ |
|
73 $(BUILDDIR)/servlib/libdtnserv.a \ |
|
74 |
|
75 # |
|
76 # Default pattern rule to build the tests |
|
77 # |
|
78 .PRECIOUS: unit_tests/%-test.o |
|
79 unit_tests/%-test.o: unit_tests/%-test.cc |
|
80 @rm -f $@; mkdir -p $(@D) |
|
81 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ |
|
82 |
|
83 unit_tests/%-test: unit_tests/%-test.o $(COMPONENT_LIBS) |
|
84 @rm -f $@; mkdir -p $(@D) |
|
85 $(CXX) $(CXXFLAGS) $< $(COMPONENT_LIBS) -o $@ $(LDFLAGS) $(OASYS_LDFLAGS) $(EXTLIB_LDFLAGS) |
|
86 |
|
87 # |
|
88 # As one exception, the bundle-timestamp-test can't have -Wcast-align |
|
89 # |
|
90 unit_tests/bundle-timestamp-test.o: unit_tests/bundle-timestamp-test.cc |
|
91 @rm -f $@; mkdir -p $(@D) |
|
92 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -Wno-cast-align -c $< -o $@ |
|
93 |
|
94 # |
|
95 # Include the common rules |
|
96 # |
|
97 include ../Rules.make |