Added README.md
[mtp.git] / Makefile
1
2 # mtp is the ``Multi Tracked Paths'', an implementation of the
3 # k-shortest paths algorithm for multi-target tracking.
4 #
5 # Copyright (c) 2012 Idiap Research Institute, http://www.idiap.ch/
6 # Written by Francois Fleuret <francois.fleuret@idiap.ch>
7 #
8 # This file is part of mtp.
9 #
10 # mtp is free software: you can redistribute it and/or modify it
11 # under the terms of the GNU General Public License version 3 as
12 # published by the Free Software Foundation.
13 #
14 # mtp is distributed in the hope that it will be useful, but WITHOUT
15 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17 # License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with selector.  If not, see <http://www.gnu.org/licenses/>.
21
22 ifeq ($(STATIC),yes)
23   LDFLAGS=-static -lm
24 else
25   LDFLAGS=-lm
26 endif
27
28 ifeq ($(DEBUG),yes)
29   OPTIMIZE_FLAG = -ggdb3 -DDEBUG -fno-omit-frame-pointer
30 else
31   OPTIMIZE_FLAG = -ggdb3 -O3
32 endif
33
34 ifeq ($(VERBOSE),yes)
35   VERBOSE_FLAG = -DVERBOSE
36 endif
37
38 ifeq ($(PROFILE),yes)
39   PROFILE_FLAG = -pg
40 endif
41
42 CXXFLAGS = -Wconversion -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG) $(VERBOSE_FLAG)
43
44 all: mtp mtp_example
45
46 mtp: \
47         path.o \
48         mtp_graph.o \
49         mtp_tracker.o \
50         mtp.o
51         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
52
53 mtp_example: \
54         path.o \
55         mtp_graph.o \
56         mtp_tracker.o \
57         mtp_example.o
58         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
59
60 Makefile.depend: *.h *.cc Makefile
61         $(CC) $(CXXFLAGS) -M *.cc > Makefile.depend
62
63 clean:
64         \rm -f mtp mtp_example *.o Makefile.depend
65
66 -include Makefile.depend