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 444 -
(hide annotations)
(download)
Fri Jul 9 17:43:00 2010 UTC (14 years, 8 months ago) by amb
File size: 3271 byte(s)
Fri Jul 9 17:43:00 2010 UTC (14 years, 8 months ago) by amb
File size: 3271 byte(s)
Default compilation flags include optimisation and not debugging symbols.
1 | amb | 444 | # $Header: /home/amb/CVS/routino/src/Makefile,v 1.36 2010-07-09 17:43:00 amb Exp $ |
2 | amb | 2 | # |
3 | amb | 333 | # Source code Makefile |
4 | amb | 2 | # |
5 | amb | 151 | # Part of the Routino routing software. |
6 | amb | 2 | # |
7 | amb | 333 | # This file Copyright 2008-2010 Andrew M. Bishop |
8 | amb | 151 | # |
9 | # This program is free software: you can redistribute it and/or modify | ||
10 | # it under the terms of the GNU Affero General Public License as published by | ||
11 | # the Free Software Foundation, either version 3 of the License, or | ||
12 | # (at your option) any later version. | ||
13 | # | ||
14 | # This program is distributed in the hope that it will be useful, | ||
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | # GNU Affero General Public License for more details. | ||
18 | # | ||
19 | # You should have received a copy of the GNU Affero General Public License | ||
20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | # | ||
22 | amb | 2 | |
23 | # Programs | ||
24 | |||
25 | CC=gcc | ||
26 | LD=gcc | ||
27 | |||
28 | amb | 333 | LEX=flex |
29 | |||
30 | amb | 2 | # Program options |
31 | |||
32 | amb | 240 | CFLAGS=-Wall -Wmissing-prototypes |
33 | #CFLAGS+= -Wextra -pedantic -std=c99 | ||
34 | LDFLAGS=-lm -lc | ||
35 | amb | 2 | |
36 | amb | 240 | CFLAGS+= -O3 |
37 | amb | 444 | #CFLAGS+= -O0 -g |
38 | amb | 240 | #CFLAGS+= -pg |
39 | #CFLAGS+= --coverage | ||
40 | |||
41 | LDFLAGS+= | ||
42 | #LDFLAGS+= -pg -static | ||
43 | #LDFLAGS+= --coverage | ||
44 | |||
45 | amb | 333 | LEXFLAGS= |
46 | |||
47 | amb | 384 | # Required to use stdio with files > 2GiB on 32-bit system. |
48 | |||
49 | FLAGS64=-D_FILE_OFFSET_BITS=64 | ||
50 | |||
51 | amb | 2 | # Compilation targets |
52 | |||
53 | C=$(wildcard *.c) | ||
54 | amb | 91 | D=$(foreach f,$(C),$(addprefix .deps/,$(addsuffix .d,$(basename $f)))) |
55 | amb | 2 | |
56 | amb | 397 | EXE=planetsplitter router filedumper tagmodifier |
57 | amb | 333 | |
58 | amb | 439 | WEBDIR=../web/bin |
59 | |||
60 | amb | 2 | ######## |
61 | |||
62 | all : $(EXE) | ||
63 | amb | 439 | -@[ -d $(WEBDIR) ] && \ |
64 | for file in $(EXE); do \ | ||
65 | if [ ! -f $(WEBDIR)/$$file ] || [ $$file -nt $(WEBDIR)/$$file ]; then \ | ||
66 | echo cp $$file $(WEBDIR) ;\ | ||
67 | cp -f $$file $(WEBDIR) ;\ | ||
68 | fi ;\ | ||
69 | done | ||
70 | @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" | ||
71 | amb | 2 | |
72 | ######## | ||
73 | |||
74 | amb | 161 | PLANETSPLITTER_OBJ=planetsplitter.o \ |
75 | nodesx.o segmentsx.o waysx.o superx.o \ | ||
76 | amb | 365 | ways.o types.o \ |
77 | amb | 353 | files.o \ |
78 | amb | 333 | results.o queue.o sorting.o \ |
79 | amb | 397 | xmlparse.o tagging.o osmparser.o |
80 | amb | 2 | |
81 | planetsplitter : $(PLANETSPLITTER_OBJ) | ||
82 | $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS) | ||
83 | |||
84 | ######## | ||
85 | |||
86 | amb | 397 | ROUTER_OBJ=router.o \ |
87 | nodes.o segments.o ways.o types.o \ | ||
88 | files.o profiles.o xmlparse.o \ | ||
89 | optimiser.o output.o results.o queue.o translations.o | ||
90 | |||
91 | router : $(ROUTER_OBJ) | ||
92 | $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS) | ||
93 | |||
94 | ######## | ||
95 | |||
96 | amb | 161 | FILEDUMPER_OBJ=filedumper.o \ |
97 | amb | 365 | nodes.o segments.o ways.o types.o \ |
98 | amb | 405 | files.o xmlparse.o \ |
99 | amb | 186 | visualiser.o |
100 | amb | 2 | |
101 | filedumper : $(FILEDUMPER_OBJ) | ||
102 | $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS) | ||
103 | |||
104 | ######## | ||
105 | |||
106 | amb | 397 | TAGMODIFIER_OBJ=tagmodifier.o \ |
107 | files.o \ | ||
108 | xmlparse.o tagging.o | ||
109 | amb | 2 | |
110 | amb | 397 | tagmodifier : $(TAGMODIFIER_OBJ) |
111 | $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS) | ||
112 | amb | 2 | |
113 | ######## | ||
114 | |||
115 | amb | 333 | xmlparse.c : xmlparse.l |
116 | amb | 353 | $(LEX) $(LEXFLAGS) $< |
117 | amb | 333 | -@mv lex.yy.c xmlparse.c |
118 | @echo Created xmlparse.c | ||
119 | |||
120 | ######## | ||
121 | |||
122 | amb | 2 | %.o : %.c |
123 | amb | 384 | $(CC) -c $(CFLAGS) $(FLAGS64) $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $<))) |
124 | amb | 2 | |
125 | ######## | ||
126 | |||
127 | clean: | ||
128 | rm -f *.o | ||
129 | rm -f *~ | ||
130 | amb | 405 | rm -f xmlparse.c |
131 | amb | 340 | cd xml && $(MAKE) clean |
132 | amb | 2 | |
133 | ######## | ||
134 | |||
135 | distclean: clean | ||
136 | amb | 192 | -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE) |
137 | amb | 2 | -rm -f $(EXE) |
138 | -rm -f $(D) | ||
139 | amb | 153 | -rm -fr .deps |
140 | amb | 340 | cd xml && $(MAKE) distclean |
141 | amb | 2 | |
142 | ######## | ||
143 | |||
144 | amb | 91 | .deps : .FORCE |
145 | amb | 94 | @[ -d .deps ] || mkdir $@ |
146 | amb | 91 | |
147 | amb | 353 | $(D) : .deps |
148 | amb | 2 | @touch $@ |
149 | |||
150 | include $(D) | ||
151 | |||
152 | ######## | ||
153 | |||
154 | .FORCE : |
Properties
Name | Value |
---|---|
cvs:description | Makefile. |