Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/Makefile
Parent Directory
|
Revision Log
Revision 887 -
(show annotations)
(download)
Mon Oct 31 19:09:40 2011 UTC (13 years, 5 months ago) by amb
File size: 5241 byte(s)
Mon Oct 31 19:09:40 2011 UTC (13 years, 5 months ago) by amb
File size: 5241 byte(s)
Use pread() and pwrite() functions instead of seek() followed by read() or write().
1 | # Source code Makefile |
2 | # |
3 | # Part of the Routino routing software. |
4 | # |
5 | # This file Copyright 2008-2011 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 -lc |
37 | |
38 | CFLAGS+=-O3 |
39 | #CFLAGS+=-O0 -g |
40 | #CFLAGS+=-pg |
41 | #CFLAGS+=-fprofile-arcs -ftest-coverage |
42 | |
43 | LDFLAGS+= |
44 | #LDFLAGS+=-pg -static |
45 | #LDFLAGS+=-fprofile-arcs -ftest-coverage |
46 | |
47 | LEXFLAGS= |
48 | |
49 | # Required to use stdio with files > 2GiB on 32-bit system. |
50 | CFLAGS+=-D_FILE_OFFSET_BITS=64 |
51 | |
52 | # Required to compile on Linux without a warning about pread() and pwrite() functions. |
53 | CFLAGS+=-D_POSIX_C_SOURCE=200809L |
54 | |
55 | # Compilation targets |
56 | |
57 | C=$(wildcard *.c) |
58 | D=$(wildcard .deps/*.d) |
59 | |
60 | EXE=planetsplitter planetsplitter-slim router router-slim filedumper filedumper-slim tagmodifier |
61 | |
62 | ######## |
63 | |
64 | all: $(EXE) |
65 | -@[ -d $(WEBDIR) ] && \ |
66 | for file in $(EXE); do \ |
67 | if [ ! -f $(WEBDIR)/$$file ] || [ $$file -nt $(WEBDIR)/$$file ]; then \ |
68 | echo cp $$file $(WEBDIR) ;\ |
69 | cp -f $$file $(WEBDIR) ;\ |
70 | fi ;\ |
71 | done |
72 | @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
73 | @cd test && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
74 | |
75 | ######## |
76 | |
77 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
78 | nodesx.o segmentsx.o waysx.o relationsx.o superx.o \ |
79 | ways.o types.o \ |
80 | files.o logging.o \ |
81 | results.o queue.o sorting.o \ |
82 | xmlparse.o tagging.o osmparser.o |
83 | |
84 | planetsplitter : $(PLANETSPLITTER_OBJ) .deps |
85 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) |
86 | |
87 | ######## |
88 | |
89 | PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \ |
90 | nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o \ |
91 | ways.o types.o \ |
92 | files.o logging.o \ |
93 | results.o queue.o sorting.o \ |
94 | xmlparse.o tagging.o osmparser.o |
95 | |
96 | planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ) |
97 | $(LD) $(PLANETSPLITTER_SLIM_OBJ) -o $@ $(LDFLAGS) |
98 | |
99 | ######## |
100 | |
101 | ROUTER_OBJ=router.o \ |
102 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
103 | optimiser.o output.o \ |
104 | files.o logging.o profiles.o xmlparse.o \ |
105 | results.o queue.o translations.o |
106 | |
107 | router : $(ROUTER_OBJ) |
108 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) |
109 | |
110 | ######## |
111 | |
112 | ROUTER_SLIM_OBJ=router-slim.o \ |
113 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
114 | optimiser-slim.o output-slim.o \ |
115 | files.o logging.o profiles.o xmlparse.o \ |
116 | results.o queue.o translations.o |
117 | |
118 | router-slim : $(ROUTER_SLIM_OBJ) |
119 | $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS) |
120 | |
121 | ######## |
122 | |
123 | FILEDUMPER_OBJ=filedumper.o \ |
124 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
125 | visualiser.o \ |
126 | files.o logging.o xmlparse.o |
127 | |
128 | filedumper : $(FILEDUMPER_OBJ) |
129 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) |
130 | |
131 | ######## |
132 | |
133 | FILEDUMPER_SLIM_OBJ=filedumper-slim.o \ |
134 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
135 | visualiser-slim.o \ |
136 | files.o logging.o xmlparse.o |
137 | |
138 | filedumper-slim : $(FILEDUMPER_SLIM_OBJ) |
139 | $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS) |
140 | |
141 | ######## |
142 | |
143 | TAGMODIFIER_OBJ=tagmodifier.o \ |
144 | files.o logging.o \ |
145 | xmlparse.o tagging.o |
146 | |
147 | tagmodifier : $(TAGMODIFIER_OBJ) |
148 | $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS) |
149 | |
150 | ######## |
151 | |
152 | xmlparse.c : xmlparse.l |
153 | $(LEX) $(LEXFLAGS) $< |
154 | -@mv lex.yy.c xmlparse.c |
155 | @echo Created xmlparse.c |
156 | |
157 | ######## |
158 | |
159 | %.o : %.c .deps |
160 | $(CC) -c $(CFLAGS) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
161 | |
162 | %-slim.o : %.c .deps |
163 | $(CC) -c $(CFLAGS) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
164 | |
165 | ######## |
166 | |
167 | test: .FORCE |
168 | cd xml && $(MAKE) test |
169 | cd test && $(MAKE) test |
170 | |
171 | ######## |
172 | |
173 | install: all |
174 | -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir) |
175 | @[ -d $(DESTDIR)$(bindir) ] && \ |
176 | for file in $(EXE); do \ |
177 | echo cp $$file $(DESTDIR)$(bindir) ;\ |
178 | cp -f $$file $(DESTDIR)$(bindir) ;\ |
179 | done |
180 | |
181 | ######## |
182 | |
183 | clean: |
184 | rm -f *.o |
185 | rm -f *~ |
186 | rm -f *.gcda *.gcno *.gcov gmon.out |
187 | rm -f xmlparse.c |
188 | cd xml && $(MAKE) clean |
189 | cd test && $(MAKE) clean |
190 | |
191 | ######## |
192 | |
193 | distclean: clean |
194 | -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE) |
195 | -rm -f $(EXE) |
196 | -rm -f $(D) |
197 | -rm -fr .deps |
198 | cd xml && $(MAKE) distclean |
199 | cd test && $(MAKE) distclean |
200 | |
201 | ######## |
202 | |
203 | .deps: .FORCE |
204 | @[ -d .deps ] || mkdir $@ |
205 | |
206 | include $(D) |
207 | |
208 | ######## |
209 | |
210 | .FORCE: |
211 | |
212 | ######## |
213 | |
214 | top=-top |
215 | include ../Makefile |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |