Recoded to UTF-8.
[cmim.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                                                  #
16 # Copyright (C) Ecole Polytechnique Federale de Lausanne                       #
17 # Contact <francois.fleuret@epfl.ch> for comments & bug reports                #
18 ################################################################################
19
20 ifeq ($(CXX),)
21   CXX = g++-2.95
22 endif
23
24 ifeq ($(DEBUG),yes)
25  LDFLAGS = -lm
26  CXXFLAGS = -Wall -g -Wall -DDEBUG -DVERBOSE
27 else
28  LDFLAGS = -lm
29  CXXFLAGS =  -ffast-math -fcaller-saves -finline-functions -funroll-all-loops -Wall -O3
30 endif
31
32 all: cmim create_samples Makefile.depend
33
34 test: all
35         ./test.sh
36
37 cmim: misc.o fastentropy.o classifier.o cmim.o
38         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
39
40 create_samples: create_samples.o
41         $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
42
43 clean:
44         \rm -f *.o cmim
45
46 Makefile.depend: *.h *.cc Makefile
47         $(CC) -M *.cc > Makefile.depend
48
49 ARCHIVE_NAME =  cmim-1.1
50 DIRNAME = cmim-1.1
51
52 archive:
53         cd ..; tar zcvf ${ARCHIVE_NAME}.tgz \
54                         ${DIRNAME}/*.{cc,h,sh,txt} ${DIRNAME}/Makefile ${DIRNAME}/README
55
56 -include Makefile.depend