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) \
43 SRC.simple_async := simple_async.cpp
45 SRC := $(SRC.loba) $(SRC.simple_async)
46 OBJ := $(SRC:%.cpp=%.o)
47 DEP := $(SRC:%.cpp=%.d)
49 DEFAULT_TARGETS := loba
50 FLAVOURED_LOBA := loba-dev loba-stable
51 TARGETS := $(DEFAULT_TARGETS) \
54 .PHONY: all full clean realclean $(FLAVOURED_LOBA)
56 all: $(DEFAULT_TARGETS)
59 $(MAKE) $(FLAVOURED_LOBA)
63 $(RM) core core.[0-9]* vgcore.[0-9]*
71 $(RM) $(FLAVOURED_LOBA)
74 %.d: %.cpp ; $(MAKEDEPEND.CXX)
78 $(MAKE) SIMGRID_INSTALL_DIR=./simgrid-$(patsubst loba-%,%,$@) loba
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)/' > $@
86 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
88 ifeq ($(filter $(MAKECMDGOALS),full clean realclean $(FLAVOURED_LOBA)),)
89 $(shell ./setlocalversion)
94 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
95 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@