ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/ALiBio/Makefile
Revision: 1.42
Committed: Sun Jul 16 20:33:57 2006 UTC (10 years ago) by mauro
Branch: MAIN
CVS Tags: HEAD
Changes since 1.41: +16 -13 lines
Log Message:
*** empty log message ***

Line File contents
1 #
2 # main Makefile of ALiBio
3 ##################################
4 #
5 # List of directories
6 #
7 SRCDIR=src
8 TESTDIR=test
9 DOCDIR=doc
10 INCLUDEDIR=include/alibio
11 WWWDIR=website
12
13 SHELL=/bin/sh
14 NOTANGLE=notangle -L
15 NOWEAVE=noweave -filter doc/filter.names -delay -index
16 LATEX=latex '\scrollmode \input '"$*"; while grep -s 'Rerun to get cross-references right' "$*.log"; do latex '\scrollmode \input '"$*"; done
17
18 #####################
19 # Compiler options for production code
20 #
21 #OPT1= -O4 -fomit-frame-pointer -ffast-math -fexpensive-optimizations
22 #OPT2= -mtune=i686 -malign-functions=2 -malign-jumps=2
23 #OPT3= -fomit-frame-pointer -malign-loops=2
24 #OPT= $(OPT1) $(OPT2) $(OPT3)
25 #####################
26
27 #####################
28 # Compiler options for debugging code
29 #
30 #OPT= -g
31 #####################
32
33 #####################
34 # Compiler options for profiling code
35 #
36 #
37 OPT= -pg -g -O3 -mtune=i686
38 #########################
39
40
41 INCLUDE=-I
42 LIBS=./include
43 ARGS=-Wall
44
45 CXX=g++ $(OPT) $(INCLUDE) $(LIBS)
46 CC=gcc
47 ONE_TEST=$(TESTDIR)/run_regression_test.pl
48
49
50 %.o: %.cpp
51 $(CXX) $< -o $@
52
53 %.test: %.o %.in
54 $(ONE_TEST) $^ $@
55
56 # Implicit rule for creating tex files
57 %.tex:
58 $(NOWEAVE) $^ | cpif $@
59
60 # Implicit rule for creating C++ program and header files
61 %.cpp:
62 $(NOTANGLE) -R$(@F) $^ | cpif $@
63 %.hpp:
64 $(NOTANGLE) -R$(@F) $^ | cpif $@
65
66
67
68 #
69 # Pattern rule for redefining the set of requisites for source files
70 #
71 %.dpp: %.cpp ; set -e; $(CXX) -M $< \
72 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
73 [ -s $@ ] || rm -f $@
74
75 #
76 # Default targets
77 #
78 default: README includedir doc test_results
79 all: default checkGPL
80
81
82 # Special targets
83 .PHONY: all clean testclean doc test build libs default checkLGPL includedir
84 .SECONDARY:
85
86
87 #
88 # Documentation
89 #
90 doc: $(DOCDIR)/gene_networks.tex $(DOCDIR)/sequences.tex $(DOCDIR)/trees.tex\
91 $(DOCDIR)/nj.tex $(DOCDIR)/test.tex $(DOCDIR)/two_sequences.tex
92 cd $(DOCDIR) ; make all
93
94 $(DOCDIR)/test.tex: test/test.nw
95 $(DOCDIR)/sequences.tex: data_structures/sequences.nw
96 $(DOCDIR)/trees.tex: data_structures/trees.nw
97 $(DOCDIR)/nj.tex: phylogeny_reconstruction/nj.nw
98 $(DOCDIR)/haplotype_completion.tex: haplotyping/haplotype_completion.nw
99 $(DOCDIR)/gene_networks.tex: gene_networks/gene_networks.nw
100 $(DOCDIR)/two_sequences.tex: sequence_alignment/two_sequences.nw
101
102 #
103 # C++ Code
104 #
105 build: libs
106
107 #
108 # Data structures
109 #
110 includedir:
111 test -d $(INCLUDEDIR) || mkdir -p $(INCLUDEDIR)
112
113 $(INCLUDEDIR)/symbol.hpp: data_structures/sequences.nw
114 $(INCLUDEDIR)/alphabet.hpp: data_structures/sequences.nw
115 $(INCLUDEDIR)/trees.hpp: data_structures/trees.nw
116 $(INCLUDEDIR)/sequence.hpp: data_structures/sequences.nw
117 $(INCLUDEDIR)/bio_string.hpp: data_structures/sequences.nw
118 $(INCLUDEDIR)/bio_graph.hpp: data_structures/sequences.nw
119 $(INCLUDEDIR)/empty.hpp: data_structures/sequences.nw
120 $(INCLUDEDIR)/score_matrix.hpp: data_structures/sequences.nw
121
122 #
123 # Algorithms
124 #
125 $(INCLUDEDIR)/nj.hpp: phylogeny_reconstruction/nj.nw
126 $(INCLUDEDIR)/haplotyping.hpp: haplotyping/haplotype_completion.nw
127 $(INCLUDEDIR)/gene_networks.hpp: gene_networks/gene_networks.nw
128 $(INCLUDEDIR)/heuristics.hpp: gene_networks/gene_networks.nw
129 $(INCLUDEDIR)/gene_dataset.hpp: gene_networks/gene_networks.nw
130
131
132 $(INCLUDEDIR)/two_sequence.hpp: sequence_alignment/two_sequences.nw
133
134 #
135 # Test files
136 #
137 test: build \
138 $(TESTDIR)/edge.test \
139 $(TESTDIR)/vertex.test $(TESTDIR)/tree_iterator.test $(TESTDIR)/tree.test \
140 $(TESTDIR)/sequence.test $(TESTDIR)/symbol.test $(TESTDIR)/alphabet.test \
141 $(TESTDIR)/bio_string.test $(TESTDIR)/bio_graph.test $(TESTDIR)/neighbor_joining.test \
142 $(TESTDIR)/volcano.test $(TESTDIR)/gene_networks.test \
143 $(TESTDIR)/score_matrix.test $(TESTDIR)/seq_alignment.test \
144
145 $(TESTDIR)/edge.cpp: data_structures/trees.nw
146 $(TESTDIR)/vertex.cpp: data_structures/trees.nw
147 $(TESTDIR)/tree_iterator.cpp: data_structures/trees.nw
148 $(TESTDIR)/tree.cpp: data_structures/trees.nw
149 $(TESTDIR)/sequence.cpp: data_structures/sequences.nw
150 $(TESTDIR)/symbol.cpp: data_structures/sequences.nw
151 $(TESTDIR)/alphabet.cpp: data_structures/sequences.nw
152 $(TESTDIR)/bio_string.cpp: data_structures/sequences.nw
153 $(TESTDIR)/bio_graph.cpp: data_structures/sequences.nw
154 $(TESTDIR)/neighbor_joining.cpp: phylogeny_reconstruction/nj.nw
155 $(TESTDIR)/gene_networks.cpp: gene_networks/gene_networks.nw
156 $(TESTDIR)/volcano.cpp: gene_networks/gene_networks.nw
157 $(TESTDIR)/gene_networks.cpp: gene_networks/gene_networks.nw
158 $(TESTDIR)/gene_dataset.cpp: gene_networks/gene_networks.nw
159
160 $(TESTDIR)/score_matrix.cpp: sequence_alignment/two_sequences.nw
161 $(TESTDIR)/seq_alignment.cpp: sequence_alignment/two_sequences.nw
162 testclean:
163 rm -f $(TESTDIR)/*.test $(TESTDIR)/.*.in.?* $(TESTDIR)/*.cpp
164
165 clean: testclean
166 -find . \( -name '*~' -o -name '*.log' -o -name '*.o' -o -name '.??*' -and -not -name '.cvsignore' \) -type f -print \
167 | xargs rm -f
168 -find include \( -name '*.[chd]pp' \) -type f -print \
169 | xargs rm -f
170 -find doc \( -name '*.aux' -o -name '*.dvi' -o -name '*.pdf' -o -name '*.ps' -o -name \
171 '*_*.tex' -o -name 'alibionoweb.sty' -o -name '*.toc' \
172 -o -name '*.lof' -o -name '*.lot' \) -type f -print | xargs rm -f
173
174
175
176 #
177 # List of all libraries and include files included
178 #
179 libs: $(INCLUDEDIR)/symbol.hpp $(INCLUDEDIR)/alphabet.hpp $(INCLUDEDIR)/sequence.hpp \
180 $(INCLUDEDIR)/bio_string.hpp $(INCLUDEDIR)/bio_graph.hpp $(INCLUDEDIR)/empty.hpp \
181 $(INCLUDEDIR)/trees.hpp $(INCLUDEDIR)/heuristics.hpp $(INCLUDEDIR)/gene_networks.hpp\
182 $(INCLUDEDIR)/gene_dataset.hpp $(INCLUDEDIR)/nj.hpp $(INCLUDEDIR)/haplotyping.hpp \
183 $(INCLUDEDIR)/two_sequence.hpp
184
185 checkLGPL: README build
186 cd $(SRCDIR); ./checkLGPL.pl
187
188 test_results: test
189 cat $(TESTDIR)/*.test | $(TESTDIR)/compute_test_results.pl > $(WWWDIR)/regression_results.php