1 SIMGRID_INSTALL_DIR := ./simgrid-stable
2 #SIMGRID_INSTALL_DIR := ./simgrid-dev
6 CHECK_FLAGS += -Wall -Wextra
11 CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include
12 CPPFLAGS += $(CHECK_FLAGS)
15 #CFLAGS += -fgnu89-inline # workaround simgrid bug
16 CFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
18 #CXXFLAGS += -std=c++0x
19 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
21 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
22 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
24 LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
27 MAKEDEPEND.FLAGS = $(CPPFLAGS) -MM -MG -MF $@ $<
28 MAKEDEPEND.C = $(CC) $(MAKEDEPEND.FLAGS)
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 TARGETS := loba simple_async
51 .PHONY: all clean realclean
56 $(RM) core core.[0-9]* vgcore.[0-9]*
66 %.d: %.c ; $(MAKEDEPEND.C)
67 %.d: %.cpp ; $(MAKEDEPEND.CXX)
69 misc_autogen.h: $(SIMGRID_INSTALL_DIR)/include/xbt/log.h
70 grep -C1 '# *define *CLOG' $< \
71 | sed 's/CLOG/XCLOG/;s/_XBT_LOGV\(([^)]*)\)/(*\1)/' > $@
73 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
75 ifneq ($(MAKECMDGOALS),clean)
76 ifneq ($(MAKECMDGOALS),realclean)
77 $(shell ./setlocalversion)
83 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
84 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@