|
1 # File: Makefile |
|
2 # |
|
3 # |
|
4 # Makefile to build UAN example executables. |
|
5 # |
|
6 |
|
7 # XXX Put these files in traditional header and library directories |
|
8 # rather than using relative paths. |
|
9 # |
|
10 # XXX Need way to manage multiple builds. |
|
11 CW_EXECUTABLE_DIR = .. |
|
12 CW_EXECUTABLE_NAME = uan-cw-example |
|
13 CW_EXECUTABLE_DIR_AND_NAME = $(CW_EXECUTABLE_DIR)/$(CW_EXECUTABLE_NAME) |
|
14 RC_EXECUTABLE_DIR = .. |
|
15 RC_EXECUTABLE_NAME = uan-rc-example |
|
16 RC_EXECUTABLE_DIR_AND_NAME = $(RC_EXECUTABLE_DIR)/$(RC_EXECUTABLE_NAME) |
|
17 |
|
18 # XXX Put these files in traditional header and library directories |
|
19 # rather than using relative paths. |
|
20 # |
|
21 # XXX Need way to manage multiple builds. |
|
22 UAN_LIBRARY_INCLUDE_DIR = ../model |
|
23 UAN_LIBRARY_DIR = .. |
|
24 UAN_LIBRARY_NAME = ns3-uan |
|
25 UAN_LIBRARY_DIR_AND_NAME = $(UAN_LIBRARY_DIR)/$(UAN_LIBRARY_NAME) |
|
26 |
|
27 # XXX Put these files in traditional header and library directories |
|
28 # rather than using relative paths. |
|
29 # |
|
30 # XXX Need way to manage multiple builds. |
|
31 UAN_HELPER_LIBRARY_INCLUDE_DIR = ../helper |
|
32 UAN_HELPER_LIBRARY_DIR = $(UAN_LIBRARY_DIR) |
|
33 UAN_HELPER_LIBRARY_NAME = ns3-uan-helper |
|
34 UAN_HELPER_LIBRARY_DIR_AND_NAME = $(UAN_HELPER_LIBRARY_DIR)/$(UAN_HELPER_LIBRARY_NAME) |
|
35 |
|
36 # XXX Put these files in traditional header and library directories |
|
37 # rather than using relative paths. |
|
38 # |
|
39 # XXX Need way to manage multiple builds. |
|
40 NS3_LIBRARY_INCLUDE_DIR = ../../../build/debug |
|
41 NS3_LIBRARY_DIR = ../../../build/debug |
|
42 NS3_LIBRARY_NAME = ns3 |
|
43 |
|
44 COMPILER_CXX = g++ |
|
45 |
|
46 # XXX Need to handle both debug and optimized mode. |
|
47 CXXFLAGS = -g -I$(UAN_LIBRARY_INCLUDE_DIR) -I$(UAN_HELPER_LIBRARY_INCLUDE_DIR) -I$(NS3_LIBRARY_INCLUDE_DIR) |
|
48 LINKFLAGS = -l$(UAN_LIBRARY_NAME) -L$(UAN_LIBRARY_DIR) -l$(UAN_HELPER_LIBRARY_NAME) -L$(UAN_HELPER_LIBRARY_DIR) -l$(NS3_LIBRARY_NAME) -L$(NS3_LIBRARY_DIR) |
|
49 |
|
50 CW_OBJECTS = uan-cw-example.o |
|
51 RC_OBJECTS = uan-rc-example.o |
|
52 |
|
53 %.o: %.cc |
|
54 $(COMPILER_CXX) -c $(CXXFLAGS) $< |
|
55 |
|
56 all: cw-example rc-example |
|
57 |
|
58 cw-example: $(CW_OBJECTS) |
|
59 $(COMPILER_CXX) $(LINKFLAGS) -o $(CW_EXECUTABLE_DIR_AND_NAME) $(CW_OBJECTS) |
|
60 |
|
61 rc-example: $(RC_OBJECTS) |
|
62 $(COMPILER_CXX) $(LINKFLAGS) -o $(RC_EXECUTABLE_DIR_AND_NAME) $(RC_OBJECTS) |
|
63 |
|
64 uan-cw-example.o: uan-cw-example.cc uan-cw-example.h |
|
65 uan-rc-example.o: uan-rc-example.cc uan-rc-example.h |
|
66 |
|
67 .PHONY: clean |
|
68 clean: |
|
69 rm $(CW_EXECUTABLE_DIR_AND_NAME) $(CW_OBJECTS) |
|
70 rm $(RC_EXECUTABLE_DIR_AND_NAME) $(RC_OBJECTS) |