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 TARGETS := loba simple_async
46 .PHONY: all clean realclean
51 $(RM) core core.[0-9]* vgcore.[0-9]*
61 %.d: %.cpp ; $(MAKEDEPEND.CXX)
63 misc_autogen.h: $(SIMGRID_INSTALL_DIR)/include/xbt/log.h
64 grep -C1 '# *define *CLOG' $< \
65 | sed 's/CLOG/XCLOG/;s/_XBT_LOGV\(([^)]*)\)/(*\1)/' > $@
67 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
69 ifneq ($(MAKECMDGOALS),clean)
70 ifneq ($(MAKECMDGOALS),realclean)
71 $(shell ./setlocalversion)
77 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
78 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@