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