Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /branches/libroutino/src/Makefile
Parent Directory
|
Revision Log
Revision 1390 -
(hide annotations)
(download)
Thu Jun 6 18:21:35 2013 UTC (11 years, 9 months ago) by amb
Original Path: trunk/src/Makefile
File size: 5322 byte(s)
Thu Jun 6 18:21:35 2013 UTC (11 years, 9 months ago) by amb
Original Path: trunk/src/Makefile
File size: 5322 byte(s)
Tidy up the compilation and linking flags again.
1 | amb | 333 | # Source code Makefile |
2 | amb | 2 | # |
3 | amb | 151 | # Part of the Routino routing software. |
4 | amb | 2 | # |
5 | amb | 1292 | # This file Copyright 2008-2013 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 | 1343 | # All configuration is in the top-level Makefile.conf |
22 | amb | 476 | |
23 | amb | 1343 | include ../Makefile.conf |
24 | amb | 476 | |
25 | amb | 1343 | # Web file paths |
26 | amb | 476 | |
27 | amb | 1343 | WEBBINDIR=../$(webbindir) |
28 | amb | 2 | |
29 | amb | 1343 | # Debugging options |
30 | amb | 2 | |
31 | amb | 1319 | #CFLAGS+=-O0 -g |
32 | amb | 887 | #CFLAGS+=-pg |
33 | #CFLAGS+=-fprofile-arcs -ftest-coverage | ||
34 | amb | 240 | |
35 | amb | 887 | #LDFLAGS+=-pg -static |
36 | #LDFLAGS+=-fprofile-arcs -ftest-coverage | ||
37 | amb | 240 | |
38 | amb | 1343 | # Sub-directories and sub-makefiles |
39 | amb | 991 | |
40 | amb | 1343 | SUBFILES=$(wildcard */Makefile) |
41 | SUBDIRS=$(foreach f,$(SUBFILES),$(dir $f)) | ||
42 | amb | 1194 | |
43 | amb | 2 | # Compilation targets |
44 | |||
45 | C=$(wildcard *.c) | ||
46 | amb | 884 | D=$(wildcard .deps/*.d) |
47 | amb | 2 | |
48 | amb | 1345 | EXE=planetsplitter planetsplitter-slim router router-slim filedumperx filedumper filedumper-slim |
49 | amb | 333 | |
50 | amb | 2 | ######## |
51 | |||
52 | amb | 1343 | all: all-local |
53 | for dir in $(SUBDIRS); do \ | ||
54 | ( cd $$dir && $(MAKE) $@ ); \ | ||
55 | done | ||
56 | |||
57 | all-local: $(EXE) | ||
58 | -@[ -d $(WEBBINDIR) ] && \ | ||
59 | amb | 439 | for file in $(EXE); do \ |
60 | amb | 1343 | if [ ! -f $(WEBBINDIR)/$$file ] || [ $$file -nt $(WEBBINDIR)/$$file ]; then \ |
61 | echo cp $$file $(WEBBINDIR) ;\ | ||
62 | cp -f $$file $(WEBBINDIR) ;\ | ||
63 | amb | 439 | fi ;\ |
64 | done | ||
65 | amb | 2 | |
66 | ######## | ||
67 | |||
68 | amb | 161 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
69 | amb | 949 | nodesx.o segmentsx.o waysx.o relationsx.o superx.o prunex.o \ |
70 | amb | 365 | ways.o types.o \ |
71 | amb | 1319 | files.o logging.o logerror.o errorlogx.o \ |
72 | amb | 333 | results.o queue.o sorting.o \ |
73 | amb | 1227 | xmlparse.o tagging.o \ |
74 | uncompress.o osmxmlparse.o osmpbfparse.o osmo5mparse.o osmparser.o | ||
75 | amb | 2 | |
76 | amb | 910 | planetsplitter : $(PLANETSPLITTER_OBJ) |
77 | amb | 2 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) |
78 | |||
79 | ######## | ||
80 | |||
81 | amb | 452 | PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \ |
82 | amb | 949 | nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o prunex-slim.o \ |
83 | amb | 452 | ways.o types.o \ |
84 | amb | 1319 | files.o logging.o logerror-slim.o errorlogx-slim.o \ |
85 | amb | 452 | results.o queue.o sorting.o \ |
86 | amb | 1227 | xmlparse.o tagging.o \ |
87 | uncompress.o osmxmlparse.o osmpbfparse.o osmo5mparse.o osmparser.o | ||
88 | amb | 452 | |
89 | planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ) | ||
90 | $(LD) $(PLANETSPLITTER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
91 | |||
92 | ######## | ||
93 | |||
94 | amb | 397 | ROUTER_OBJ=router.o \ |
95 | amb | 542 | nodes.o segments.o ways.o relations.o types.o fakes.o \ |
96 | amb | 453 | optimiser.o output.o \ |
97 | amb | 519 | files.o logging.o profiles.o xmlparse.o \ |
98 | amb | 453 | results.o queue.o translations.o |
99 | amb | 397 | |
100 | router : $(ROUTER_OBJ) | ||
101 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) | ||
102 | |||
103 | ######## | ||
104 | |||
105 | amb | 453 | ROUTER_SLIM_OBJ=router-slim.o \ |
106 | amb | 697 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o \ |
107 | amb | 453 | optimiser-slim.o output-slim.o \ |
108 | amb | 1296 | files.o logging.o profiles.o xmlparse.o \ |
109 | amb | 453 | results.o queue.o translations.o |
110 | |||
111 | router-slim : $(ROUTER_SLIM_OBJ) | ||
112 | $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
113 | |||
114 | ######## | ||
115 | |||
116 | amb | 1149 | FILEDUMPERX_OBJ=filedumperx.o \ |
117 | amb | 1166 | files.o logging.o |
118 | amb | 1149 | |
119 | filedumperx : $(FILEDUMPERX_OBJ) | ||
120 | $(LD) $(FILEDUMPERX_OBJ) -o $@ $(LDFLAGS) | ||
121 | |||
122 | ######## | ||
123 | |||
124 | amb | 161 | FILEDUMPER_OBJ=filedumper.o \ |
125 | amb | 1321 | nodes.o segments.o ways.o relations.o types.o fakes.o errorlog.o \ |
126 | amb | 453 | visualiser.o \ |
127 | amb | 519 | files.o logging.o xmlparse.o |
128 | amb | 2 | |
129 | filedumper : $(FILEDUMPER_OBJ) | ||
130 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) | ||
131 | |||
132 | ######## | ||
133 | |||
134 | amb | 453 | FILEDUMPER_SLIM_OBJ=filedumper-slim.o \ |
135 | amb | 1321 | nodes-slim.o segments-slim.o ways-slim.o relations-slim.o types.o fakes-slim.o errorlog-slim.o \ |
136 | amb | 453 | visualiser-slim.o \ |
137 | amb | 1296 | files.o logging.o xmlparse.o |
138 | amb | 453 | |
139 | filedumper-slim : $(FILEDUMPER_SLIM_OBJ) | ||
140 | $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS) | ||
141 | |||
142 | ######## | ||
143 | |||
144 | amb | 910 | %.o : %.c |
145 | @[ -d .deps ] || mkdir .deps | ||
146 | amb | 887 | $(CC) -c $(CFLAGS) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
147 | amb | 2 | |
148 | amb | 910 | %-slim.o : %.c |
149 | @[ -d .deps ] || mkdir .deps | ||
150 | amb | 887 | $(CC) -c $(CFLAGS) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $@))) |
151 | amb | 452 | |
152 | amb | 2 | ######## |
153 | |||
154 | amb | 910 | test: |
155 | amb | 1343 | for dir in $(SUBDIRS); do \ |
156 | ( cd $$dir && $(MAKE) $@ ); \ | ||
157 | done | ||
158 | amb | 862 | |
159 | ######## | ||
160 | |||
161 | amb | 1343 | install: install-local |
162 | for dir in $(SUBDIRS); do \ | ||
163 | ( cd $$dir && $(MAKE) $@ ); \ | ||
164 | done | ||
165 | |||
166 | install-local: all | ||
167 | amb | 482 | -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir) |
168 | @[ -d $(DESTDIR)$(bindir) ] && \ | ||
169 | amb | 476 | for file in $(EXE); do \ |
170 | amb | 482 | echo cp $$file $(DESTDIR)$(bindir) ;\ |
171 | cp -f $$file $(DESTDIR)$(bindir) ;\ | ||
172 | amb | 476 | done |
173 | |||
174 | ######## | ||
175 | |||
176 | amb | 1343 | clean: clean-local |
177 | for dir in $(SUBDIRS); do \ | ||
178 | ( cd $$dir && $(MAKE) $@ ); \ | ||
179 | done | ||
180 | |||
181 | clean-local: | ||
182 | amb | 1045 | rm -f *~ |
183 | amb | 2 | rm -f *.o |
184 | amb | 1045 | rm -f core |
185 | amb | 859 | rm -f *.gcda *.gcno *.gcov gmon.out |
186 | amb | 2 | |
187 | ######## | ||
188 | |||
189 | amb | 1343 | distclean: distclean-local clean-local |
190 | for dir in $(SUBDIRS); do \ | ||
191 | ( cd $$dir && $(MAKE) $@ ); \ | ||
192 | done | ||
193 | |||
194 | distclean-local: | ||
195 | amb | 1364 | -cd $(WEBBINDIR) && rm -f $(EXE) |
196 | amb | 2 | -rm -f $(EXE) |
197 | -rm -f $(D) | ||
198 | amb | 153 | -rm -fr .deps |
199 | amb | 2 | |
200 | ######## | ||
201 | |||
202 | include $(D) | ||
203 | |||
204 | ######## | ||
205 | |||
206 | amb | 1343 | .PHONY:: all test install clean distclean |
207 | |||
208 | .PHONY:: all-local install-local clean-local distclean-local |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |