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

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