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 -MF $@ $<
28 MAKEDEPEND.C = $(CC) $(MAKEDEPEND.FLAGS)
29 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
31 LOCALVERSION := localversion
32 SETLOCALVERSION := ./setlocalversion
34 SRC.loba := main.cpp \
39 $(wildcard loba_*.cpp) \
46 SRC.simple_async := simple_async.cpp
48 SRC := $(SRC.loba) $(SRC.simple_async)
49 OBJ := $(SRC:%.cpp=%.o)
50 DEP := $(SRC:%.cpp=%.d)
52 TARGETS := loba simple_async
54 $(shell $(SETLOCALVERSION))
56 .PHONY: all clean realclean
61 $(RM) core core.[0-9]* vgcore.[0-9]*
70 %.d: %.c ; $(MAKEDEPEND.C)
71 %.d: %.cpp ; $(MAKEDEPEND.CXX)
73 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
75 ifneq ($(MAKECMDGOALS),clean)
76 ifneq ($(MAKECMDGOALS),realclean)
82 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
83 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@