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 1715 - (show annotations) (download)
Thu Jun 18 18:54:16 2015 UTC (9 years, 9 months ago) by amb
File size: 6885 byte(s)
Add stub files for Routino library exported functions and Makefile support.

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 # Debugging options
26
27 #CFLAGS+=-O0 -g
28 #CFLAGS+=-pg
29 #CFLAGS+=-fprofile-arcs -ftest-coverage
30
31 #LDFLAGS+=-pg -static
32 #LDFLAGS+=-fprofile-arcs -ftest-coverage
33
34 # Sub-directories and sub-makefiles
35
36 SUBFILES=$(wildcard */Makefile)
37 SUBDIRS=$(foreach f,$(SUBFILES),$(dir $f))
38
39 # Compilation targets
40
41 C=$(wildcard *.c)
42 D=$(wildcard .deps/*.d)
43
44 EXE=planetsplitter planetsplitter-slim router router-slim filedumperx filedumper filedumper-slim
45
46 LIB=libroutino.so libroutino-slim.so
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 LIBROUTINO_OBJ=routino-lib.o \
174 nodes-lib.o segments-lib.o ways-lib.o relations-lib.o types-lib.o fakes-lib.o \
175 optimiser-lib.o output-lib.o \
176 files-lib.o profiles-lib.o xmlparse-lib.o \
177 results-lib.o queue-lib.o translations-lib.o
178
179 ifdef MINGW
180 LIBROUTINO_OBJ+=mman-win32.o
181 endif
182
183 libroutino.so : $(LIBROUTINO_OBJ)
184 $(LD) $(LIBROUTINO_OBJ) -o $@ $(LDFLAGS) $(LDFLAGS_LIB)
185
186 ########
187
188 LIBROUTINO_SLIM_OBJ=routino-slim-lib.o \
189 nodes-slim-lib.o segments-slim-lib.o ways-slim-lib.o relations-slim-lib.o types-lib.o fakes-slim-lib.o \
190 optimiser-slim-lib.o output-slim-lib.o \
191 files-lib.o profiles-lib.o xmlparse-lib.o \
192 results-lib.o queue-lib.o translations-lib.o
193
194 ifdef MINGW
195 LIBROUTINO_SLIM_OBJ+=mman-win32.o
196 endif
197
198 libroutino-slim.so : $(LIBROUTINO_SLIM_OBJ)
199 $(LD) $(LIBROUTINO_SLIM_OBJ) -o $@ $(LDFLAGS) $(LDFLAGS_LIB)
200
201 ########
202
203 %-lib.o : %.c
204 @[ -d .deps ] || mkdir .deps
205 $(CC) -c $(CFLAGS) $(CFLAGS_LIB) -DSLIM=0 -DLIBROUTINO $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@)))
206
207 %-slim-lib.o : %.c
208 @[ -d .deps ] || mkdir .deps
209 $(CC) -c $(CFLAGS) $(CFLAGS_LIB) -DSLIM=1 -DLIBROUTINO $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@)))
210
211 ########
212
213 test: test-local
214 for dir in $(SUBDIRS); do \
215 ( cd $$dir && $(MAKE) $@ ); \
216 done
217
218 test-local:
219
220 ########
221
222 install: install-local
223 for dir in $(SUBDIRS); do \
224 ( cd $$dir && $(MAKE) $@ ); \
225 done
226
227 install-local: all-local
228 @[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir)
229 @for file in $(EXE); do \
230 if [ -f $$file ]; then \
231 echo cp $$file $(DESTDIR)$(bindir) ;\
232 cp -f $$file $(DESTDIR)$(bindir) ;\
233 fi ;\
234 if [ -f $$file.exe ]; then \
235 echo cp $$file.exe $(DESTDIR)$(bindir) ;\
236 cp -f $$file.exe $(DESTDIR)$(bindir) ;\
237 fi ;\
238 done
239
240 ########
241
242 clean: clean-local
243 for dir in $(SUBDIRS); do \
244 ( cd $$dir && $(MAKE) $@ ); \
245 done
246
247 clean-local:
248 rm -f *~
249 rm -f *.o
250 rm -f $(EXE) *.exe
251 rm -f $(LIB)
252 rm -f $(D)
253 rm -fr .deps
254 rm -f core
255 rm -f *.gcda *.gcno *.gcov gmon.out
256
257 ########
258
259 distclean: distclean-local
260 for dir in $(SUBDIRS); do \
261 ( cd $$dir && $(MAKE) $@ ); \
262 done
263
264 distclean-local: clean-local
265
266 ########
267
268 include $(D)
269
270 ########
271
272 .PHONY:: all test install clean distclean
273
274 .PHONY:: all-local test-local install-local clean-local distclean-local

Properties

Name Value
cvs:description Makefile.