automatic commit
[folded-ctf.git] / Makefile
1
2 ########################################################################
3 #                                                                      #
4 #  folded-ctf is an implementation of the folded hierarchy of          #
5 #  classifiers for object detection, developed by Francois Fleuret     #
6 #  and Donald Geman.                                                   #
7 #                                                                      #
8 #  Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/   #
9 #  Written by Francois Fleuret <francois.fleuret@idiap.ch>             #
10 #                                                                      #
11 #  This file is part of folded-ctf.                                    #
12 #                                                                      #
13 #  folded-ctf is free software: you can redistribute it and/or modify  #
14 #  it under the terms of the GNU General Public License as published   #
15 #  by the Free Software Foundation, either version 3 of the License,   #
16 #  or (at your option) any later version.                              #
17 #                                                                      #
18 #  folded-ctf is distributed in the hope that it will be useful, but   #
19 #  WITHOUT ANY WARRANTY; without even the implied warranty of          #
20 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   #
21 #  General Public License for more details.                            #
22 #                                                                      #
23 #  You should have received a copy of the GNU General Public License   #
24 #  along with folded-ctf.  If not, see <http://www.gnu.org/licenses/>. #
25 #                                                                      #
26 ########################################################################
27
28 ifeq ($(STATIC),yes)
29   LDFLAGS=-static -lm -ljpeg -lpng -lz
30 else
31   LDFLAGS=-lm -ljpeg -lpng
32 endif
33
34 ifeq ($(DEBUG),yes)
35   OPTIMIZE_FLAG = -ggdb3 -DDEBUG
36 else
37   OPTIMIZE_FLAG = -ggdb3 -O3
38 endif
39
40 ifeq ($(PROFILE),yes)
41   PROFILE_FLAG = -pg
42 endif
43
44 CXXFLAGS = -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG)
45
46 all: folding list_to_pool TAGS
47
48 TAGS: *.cc *.h
49         etags --members -l c++ *.cc *.h
50
51 folding: misc.o interval.o gaussian.o fusion_sort.o global.o tools.o \
52          progress_bar.o \
53          jpeg_misc.o rgb_image.o rgb_image_subpixel.o param_parser.o \
54          shared.o \
55          storable.o \
56          image.o rich_image.o \
57          labelled_image.o \
58          labelled_image_pool.o labelled_image_pool_file.o labelled_image_pool_subset.o \
59          pose.o pose_cell.o pose_cell_set.o pose_cell_scored_set.o \
60          parsing.o parsing_pool.o \
61          pose_cell_hierarchy.o pose_cell_hierarchy_reader.o \
62          pi_referential.o pi_feature.o pi_feature_family.o \
63          sample_set.o \
64          shared_responses.o \
65          classifier.o classifier_reader.o \
66          detector.o \
67          loss_machine.o decision_tree.o boosted_classifier.o \
68          error_rates.o \
69          materials.o \
70          folding.o
71         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
72
73 list_to_pool: misc.o interval.o fusion_sort.o shared.o global.o progress_bar.o \
74          storable.o \
75          jpeg_misc.o rgb_image.o param_parser.o \
76          image.o rich_image.o \
77          pose.o pose_cell.o \
78          labelled_image.o labelled_image_pool.o \
79          list_to_pool.o
80         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
81
82 Makefile.depend: *.h *.cc Makefile
83         $(CC) -M *.cc > Makefile.depend
84
85 archive:
86         cd .. && tar zcvf folding-gpl.tgz folding/*.{cc,h,sh,txt} folding/Makefile folding/gpl-3.0.txt
87
88 clean:
89         \rm -f folding list_to_pool *.o Makefile.depend TAGS
90
91 -include Makefile.depend