Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/Makefile
Parent Directory
|
Revision Log
Revision 1149 -
(show annotations)
(download)
Sat Nov 17 18:55:11 2012 UTC (12 years, 4 months ago) by amb
File size: 5484 byte(s)
Sat Nov 17 18:55:11 2012 UTC (12 years, 4 months ago) by amb
File size: 5484 byte(s)
Add a new program to dump the contents of the intermediate files that are generated by using --preserve or --changes.
1 | # Source code Makefile |
2 | # |
3 | # Part of the Routino routing software. |
4 | # |
5 | # This file Copyright 2008-2012 Andrew M. Bishop |
6 | # |
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 | |
21 | # Web file paths |
22 | |
23 | WEBDIR=../web/bin |
24 | |
25 | # Compilation programs |
26 | |
27 | CC=gcc |
28 | LD=gcc |
29 | |
30 | LEX=flex |
31 | |
32 | # Compilation program options |
33 | |
34 | CFLAGS=-Wall -Wmissing-prototypes -std=c99 |
35 | #CFLAGS+=-Wextra -pedantic |
36 | LDFLAGS=-lm |
37 | |
38 | CFLAGS+=-O3 |
39 | #CFLAGS+=-O0 -g |
40 | #CFLAGS+=-pg |
41 | #CFLAGS+=-fprofile-arcs -ftest-coverage |
42 | |
43 | #LDFLAGS+=-pg -static |
44 | #LDFLAGS+=-fprofile-arcs -ftest-coverage |
45 | |
46 | LEXFLAGS= |
47 | |
48 | # Required for multi-threaded support |
49 | CFLAGS+=-pthread -DUSE_PTHREADS |
50 | LDFLAGS+=-pthread -lpthread |
51 | |
52 | # Required to use stdio with files > 2GiB on 32-bit system. |
53 | CFLAGS+=-D_FILE_OFFSET_BITS=64 |
54 | |
55 | # Required to compile on Linux without a warning about pread() and pwrite() functions. |
56 | CFLAGS+=-D_POSIX_C_SOURCE=200809L |
57 | |
58 | # Compilation targets |
59 | |
60 | C=$(wildcard *.c) |
61 | D=$(wildcard .deps/*.d) |
62 | |
63 | EXE=planetsplitter planetsplitter-slim router router-slim filedumperx filedumper filedumper-slim tagmodifier |
64 | |
65 | ######## |
66 | |
67 | all: $(EXE) |
68 | -@[ -d $(WEBDIR) ] && \ |
69 | for file in $(EXE); do \ |
70 | if [ ! -f $(WEBDIR)/$$file ] || [ $$file -nt $(WEBDIR)/$$file ]; then \ |
71 | echo cp $$file $(WEBDIR) ;\ |
72 | cp -f $$file $(WEBDIR) ;\ |
73 | fi ;\ |
74 | done |
75 | @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
76 | @cd test && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
77 | |
78 | ######## |
79 | |
80 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
81 | nodesx.o segmentsx.o waysx.o relationsx.o superx.o prunex.o \ |
82 | ways.o types.o \ |
83 | files.o logging.o \ |
84 | results.o queue.o sorting.o \ |
85 | xmlparse.o tagging.o osmparser.o |
86 | |
87 | planetsplitter : $(PLANETSPLITTER_OBJ) |
88 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) |
89 | |
90 | ######## |
91 | |
92 | PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \ |
93 | nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o prunex-slim.o \ |
94 | ways.o types.o \ |
95 | files.o logging.o \ |
96 | results.o queue.o sorting.o \ |
97 | xmlparse.o tagging.o osmparser.o |
98 | |
99 | planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ) |
100 | $(LD) $(PLANETSPLITTER_SLIM_OBJ) -o $@ $(LDFLAGS) |
101 | |
102 | ######## |
103 | |
104 | ROUTER_OBJ=router.o \ |
105 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
106 | optimiser.o output.o \ |
107 | files.o logging.o profiles.o xmlparse.o \ |
108 | results.o queue.o translations.o |
109 | |
110 | router : $(ROUTER_OBJ) |
111 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) |
112 | |
113 | ######## |
114 | |
115 | ROUTER_SLIM_OBJ=router-slim.o \ |
116 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
117 | optimiser-slim.o output-slim.o \ |
118 | files.o logging.o profiles.o xmlparse.o \ |
119 | results.o queue.o translations.o |
120 | |
121 | router-slim : $(ROUTER_SLIM_OBJ) |
122 | $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS) |
123 | |
124 | ######## |
125 | |
126 | FILEDUMPERX_OBJ=filedumperx.o \ |
127 | files.o |
128 | |
129 | filedumperx : $(FILEDUMPERX_OBJ) |
130 | $(LD) $(FILEDUMPERX_OBJ) -o $@ $(LDFLAGS) |
131 | |
132 | ######## |
133 | |
134 | FILEDUMPER_OBJ=filedumper.o \ |
135 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
136 | visualiser.o \ |
137 | files.o logging.o xmlparse.o |
138 | |
139 | filedumper : $(FILEDUMPER_OBJ) |
140 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) |
141 | |
142 | ######## |
143 | |
144 | FILEDUMPER_SLIM_OBJ=filedumper-slim.o \ |
145 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
146 | visualiser-slim.o \ |
147 | files.o logging.o xmlparse.o |
148 | |
149 | filedumper-slim : $(FILEDUMPER_SLIM_OBJ) |
150 | $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS) |
151 | |
152 | ######## |
153 | |
154 | TAGMODIFIER_OBJ=tagmodifier.o \ |
155 | files.o logging.o \ |
156 | xmlparse.o tagging.o |
157 | |
158 | tagmodifier : $(TAGMODIFIER_OBJ) |
159 | $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS) |
160 | |
161 | ######## |
162 | |
163 | xmlparse.c : xmlparse.l |
164 | $(LEX) $(LEXFLAGS) $< |
165 | -@mv lex.yy.c xmlparse.c |
166 | @echo Created xmlparse.c |
167 | |
168 | ######## |
169 | |
170 | %.o : %.c |
171 | @[ -d .deps ] || mkdir .deps |
172 | $(CC) -c $(CFLAGS) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
173 | |
174 | %-slim.o : %.c |
175 | @[ -d .deps ] || mkdir .deps |
176 | $(CC) -c $(CFLAGS) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
177 | |
178 | ######## |
179 | |
180 | test: |
181 | cd xml && $(MAKE) test |
182 | cd test && $(MAKE) test |
183 | |
184 | ######## |
185 | |
186 | install: all |
187 | -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir) |
188 | @[ -d $(DESTDIR)$(bindir) ] && \ |
189 | for file in $(EXE); do \ |
190 | echo cp $$file $(DESTDIR)$(bindir) ;\ |
191 | cp -f $$file $(DESTDIR)$(bindir) ;\ |
192 | done |
193 | |
194 | ######## |
195 | |
196 | clean: |
197 | rm -f *~ |
198 | rm -f *.o |
199 | rm -f core |
200 | rm -f *.gcda *.gcno *.gcov gmon.out |
201 | rm -f xmlparse.c |
202 | cd xml && $(MAKE) clean |
203 | cd test && $(MAKE) clean |
204 | |
205 | ######## |
206 | |
207 | distclean: clean |
208 | -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE) |
209 | -rm -f $(EXE) |
210 | -rm -f $(D) |
211 | -rm -fr .deps |
212 | cd xml && $(MAKE) distclean |
213 | cd test && $(MAKE) distclean |
214 | |
215 | ######## |
216 | |
217 | include $(D) |
218 | |
219 | ######## |
220 | |
221 | top=-top |
222 | include ../Makefile |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |