1 SIMGRID_INSTALL_DIR ?= ./simgrid-stable
2 #SIMGRID_INSTALL_DIR ?= ./simgrid-dev
7 CHECK_FLAGS += -Wall -Wextra
11 CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include
12 CPPFLAGS += $(CHECK_FLAGS)
14 #CXXFLAGS += -std=c++0x
15 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
17 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
18 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
20 LINK.o = $(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
23 MAKEDEPEND.FLAGS = $(CPPFLAGS) -MM -MG -MF $@ $<
24 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
26 SRC.loba := main.cpp \
31 $(wildcard loba_*.cpp) \
38 SRC.simple_async := simple_async.cpp
40 SRC := $(SRC.loba) $(SRC.simple_async)
41 OBJ := $(SRC:%.cpp=%.o)
42 DEP := $(SRC:%.cpp=%.d)
44 DEFAULT_TARGETS := loba
45 FLAVOURED_LOBA := loba-dev loba-stable
46 TARGETS := $(DEFAULT_TARGETS) \
49 .PHONY: all full clean realclean $(FLAVOURED_LOBA)
51 all: $(DEFAULT_TARGETS)
54 $(MAKE) $(FLAVOURED_LOBA)
58 $(RM) core core.[0-9]* vgcore.[0-9]*
66 $(RM) $(FLAVOURED_LOBA)
69 %.d: %.cpp ; $(MAKEDEPEND.CXX)
73 $(MAKE) SIMGRID_INSTALL_DIR=./simgrid-$(patsubst loba-%,%,$@) loba
77 misc_autogen.h: $(SIMGRID_INSTALL_DIR)/include/xbt/log.h
78 grep -C1 '# *define *CLOG' $< \
79 | sed 's/CLOG/XCLOG/;s/_XBT_LOGV\(([^)]*)\)/(*\1)/' > $@
81 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
83 ifeq ($(filter $(MAKECMDGOALS),full clean realclean $(FLAVOURED_LOBA)),)
84 $(shell ./setlocalversion)
89 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
90 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@