Routino SVN Repository Browser

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

ViewVC logotype

Contents of /branches/libroutino/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1781 - (show annotations) (download)
Fri Aug 14 18:44:29 2015 UTC (9 years, 7 months ago) by amb
File size: 8098 byte(s)
Using 'make install' now installs the libraries.  On Windows
installation uses 'Program Files/Routino' as the base directory.

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

Properties

Name Value
cvs:description Makefile.