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 991 - (show annotations) (download)
Wed May 2 16:40:08 2012 UTC (12 years, 10 months ago) by amb
File size: 5323 byte(s)
Convert sorting algorithms to optionally use multiple threads.

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 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 FILEDUMPER_OBJ=filedumper.o \
127 nodes.o segments.o ways.o relations.o types.o fakes.o \
128 visualiser.o \
129 files.o logging.o xmlparse.o
130
131 filedumper : $(FILEDUMPER_OBJ)
132 $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS)
133
134 ########
135
136 FILEDUMPER_SLIM_OBJ=filedumper-slim.o \
137 nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \
138 visualiser-slim.o \
139 files.o logging.o xmlparse.o
140
141 filedumper-slim : $(FILEDUMPER_SLIM_OBJ)
142 $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS)
143
144 ########
145
146 TAGMODIFIER_OBJ=tagmodifier.o \
147 files.o logging.o \
148 xmlparse.o tagging.o
149
150 tagmodifier : $(TAGMODIFIER_OBJ)
151 $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS)
152
153 ########
154
155 xmlparse.c : xmlparse.l
156 $(LEX) $(LEXFLAGS) $<
157 -@mv lex.yy.c xmlparse.c
158 @echo Created xmlparse.c
159
160 ########
161
162 %.o : %.c
163 @[ -d .deps ] || mkdir .deps
164 $(CC) -c $(CFLAGS) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@)))
165
166 %-slim.o : %.c
167 @[ -d .deps ] || mkdir .deps
168 $(CC) -c $(CFLAGS) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@)))
169
170 ########
171
172 test:
173 cd xml && $(MAKE) test
174 cd test && $(MAKE) test
175
176 ########
177
178 install: all
179 -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir)
180 @[ -d $(DESTDIR)$(bindir) ] && \
181 for file in $(EXE); do \
182 echo cp $$file $(DESTDIR)$(bindir) ;\
183 cp -f $$file $(DESTDIR)$(bindir) ;\
184 done
185
186 ########
187
188 clean:
189 rm -f *.o
190 rm -f *~
191 rm -f *.gcda *.gcno *.gcov gmon.out
192 rm -f xmlparse.c
193 cd xml && $(MAKE) clean
194 cd test && $(MAKE) clean
195
196 ########
197
198 distclean: clean
199 -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE)
200 -rm -f $(EXE)
201 -rm -f $(D)
202 -rm -fr .deps
203 cd xml && $(MAKE) distclean
204 cd test && $(MAKE) distclean
205
206 ########
207
208 include $(D)
209
210 ########
211
212 top=-top
213 include ../Makefile

Properties

Name Value
cvs:description Makefile.