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 += -D XBT_LOG_OLD_STYLE
14 CPPFLAGS += $(CHECK_FLAGS)
17 #CFLAGS += -fgnu89-inline # workaround simgrid bug
18 CFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
20 #CXXFLAGS += -std=c++0x
21 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
23 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
24 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
26 LINK.o = $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
29 MAKEDEPEND.FLAGS = $(CPPFLAGS) -MM -MG -MF $@ $<
30 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
32 SRC.loba := main.cpp \
37 $(wildcard loba_*.cpp) \
44 SRC.simple_async := simple_async.cpp
46 SRC := $(SRC.loba) $(SRC.simple_async)
47 OBJ := $(SRC:%.cpp=%.o)
48 DEP := $(SRC:%.cpp=%.d)
50 DEFAULT_TARGETS := loba
51 FLAVOURED_LOBA := loba-dev loba-stable
52 TARGETS := $(DEFAULT_TARGETS) \
57 platform.xml deployment.xml simple_async.xml \
60 XML_DEV_FILES = $(XML_FILES:%.xml=%_dev.xml)
62 .PHONY: all full xml clean realclean $(FLAVOURED_LOBA)
64 all: $(DEFAULT_TARGETS)
67 @for target in $(FLAVOURED_LOBA); do \
68 echo $(MAKE) "$$target"; \
71 $(MAKE) xml $(DEFAULT_TARGETS)
76 $(RM) core core.[0-9]* vgcore.[0-9]*
83 $(RM) $(FLAVOURED_LOBA)
84 $(RM) $(XML_DEV_FILES)
87 %.d: %.cpp ; $(MAKEDEPEND.CXX)
90 sed '/DOCTYPE/s,simgrid.dtd,http://simgrid.gforge.inria.fr/&,' $< > $@
94 $(MAKE) SIMGRID_INSTALL_DIR=./simgrid-$(patsubst loba-%,%,$@) loba
98 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
100 ifeq ($(filter $(MAKECMDGOALS),full clean realclean $(FLAVOURED_LOBA)),)
101 $(shell ./setlocalversion)
106 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
107 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@