Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/Makefile
Parent Directory
|
Revision Log
Revision 692 -
(hide annotations)
(download)
Fri May 6 18:06:21 2011 UTC (13 years, 10 months ago) by amb
File size: 5119 byte(s)
Fri May 6 18:06:21 2011 UTC (13 years, 10 months ago) by amb
File size: 5119 byte(s)
Allow running 'make test' in the source directory.
1 | amb | 333 | # Source code Makefile |
2 | amb | 2 | # |
3 | amb | 151 | # Part of the Routino routing software. |
4 | amb | 2 | # |
5 | amb | 608 | # This file Copyright 2008-2011 Andrew M. Bishop |
6 | amb | 151 | # |
7 | # This program is free software: you can redistribute it and/or modify | ||
8 | # it under the terms of the GNU Affero General Public License as published by | ||
9 | # the Free Software Foundation, either version 3 of the License, or | ||
10 | # (at your option) any later version. | ||
11 | # | ||
12 | # This program is distributed in the hope that it will be useful, | ||
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | # GNU Affero General Public License for more details. | ||
16 | # | ||
17 | # You should have received a copy of the GNU Affero General Public License | ||
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | # | ||
20 | amb | 2 | |
21 | amb | 476 | # Web file paths |
22 | |||
23 | WEBDIR=../web/bin | ||
24 | |||
25 | # Compilation programs | ||
26 | |||
27 | amb | 2 | CC=gcc |
28 | LD=gcc | ||
29 | |||
30 | amb | 333 | LEX=flex |
31 | |||
32 | amb | 476 | # Compilation program options |
33 | amb | 2 | |
34 | amb | 240 | CFLAGS=-Wall -Wmissing-prototypes |
35 | #CFLAGS+= -Wextra -pedantic -std=c99 | ||
36 | LDFLAGS=-lm -lc | ||
37 | amb | 2 | |
38 | amb | 240 | CFLAGS+= -O3 |
39 | amb | 444 | #CFLAGS+= -O0 -g |
40 | amb | 240 | #CFLAGS+= -pg |
41 | #CFLAGS+= --coverage | ||
42 | |||
43 | LDFLAGS+= | ||
44 | #LDFLAGS+= -pg -static | ||
45 | #LDFLAGS+= --coverage | ||
46 | |||
47 | amb | 333 | LEXFLAGS= |
48 | |||
49 | amb | 384 | # Required to use stdio with files > 2GiB on 32-bit system. |
50 | |||
51 | FLAGS64=-D_FILE_OFFSET_BITS=64 | ||
52 | |||
53 | amb | 2 | # Compilation targets |
54 | |||
55 | C=$(wildcard *.c) | ||
56 | amb | 91 | D=$(foreach f,$(C),$(addprefix .deps/,$(addsuffix .d,$(basename $f)))) |
57 | amb | 2 | |
58 | amb | 453 | EXE=planetsplitter planetsplitter-slim router router-slim filedumper filedumper-slim tagmodifier |
59 | amb | 333 | |
60 | amb | 2 | ######## |
61 | |||
62 | all : $(EXE) | ||
63 | amb | 439 | -@[ -d $(WEBDIR) ] && \ |
64 | for file in $(EXE); do \ | ||
65 | if [ ! -f $(WEBDIR)/$$file ] || [ $$file -nt $(WEBDIR)/$$file ]; then \ | ||
66 | echo cp $$file $(WEBDIR) ;\ | ||
67 | cp -f $$file $(WEBDIR) ;\ | ||
68 | fi ;\ | ||
69 | done | ||
70 | amb | 692 | @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
71 | @cd test && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" | ||
72 | amb | 2 | |
73 | ######## | ||
74 | |||
75 | amb | 161 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
76 | amb | 495 | nodesx.o segmentsx.o waysx.o relationsx.o superx.o \ |
77 | amb | 365 | ways.o types.o \ |
78 | amb | 519 | files.o logging.o \ |
79 | amb | 333 | results.o queue.o sorting.o \ |
80 | amb | 397 | xmlparse.o tagging.o osmparser.o |
81 | amb | 2 | |
82 | planetsplitter : $(PLANETSPLITTER_OBJ) | ||
83 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) | ||
84 | |||
85 | ######## | ||
86 | |||
87 | amb | 452 | PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \ |
88 | amb | 495 | nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o \ |
89 | amb | 452 | ways.o types.o \ |
90 | amb | 519 | files.o logging.o \ |
91 | amb | 452 | results.o queue.o sorting.o \ |
92 | xmlparse.o tagging.o osmparser.o | ||
93 | |||
94 | planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ) | ||
95 | $(LD) $(PLANETSPLITTER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
96 | |||
97 | ######## | ||
98 | |||
99 | amb | 397 | ROUTER_OBJ=router.o \ |
100 | amb | 542 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
101 | amb | 453 | optimiser.o output.o \ |
102 | amb | 519 | files.o logging.o profiles.o xmlparse.o \ |
103 | amb | 453 | results.o queue.o translations.o |
104 | amb | 397 | |
105 | router : $(ROUTER_OBJ) | ||
106 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) | ||
107 | |||
108 | ######## | ||
109 | |||
110 | amb | 453 | ROUTER_SLIM_OBJ=router-slim.o \ |
111 | amb | 542 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes.o \ |
112 | amb | 453 | optimiser-slim.o output-slim.o \ |
113 | amb | 519 | files.o logging.o profiles.o xmlparse.o \ |
114 | amb | 453 | results.o queue.o translations.o |
115 | |||
116 | router-slim : $(ROUTER_SLIM_OBJ) | ||
117 | $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
118 | |||
119 | ######## | ||
120 | |||
121 | amb | 161 | FILEDUMPER_OBJ=filedumper.o \ |
122 | amb | 608 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
123 | amb | 453 | visualiser.o \ |
124 | amb | 519 | files.o logging.o xmlparse.o |
125 | amb | 2 | |
126 | filedumper : $(FILEDUMPER_OBJ) | ||
127 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) | ||
128 | |||
129 | ######## | ||
130 | |||
131 | amb | 453 | FILEDUMPER_SLIM_OBJ=filedumper-slim.o \ |
132 | amb | 608 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes.o \ |
133 | amb | 453 | visualiser-slim.o \ |
134 | amb | 519 | files.o logging.o xmlparse.o |
135 | amb | 453 | |
136 | filedumper-slim : $(FILEDUMPER_SLIM_OBJ) | ||
137 | $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
138 | |||
139 | ######## | ||
140 | |||
141 | amb | 397 | TAGMODIFIER_OBJ=tagmodifier.o \ |
142 | amb | 519 | files.o logging.o \ |
143 | amb | 397 | xmlparse.o tagging.o |
144 | amb | 2 | |
145 | amb | 397 | tagmodifier : $(TAGMODIFIER_OBJ) |
146 | $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS) | ||
147 | amb | 2 | |
148 | ######## | ||
149 | |||
150 | amb | 333 | xmlparse.c : xmlparse.l |
151 | amb | 353 | $(LEX) $(LEXFLAGS) $< |
152 | amb | 333 | -@mv lex.yy.c xmlparse.c |
153 | @echo Created xmlparse.c | ||
154 | |||
155 | ######## | ||
156 | |||
157 | amb | 2 | %.o : %.c |
158 | amb | 613 | $(CC) -c $(CFLAGS) $(FLAGS64) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
159 | amb | 2 | |
160 | amb | 452 | %-slim.o : %.c |
161 | amb | 613 | $(CC) -c $(CFLAGS) $(FLAGS64) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
162 | amb | 452 | |
163 | amb | 2 | ######## |
164 | |||
165 | amb | 476 | install: all |
166 | amb | 482 | -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir) |
167 | @[ -d $(DESTDIR)$(bindir) ] && \ | ||
168 | amb | 476 | for file in $(EXE); do \ |
169 | amb | 482 | echo cp $$file $(DESTDIR)$(bindir) ;\ |
170 | cp -f $$file $(DESTDIR)$(bindir) ;\ | ||
171 | amb | 476 | done |
172 | |||
173 | ######## | ||
174 | |||
175 | amb | 692 | test: .FORCE |
176 | cd xml && $(MAKE) test | ||
177 | cd test && $(MAKE) test | ||
178 | |||
179 | ######## | ||
180 | |||
181 | amb | 2 | clean: |
182 | rm -f *.o | ||
183 | rm -f *~ | ||
184 | amb | 405 | rm -f xmlparse.c |
185 | amb | 692 | cd xml && $(MAKE) clean |
186 | cd test && $(MAKE) clean | ||
187 | amb | 2 | |
188 | ######## | ||
189 | |||
190 | distclean: clean | ||
191 | amb | 192 | -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE) |
192 | amb | 2 | -rm -f $(EXE) |
193 | -rm -f $(D) | ||
194 | amb | 153 | -rm -fr .deps |
195 | amb | 692 | cd xml && $(MAKE) distclean |
196 | cd test && $(MAKE) distclean | ||
197 | amb | 2 | |
198 | ######## | ||
199 | |||
200 | amb | 91 | .deps : .FORCE |
201 | amb | 94 | @[ -d .deps ] || mkdir $@ |
202 | amb | 91 | |
203 | amb | 353 | $(D) : .deps |
204 | amb | 2 | @touch $@ |
205 | |||
206 | include $(D) | ||
207 | |||
208 | ######## | ||
209 | |||
210 | .FORCE : | ||
211 | amb | 482 | |
212 | ######## | ||
213 | |||
214 | top=-top | ||
215 | include ../Makefile |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |