-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
87 lines (66 loc) · 1.9 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
all: doall
################################
TARGETS = libtoro.a libtoro3d.a toro toro3d
libtoro.a: posegraph2.o treeoptimizer2.o
libtoro3d.a: posegraph3.o treeoptimizer3.o treeoptimizer3_iteration.o
toro: posegraph2.o treeoptimizer2.o toro.o
toro3d: posegraph3.o treeoptimizer3.o treeoptimizer3_iteration.o toro3d.o
################################
#
# CONFIG
#
SILENT = @
ECHO = @echo
MAKE = make
CXX=/usr/bin/g++
LINK = $(CXX)
AR = ar cr
RM = rm -rf
RANLIB = ranlib
ifdef CYGWIN
CXXFLAGS += -DCYGWIN
endif
#CXXFLAGS += -O3 -ffast-math -Wall -W
CXXFLAGS += -O0 -g -Wall -W
IFLAGS =
LFLAGS =
################################
#
# RULES
#
banner = $(SILENT) \
echo ; \
echo "*****************************************************" ; \
echo "* TORO (c) by Giorgio Grisetti, Cyrill Stachniss, *" ; \
echo "* Slawomir Grzonka, Wolfram Burgard *" ; \
echo "*****************************************************" ; \
doall:
$(banner)
$(SILENT) for i in $(filter %.a, $(TARGETS)) xxxx ; do \
if test ! "$$i" = "xxxx" ; then \
if ! $(MAKE) $$i ; then \
exit -1; \
fi; \
fi ; \
done
$(SILENT) for i in $(filter-out %.a, $(TARGETS)) xxxx ; do \
if test ! "$$i" = "xxxx" ; then \
if ! $(MAKE) $$i ; then \
exit -1; \
fi; \
fi ; \
done
clean:
$(banner)
$(ECHO) " ---- Cleaning up "
$(SILENT) $(RM) *.o *.a *.so *.exe core a.out Makefile.depend Makefile.depend.bak $(TARGETS)
%.o: %.cpp
$(ECHO) " ---- Compiling $< to $@ (CXX)"
$(SILENT) $(CXX) $(CXXFLAGS) $(IFLAGS) -c $<
%.a:
$(ECHO) " ---- Archiving $^ into $@ (CXX)"
$(SILENT) $(AR) $@ $^
$(SILENT) $(RANLIB) $@
%: %.o
$(ECHO) " ---- Linking $^ to $@ (CXX)"
$(SILENT) $(LINK) $(CXXFLAGS) $(IFLAGS) $(filter %.o, $^) $(filter %.a, $^) -o $@ -L. $(patsubst lib%.a,-l%,$(filter %.a, $^)) $(LFLAGS) $(LFLAGS_POST)