]> AND Private Git Repository - loba.git/blob - Makefile
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Initial commit.
[loba.git] / Makefile
1 SIMGRID_INSTALL_DIR := ./simgrid-3.5-install
2
3 OPTIM_FLAGS += -O3
4 DEBUG_FLAGS += -g
5 CHECK_FLAGS += -Wall -Wextra
6
7 CC := gcc
8 CXX := g++
9
10 CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include
11 CPPFLAGS += $(CHECK_FLAGS)
12
13 CFLAGS += -std=c99
14 CFLAGS += -fgnu89-inline        # workaround simgrid bug
15 CFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
16
17 CXXFLAGS += $(OPTIM_FLAGS) $(DEBUG_FLAGS)
18
19 LDFLAGS += -L $(SIMGRID_INSTALL_DIR)/lib
20 LDFLAGS += -Wl,-rpath,$(SIMGRID_INSTALL_DIR)/lib
21
22 LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
23 LDLIBS := -lsimgrid
24
25 MAKEDEPEND.C = $(CC) $(CPPFLAGS) -MM -MF $@ $<
26 MAKEDEPEND.CXX = $(CXX) $(CPPFLAGS) -MM -MF $@ $<
27
28 LOCALVERSION := localversion
29 SETLOCALVERSION := ./setlocalversion
30
31 SRC.loba := main.cpp            \
32         communicator.cpp        \
33         parameters.cpp          \
34         process.cpp             \
35         version.cpp
36
37 SRC.simple_async := simple_async.cpp
38
39 SRC := $(SRC.loba) $(SRC.simple_async)
40 OBJ := $(SRC:%.cpp=%.o)
41 DEP := $(SRC:%.cpp=%.d)
42
43 TARGETS := loba simple_async
44
45 $(shell $(SETLOCALVERSION))
46
47 .PHONY: all depend clean
48
49 all: $(TARGETS)
50
51 clean:
52         $(RM) core core.[0-9]* vgcore.[0-9]*
53         $(RM) $(LOCALVERSION)
54         $(RM) $(OBJ)
55         $(RM) $(DEP)
56         $(RM) $(TARGETS)
57
58 realclean: clean
59         $(RM) *~
60
61 %.d: %.c ; $(MAKEDEPEND.C)
62 %.d: %.cpp ; $(MAKEDEPEND.CXX)
63
64 version.o: $(patsubst %.cpp,%.o,$(filter-out version.cpp, $(SRC.loba)))
65
66 -include $(DEP)
67
68 .SECONDEXPANSION:
69 $(TARGETS): $$(patsubst %.cpp,%.o,$$(SRC.$$@))
70         $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@