Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /branches/destination-access/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1829 - (show annotations) (download)
Sat Oct 17 14:17:17 2015 UTC (9 years, 5 months ago) by amb
File size: 8719 byte(s)
Merge trunk back into routino-destination branch after completing the
loop and reverse changes.

1 # Source code Makefile
2 #
3 # Part of the Routino routing software.
4 #
5 # This file Copyright 2008-2015 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 # All configuration is in the top-level Makefile.conf
22
23 include ../Makefile.conf
24
25 # Sub-directories and sub-makefiles
26
27 SUBDIRS=xml test
28
29 # Compilation targets
30
31 DEPDIR=.deps
32
33 C=$(wildcard *.c)
34 D=$(wildcard $(DEPDIR)/*.d)
35
36 EXE=planetsplitter$(.EXE) planetsplitter-slim$(.EXE) router$(.EXE) router-slim$(.EXE) \
37 filedumperx$(.EXE) filedumper$(.EXE) filedumper-slim$(.EXE) \
38 router+lib$(.EXE) router+lib-slim$(.EXE)
39
40 ifneq ($(HOST),MINGW)
41 LIB =libroutino.so libroutino-slim.so
42 LIB+=libroutino.so.$(SOVERSION) libroutino-slim.so.$(SOVERSION)
43 LIB+=libroutino.so.$(LIBVERSION) libroutino-slim.so.$(LIBVERSION)
44 else
45 LIB =routino.dll routino-slim.dll
46 LIB+=routino.def routino-slim.def
47 LIB+=routino.lib routino-slim.lib
48 endif
49
50 INC=routino.h
51
52 ifneq ($(HOST),MINGW)
53 LINK_LIB=libroutino.so
54 LINK_SLIM_LIB=libroutino-slim.so
55 else
56 LINK_LIB=routino.dll
57 LINK_SLIM_LIB=routino-slim.dll
58 endif
59
60 ########
61
62 all: all-local
63 for dir in $(SUBDIRS); do \
64 ( cd $$dir && $(MAKE) $@ ); \
65 done
66
67 all-local: all-exe all-lib
68
69 all-exe : $(EXE)
70
71 all-lib : $(LIB)
72
73 ########
74
75 PLANETSPLITTER_OBJ=planetsplitter.o \
76 nodesx.o segmentsx.o waysx.o relationsx.o superx.o prunex.o \
77 ways.o types.o \
78 files.o logging.o logerror.o errorlogx.o \
79 results.o queue.o sorting.o \
80 xmlparse.o tagging.o \
81 uncompress.o osmxmlparse.o osmpbfparse.o osmo5mparse.o osmparser.o
82
83 ifeq ($(HOST),MINGW)
84 PLANETSPLITTER_OBJ+=mman-win32.o
85 endif
86
87 planetsplitter$(.EXE) : $(PLANETSPLITTER_OBJ)
88 $(LD) $^ -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 logerror-slim.o errorlogx-slim.o \
96 results.o queue.o sorting.o \
97 xmlparse.o tagging.o \
98 uncompress.o osmxmlparse.o osmpbfparse.o osmo5mparse.o osmparser.o
99
100 ifeq ($(HOST),MINGW)
101 PLANETSPLITTER_SLIM_OBJ+=mman-win32.o
102 endif
103
104 planetsplitter-slim$(.EXE) : $(PLANETSPLITTER_SLIM_OBJ)
105 $(LD) $^ -o $@ $(LDFLAGS)
106
107 ########
108
109 ROUTER_OBJ=router.o \
110 nodes.o segments.o ways.o relations.o types.o fakes.o \
111 optimiser.o output.o \
112 files.o logging.o profiles.o xmlparse.o \
113 results.o queue.o translations.o
114
115 ifeq ($(HOST),MINGW)
116 ROUTER_OBJ+=mman-win32.o
117 endif
118
119 router$(.EXE) : $(ROUTER_OBJ)
120 $(LD) $^ -o $@ $(LDFLAGS)
121
122 ########
123
124 ROUTER_SLIM_OBJ=router-slim.o \
125 nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \
126 optimiser-slim.o output-slim.o \
127 files.o logging.o profiles.o xmlparse.o \
128 results.o queue.o translations.o
129
130 ifeq ($(HOST),MINGW)
131 ROUTER_SLIM_OBJ+=mman-win32.o
132 endif
133
134 router-slim$(.EXE) : $(ROUTER_SLIM_OBJ)
135 $(LD) $^ -o $@ $(LDFLAGS)
136
137 ########
138
139 FILEDUMPERX_OBJ=filedumperx.o \
140 files.o logging.o
141
142 ifeq ($(HOST),MINGW)
143 FILEDUMPERX_OBJ+=mman-win32.o
144 endif
145
146 filedumperx$(.EXE) : $(FILEDUMPERX_OBJ)
147 $(LD) $^ -o $@ $(LDFLAGS)
148
149 ########
150
151 FILEDUMPER_OBJ=filedumper.o \
152 nodes.o segments.o ways.o relations.o types.o fakes.o errorlog.o \
153 visualiser.o \
154 files.o logging.o xmlparse.o
155
156 ifeq ($(HOST),MINGW)
157 FILEDUMPER_OBJ+=mman-win32.o
158 endif
159
160 filedumper$(.EXE) : $(FILEDUMPER_OBJ)
161 $(LD) $^ -o $@ $(LDFLAGS)
162
163 ########
164
165 FILEDUMPER_SLIM_OBJ=filedumper-slim.o \
166 nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o errorlog-slim.o \
167 visualiser-slim.o \
168 files.o logging.o xmlparse.o
169
170 ifeq ($(HOST),MINGW)
171 FILEDUMPER_SLIM_OBJ+=mman-win32.o
172 endif
173
174 filedumper-slim$(.EXE) : $(FILEDUMPER_SLIM_OBJ)
175 $(LD) $^ -o $@ $(LDFLAGS)
176
177 ########
178
179 %.o : %.c
180 -@[ -d $(DEPDIR) ] || mkdir $(DEPDIR)
181 $(CC) -c $(CFLAGS) -DSLIM=0 -DROUTINO_DATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $@)))
182
183 %-slim.o : %.c
184 -@[ -d $(DEPDIR) ] || mkdir $(DEPDIR)
185 $(CC) -c $(CFLAGS) -DSLIM=1 -DROUTINO_DATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $@)))
186
187 ########
188
189 ROUTER_LIB_OBJ=router+lib.o
190
191 router+lib$(.EXE) : $(ROUTER_LIB_OBJ) $(LINK_LIB)
192 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LDSO)
193
194 router+lib-slim$(.EXE) : $(ROUTER_LIB_OBJ) $(LINK_SLIM_LIB)
195 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LDSO)
196
197 ########
198
199 LIBROUTINO_OBJ=routino-lib.o \
200 nodes-lib.o segments-lib.o ways-lib.o relations-lib.o types-lib.o fakes-lib.o \
201 optimiser-lib.o output-lib.o \
202 files-lib.o profiles-lib.o xmlparse-lib.o \
203 results-lib.o queue-lib.o translations-lib.o
204
205 ifeq ($(HOST),MINGW)
206 LIBROUTINO_OBJ+=mman-win32.o
207 endif
208
209 libroutino.so.$(LIBVERSION) : $(LIBROUTINO_OBJ)
210 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LIB) $(LDFLAGS_SONAME)
211
212 libroutino.so.$(SOVERSION) : libroutino.so.$(LIBVERSION)
213 ln -sf $< $@
214
215 libroutino.so : libroutino.so.$(LIBVERSION)
216 ln -sf $< $@
217
218 routino.dll : $(LIBROUTINO_OBJ)
219 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LIB)
220
221 routino.def : routino-lib.o
222 dlltool -v --output-def $@ $<
223
224 routino.lib : routino.dll routino.def
225 dlltool -v --dllname routino.dll --def routino.def --output-lib $@
226
227 ########
228
229 LIBROUTINO_SLIM_OBJ=routino-slim-lib.o \
230 nodes-slim-lib.o segments-slim-lib.o ways-slim-lib.o relations-slim-lib.o types-lib.o fakes-slim-lib.o \
231 optimiser-slim-lib.o output-slim-lib.o \
232 files-lib.o profiles-lib.o xmlparse-lib.o \
233 results-lib.o queue-lib.o translations-lib.o
234
235 ifeq ($(HOST),MINGW)
236 LIBROUTINO_SLIM_OBJ+=mman-win32.o
237 endif
238
239 libroutino-slim.so.$(LIBVERSION) : $(LIBROUTINO_SLIM_OBJ)
240 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LIB) $(LDFLAGS_SLIM_SONAME)
241
242 libroutino-slim.so.$(SOVERSION) : libroutino-slim.so.$(LIBVERSION)
243 ln -sf $< $@
244
245 libroutino-slim.so : libroutino-slim.so.$(LIBVERSION)
246 ln -sf $< $@
247
248 routino-slim.dll : $(LIBROUTINO_SLIM_OBJ)
249 $(LD) $^ -o $@ $(LDFLAGS) $(LDFLAGS_LIB)
250
251 routino-slim.def : routino-slim-lib.o
252 dlltool -v --output-def $@ $<
253
254 routino-slim.lib : routino-slim.dll routino-slim.def
255 dlltool -v --dllname routino-slim.dll --def routino-slim.def --output-lib $@
256
257 ########
258
259 %-lib.o : %.c
260 -@[ -d $(DEPDIR) ] || mkdir $(DEPDIR)
261 $(CC) -c $(CFLAGS) $(CFLAGS_LIB) -DSLIM=0 -DLIBROUTINO $< -o $@ -MMD -MP -MF $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $@)))
262
263 %-slim-lib.o : %.c
264 -@[ -d $(DEPDIR) ] || mkdir $(DEPDIR)
265 $(CC) -c $(CFLAGS) $(CFLAGS_LIB) -DSLIM=1 -DLIBROUTINO $< -o $@ -MMD -MP -MF $(addprefix $(DEPDIR)/,$(addsuffix .d,$(basename $@)))
266
267 ########
268
269 test: test-local
270 for dir in $(SUBDIRS); do \
271 ( cd $$dir && $(MAKE) $@ ); \
272 done
273
274 test-local:
275
276 ########
277
278 install: install-local
279 for dir in $(SUBDIRS); do \
280 ( cd $$dir && $(MAKE) $@ ); \
281 done
282
283 install-local: all-local
284 @[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir)
285 @for file in $(EXE); do \
286 if [ -f $$file ]; then \
287 echo cp $$file $(DESTDIR)$(bindir) ;\
288 cp -f $$file $(DESTDIR)$(bindir) ;\
289 fi ;\
290 done
291 @[ -d $(DESTDIR)$(incdir) ] || mkdir -p $(DESTDIR)$(incdir)
292 @for file in $(INC); do \
293 if [ -f $$file ]; then \
294 echo cp $$file $(DESTDIR)$(incdir) ;\
295 cp -f $$file $(DESTDIR)$(incdir) ;\
296 fi ;\
297 done
298 @[ -d $(DESTDIR)$(libdir) ] || mkdir -p $(DESTDIR)$(libdir)
299 @for file in $(LIB); do \
300 if [ -f $$file ]; then \
301 echo cp $$file $(DESTDIR)$(libdir) ;\
302 cp -df $$file $(DESTDIR)$(libdir) ;\
303 fi ;\
304 done
305
306 ########
307
308 clean: clean-local
309 for dir in $(SUBDIRS); do \
310 ( cd $$dir && $(MAKE) $@ ); \
311 done
312
313 clean-local:
314 rm -f *~
315 rm -f *.o
316 rm -f $(EXE)
317 rm -f $(LIB)
318 rm -f $(D)
319 rm -fr $(DEPDIR)
320 rm -f core
321 rm -f *.gcda *.gcno *.gcov gmon.out
322
323 ########
324
325 distclean: distclean-local
326 for dir in $(SUBDIRS); do \
327 ( cd $$dir && $(MAKE) $@ ); \
328 done
329
330 distclean-local: clean-local
331
332 ########
333
334 include $(D)
335
336 ########
337
338 .PHONY:: all test install clean distclean
339
340 .PHONY:: all-local test-local install-local clean-local distclean-local

Properties

Name Value
cvs:description Makefile.