1 SIMGRID_INSTALL_DIR := ./simgrid-3.5-install
2 #SIMGRID_INSTALL_DIR := ../simgrid-git-install
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 += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
20 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
21 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
23 LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
26 MAKEDEPEND.FLAGS = $(CPPFLAGS) -MM -MF $@ $<
27 MAKEDEPEND.C = $(CC) $(MAKEDEPEND.FLAGS)
28 MAKEDEPEND.CXX = $(CXX) $(MAKEDEPEND.FLAGS)
30 LOCALVERSION := localversion
31 SETLOCALVERSION := ./setlocalversion
33 SRC.loba := main.cpp \
37 $(wildcard loba_*.cpp) \
44 SRC.simple_async := simple_async.cpp
46 SRC := $(SRC.loba) $(SRC.simple_async)
47 OBJ := $(SRC:%.cpp=%.o)
48 DEP := $(SRC:%.cpp=%.d)
50 TARGETS := loba simple_async
52 $(shell $(SETLOCALVERSION))
54 .PHONY: all depend clean
59 $(RM) core core.[0-9]* vgcore.[0-9]*
68 %.d: %.c ; $(MAKEDEPEND.C)
69 %.d: %.cpp ; $(MAKEDEPEND.CXX)
71 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
76 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
77 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@