Routino SVN Repository Browser

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

ViewVC logotype

Contents of /trunk/src/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1292 - (show annotations) (download)
Fri May 3 15:25:56 2013 UTC (11 years, 10 months ago) by amb
File size: 5652 byte(s)
Add node, segment, way and turn relation cache for slim mode.  Approx 40%
speed-up for router.

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

Properties

Name Value
cvs:description Makefile.