1 SIMGRID_INSTALL_DIR ?= ./simgrid-stable
2 #SIMGRID_INSTALL_DIR ?= ./simgrid-dev
7 CHECK_FLAGS += -Wall -Wextra
12 CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include
13 CPPFLAGS += $(CHECK_FLAGS)
16 #CFLAGS += -fgnu89-inline # workaround simgrid bug
17 CFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
19 #CXXFLAGS += -std=c++0x
20 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
22 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
23 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
25 LINK.o = $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
28 MAKEDEPEND.FLAGS = $(CPPFLAGS) -MM -MG -MF $@ $<
29 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
31 SRC.loba := main.cpp \
36 $(wildcard loba_*.cpp) \
45 SRC.simple_async := simple_async.cpp
47 SRC := $(SRC.loba) $(SRC.simple_async)
48 OBJ := $(SRC:%.cpp=%.o)
49 DEP := $(SRC:%.cpp=%.d)
51 DEFAULT_TARGETS := loba
52 FLAVOURED_LOBA := loba-dev loba-stable
53 TARGETS := $(DEFAULT_TARGETS) \
58 platform.xml deployment.xml simple_async.xml \
59 cluster1000.xml machines1000.xml
61 XML_DEV_FILES = $(XML_FILES:%.xml=%_dev.xml)
63 .PHONY: all full xml clean realclean $(FLAVOURED_LOBA)
65 all: $(DEFAULT_TARGETS)
68 @for target in $(FLAVOURED_LOBA); do \
69 echo $(MAKE) "$$target"; \
72 $(MAKE) xml $(DEFAULT_TARGETS)
77 $(RM) core core.[0-9]* vgcore.[0-9]*
84 $(RM) $(FLAVOURED_LOBA)
85 $(RM) $(XML_DEV_FILES)
88 %.d: %.cpp ; $(MAKEDEPEND.CXX)
91 sed '/DOCTYPE/s,simgrid.dtd,http://simgrid.gforge.inria.fr/&,' $< > $@
95 $(MAKE) SIMGRID_INSTALL_DIR=./simgrid-$(patsubst loba-%,%,$@) loba
99 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
101 ifeq ($(filter $(MAKECMDGOALS),full clean realclean $(FLAVOURED_LOBA)),)
102 $(shell ./setlocalversion)
107 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
108 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@