]> AND Private Git Repository - loba.git/blob - Makefile
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Interchange lb_iter and comp_iter, and improve process main loop.
[loba.git] / Makefile
1 SIMGRID_INSTALL_DIR ?= ./simgrid-stable
2 #SIMGRID_INSTALL_DIR ?= ./simgrid-dev
3
4 OPTIM_FLAGS += -O3
5 DEBUG_FLAGS += -g
6 #DEBUG_FLAGS += -pg
7 CHECK_FLAGS += -Wall -Wextra
8
9 CC := gcc
10 CXX := g++
11
12 CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include
13 CPPFLAGS += $(CHECK_FLAGS)
14
15 #CFLAGS += -std=c99
16 #CFLAGS += -fgnu89-inline      # workaround simgrid bug
17 CFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
18
19 #CXXFLAGS += -std=c++0x
20 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
21
22 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
23 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
24
25 LINK.o = $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
26 LDLIBS := -lsimgrid
27
28 MAKEDEPEND.FLAGS =  $(CPPFLAGS) -MM -MG -MF $@ $<
29 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
30
31 SRC.loba := main.cpp            \
32         communicator.cpp        \
33         cost_func.cpp           \
34         deployment.cpp          \
35         hostdata.cpp            \
36         $(wildcard loba_*.cpp)  \
37         misc.cpp                \
38         neighbor.cpp            \
39         options.cpp             \
40         process.cpp             \
41         version.cpp
42
43 SRC.simple_async := simple_async.cpp
44
45 SRC := $(SRC.loba) $(SRC.simple_async)
46 OBJ := $(SRC:%.cpp=%.o)
47 DEP := $(SRC:%.cpp=%.d)
48
49 DEFAULT_TARGETS := loba
50 FLAVOURED_LOBA := loba-dev loba-stable
51 TARGETS := $(DEFAULT_TARGETS)   \
52            simple_async
53
54 .PHONY: all full clean realclean $(FLAVOURED_LOBA)
55
56 all: $(DEFAULT_TARGETS)
57
58 full:
59         $(MAKE) $(FLAVOURED_LOBA)
60         $(MAKE) $(TARGETS)
61
62 clean:
63         $(RM) core core.[0-9]* vgcore.[0-9]*
64         $(RM) misc_autogen.h
65         $(RM) localversion
66         $(RM) $(OBJ)
67         $(RM) $(DEP)
68         $(RM) $(TARGETS)
69
70 realclean: clean
71         $(RM) $(FLAVOURED_LOBA)
72         $(RM) *~
73
74 %.d: %.cpp ; $(MAKEDEPEND.CXX)
75
76 $(FLAVOURED_LOBA):
77         $(MAKE) clean
78         $(MAKE) SIMGRID_INSTALL_DIR=./simgrid-$(patsubst loba-%,%,$@) loba
79         mv -f -- loba $@
80         $(MAKE) clean
81
82 misc_autogen.h: $(SIMGRID_INSTALL_DIR)/include/xbt/log.h
83         grep -C1 '# *define *CLOG' $< \
84         | sed 's/CLOG/XCLOG/;s/_XBT_LOGV\(([^)]*)\)/(*\1)/' > $@
85
86 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
87
88 ifeq ($(filter $(MAKECMDGOALS),full clean realclean $(FLAVOURED_LOBA)),)
89   $(shell ./setlocalversion)
90   -include $(DEP)
91 endif
92
93 .SECONDEXPANSION:
94 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
95         $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@