Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/Makefile
Parent Directory
|
Revision Log
Revision 887 -
(hide 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 | amb | 333 | # Source code Makefile |
2 | amb | 2 | # |
3 | amb | 151 | # Part of the Routino routing software. |
4 | amb | 2 | # |
5 | amb | 608 | # This file Copyright 2008-2011 Andrew M. Bishop |
6 | amb | 151 | # |
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 | amb | 2 | |
21 | amb | 476 | # Web file paths |
22 | |||
23 | WEBDIR=../web/bin | ||
24 | |||
25 | # Compilation programs | ||
26 | |||
27 | amb | 2 | CC=gcc |
28 | LD=gcc | ||
29 | |||
30 | amb | 333 | LEX=flex |
31 | |||
32 | amb | 476 | # Compilation program options |
33 | amb | 2 | |
34 | amb | 789 | CFLAGS=-Wall -Wmissing-prototypes -std=c99 |
35 | amb | 887 | #CFLAGS+=-Wextra -pedantic |
36 | amb | 240 | LDFLAGS=-lm -lc |
37 | amb | 2 | |
38 | amb | 887 | CFLAGS+=-O3 |
39 | #CFLAGS+=-O0 -g | ||
40 | #CFLAGS+=-pg | ||
41 | #CFLAGS+=-fprofile-arcs -ftest-coverage | ||
42 | amb | 240 | |
43 | LDFLAGS+= | ||
44 | amb | 887 | #LDFLAGS+=-pg -static |
45 | #LDFLAGS+=-fprofile-arcs -ftest-coverage | ||
46 | amb | 240 | |
47 | amb | 333 | LEXFLAGS= |
48 | |||
49 | amb | 384 | # Required to use stdio with files > 2GiB on 32-bit system. |
50 | amb | 887 | CFLAGS+=-D_FILE_OFFSET_BITS=64 |
51 | amb | 384 | |
52 | amb | 887 | # Required to compile on Linux without a warning about pread() and pwrite() functions. |
53 | CFLAGS+=-D_POSIX_C_SOURCE=200809L | ||
54 | amb | 384 | |
55 | amb | 2 | # Compilation targets |
56 | |||
57 | C=$(wildcard *.c) | ||
58 | amb | 884 | D=$(wildcard .deps/*.d) |
59 | amb | 2 | |
60 | amb | 453 | EXE=planetsplitter planetsplitter-slim router router-slim filedumper filedumper-slim tagmodifier |
61 | amb | 333 | |
62 | amb | 2 | ######## |
63 | |||
64 | amb | 862 | all: $(EXE) |
65 | amb | 439 | -@[ -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 | amb | 692 | @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
73 | @cd test && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" | ||
74 | amb | 2 | |
75 | ######## | ||
76 | |||
77 | amb | 161 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
78 | amb | 495 | nodesx.o segmentsx.o waysx.o relationsx.o superx.o \ |
79 | amb | 365 | ways.o types.o \ |
80 | amb | 519 | files.o logging.o \ |
81 | amb | 333 | results.o queue.o sorting.o \ |
82 | amb | 397 | xmlparse.o tagging.o osmparser.o |
83 | amb | 2 | |
84 | amb | 884 | planetsplitter : $(PLANETSPLITTER_OBJ) .deps |
85 | amb | 2 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) |
86 | |||
87 | ######## | ||
88 | |||
89 | amb | 452 | PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \ |
90 | amb | 495 | nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o \ |
91 | amb | 452 | ways.o types.o \ |
92 | amb | 519 | files.o logging.o \ |
93 | amb | 452 | 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 | amb | 397 | ROUTER_OBJ=router.o \ |
102 | amb | 542 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
103 | amb | 453 | optimiser.o output.o \ |
104 | amb | 519 | files.o logging.o profiles.o xmlparse.o \ |
105 | amb | 453 | results.o queue.o translations.o |
106 | amb | 397 | |
107 | router : $(ROUTER_OBJ) | ||
108 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) | ||
109 | |||
110 | ######## | ||
111 | |||
112 | amb | 453 | ROUTER_SLIM_OBJ=router-slim.o \ |
113 | amb | 697 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
114 | amb | 453 | optimiser-slim.o output-slim.o \ |
115 | amb | 519 | files.o logging.o profiles.o xmlparse.o \ |
116 | amb | 453 | results.o queue.o translations.o |
117 | |||
118 | router-slim : $(ROUTER_SLIM_OBJ) | ||
119 | $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
120 | |||
121 | ######## | ||
122 | |||
123 | amb | 161 | FILEDUMPER_OBJ=filedumper.o \ |
124 | amb | 608 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
125 | amb | 453 | visualiser.o \ |
126 | amb | 519 | files.o logging.o xmlparse.o |
127 | amb | 2 | |
128 | filedumper : $(FILEDUMPER_OBJ) | ||
129 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) | ||
130 | |||
131 | ######## | ||
132 | |||
133 | amb | 453 | FILEDUMPER_SLIM_OBJ=filedumper-slim.o \ |
134 | amb | 697 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
135 | amb | 453 | visualiser-slim.o \ |
136 | amb | 519 | files.o logging.o xmlparse.o |
137 | amb | 453 | |
138 | filedumper-slim : $(FILEDUMPER_SLIM_OBJ) | ||
139 | $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
140 | |||
141 | ######## | ||
142 | |||
143 | amb | 397 | TAGMODIFIER_OBJ=tagmodifier.o \ |
144 | amb | 519 | files.o logging.o \ |
145 | amb | 397 | xmlparse.o tagging.o |
146 | amb | 2 | |
147 | amb | 397 | tagmodifier : $(TAGMODIFIER_OBJ) |
148 | $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS) | ||
149 | amb | 2 | |
150 | ######## | ||
151 | |||
152 | amb | 333 | xmlparse.c : xmlparse.l |
153 | amb | 353 | $(LEX) $(LEXFLAGS) $< |
154 | amb | 333 | -@mv lex.yy.c xmlparse.c |
155 | @echo Created xmlparse.c | ||
156 | |||
157 | ######## | ||
158 | |||
159 | amb | 884 | %.o : %.c .deps |
160 | amb | 887 | $(CC) -c $(CFLAGS) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
161 | amb | 2 | |
162 | amb | 884 | %-slim.o : %.c .deps |
163 | amb | 887 | $(CC) -c $(CFLAGS) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
164 | amb | 452 | |
165 | amb | 2 | ######## |
166 | |||
167 | amb | 862 | test: .FORCE |
168 | cd xml && $(MAKE) test | ||
169 | cd test && $(MAKE) test | ||
170 | |||
171 | ######## | ||
172 | |||
173 | amb | 476 | install: all |
174 | amb | 482 | -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir) |
175 | @[ -d $(DESTDIR)$(bindir) ] && \ | ||
176 | amb | 476 | for file in $(EXE); do \ |
177 | amb | 482 | echo cp $$file $(DESTDIR)$(bindir) ;\ |
178 | cp -f $$file $(DESTDIR)$(bindir) ;\ | ||
179 | amb | 476 | done |
180 | |||
181 | ######## | ||
182 | |||
183 | amb | 2 | clean: |
184 | rm -f *.o | ||
185 | rm -f *~ | ||
186 | amb | 859 | rm -f *.gcda *.gcno *.gcov gmon.out |
187 | amb | 405 | rm -f xmlparse.c |
188 | amb | 692 | cd xml && $(MAKE) clean |
189 | cd test && $(MAKE) clean | ||
190 | amb | 2 | |
191 | ######## | ||
192 | |||
193 | distclean: clean | ||
194 | amb | 192 | -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE) |
195 | amb | 2 | -rm -f $(EXE) |
196 | -rm -f $(D) | ||
197 | amb | 153 | -rm -fr .deps |
198 | amb | 692 | cd xml && $(MAKE) distclean |
199 | cd test && $(MAKE) distclean | ||
200 | amb | 2 | |
201 | ######## | ||
202 | |||
203 | amb | 862 | .deps: .FORCE |
204 | amb | 94 | @[ -d .deps ] || mkdir $@ |
205 | amb | 91 | |
206 | amb | 2 | include $(D) |
207 | |||
208 | ######## | ||
209 | |||
210 | amb | 862 | .FORCE: |
211 | amb | 482 | |
212 | ######## | ||
213 | |||
214 | top=-top | ||
215 | include ../Makefile |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |