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