1 # $Header: /home/amb/routino/src/RCS/Makefile,v 1.42 2010/09/17 17:42:20 amb Exp $
5 # Part of the Routino routing software.
7 # This file Copyright 2008-2010 Andrew M. Bishop
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.
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.
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/>.
27 # Compilation programs
34 # Compilation program options
36 CFLAGS=-Wall -Wmissing-prototypes
37 #CFLAGS+= -Wextra -pedantic -std=c99
46 #LDFLAGS+= -pg -static
51 # Required to use stdio with files > 2GiB on 32-bit system.
53 FLAGS64=-D_FILE_OFFSET_BITS=64
58 D=$(foreach f,$(C),$(addprefix .deps/,$(addsuffix .d,$(basename $f))))
60 EXE=planetsplitter planetsplitter-slim router router-slim filedumper filedumper-slim tagmodifier
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) ;\
72 @cd xml && $(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
76 PLANETSPLITTER_OBJ=planetsplitter.o \
77 nodesx.o segmentsx.o waysx.o relationsx.o superx.o \
80 results.o queue.o sorting.o \
81 xmlparse.o tagging.o osmparser.o
83 planetsplitter : $(PLANETSPLITTER_OBJ)
84 $(LD) $(PLANETSPLITTER_OBJ) -o $@ $(LDFLAGS)
88 PLANETSPLITTER_SLIM_OBJ=planetsplitter-slim.o \
89 nodesx-slim.o segmentsx-slim.o waysx-slim.o relationsx-slim.o superx-slim.o \
92 results.o queue.o sorting.o \
93 xmlparse.o tagging.o osmparser.o
95 planetsplitter-slim : $(PLANETSPLITTER_SLIM_OBJ)
96 $(LD) $(PLANETSPLITTER_SLIM_OBJ) -o $@ $(LDFLAGS)
100 ROUTER_OBJ=router.o \
101 nodes.o segments.o ways.o types.o fakes.o \
102 optimiser.o output.o \
103 files.o profiles.o xmlparse.o \
104 results.o queue.o translations.o
106 router : $(ROUTER_OBJ)
107 $(LD) $(ROUTER_OBJ) -o $@ $(LDFLAGS)
111 ROUTER_SLIM_OBJ=router-slim.o \
112 nodes-slim.o segments-slim.o ways-slim.o types.o fakes.o \
113 optimiser-slim.o output-slim.o \
114 files.o profiles.o xmlparse.o \
115 results.o queue.o translations.o
117 router-slim : $(ROUTER_SLIM_OBJ)
118 $(LD) $(ROUTER_SLIM_OBJ) -o $@ $(LDFLAGS)
122 FILEDUMPER_OBJ=filedumper.o \
123 nodes.o segments.o ways.o types.o \
127 filedumper : $(FILEDUMPER_OBJ)
128 $(LD) $(FILEDUMPER_OBJ) -o $@ $(LDFLAGS)
132 FILEDUMPER_SLIM_OBJ=filedumper-slim.o \
133 nodes-slim.o segments-slim.o ways-slim.o types.o \
137 filedumper-slim : $(FILEDUMPER_SLIM_OBJ)
138 $(LD) $(FILEDUMPER_SLIM_OBJ) -o $@ $(LDFLAGS)
142 TAGMODIFIER_OBJ=tagmodifier.o \
146 tagmodifier : $(TAGMODIFIER_OBJ)
147 $(LD) $(TAGMODIFIER_OBJ) -o $@ $(LDFLAGS)
151 xmlparse.c : xmlparse.l
152 $(LEX) $(LEXFLAGS) $<
153 -@mv lex.yy.c xmlparse.c
154 @echo Created xmlparse.c
159 $(CC) -c $(CFLAGS) $(FLAGS64) -DSLIM=0 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $<)))
162 $(CC) -c $(CFLAGS) $(FLAGS64) -DSLIM=1 -DDATADIR=\"$(datadir)\" $< -o $@ -MMD -MP -MF $(addprefix .deps/,$(addsuffix .d,$(basename $<)))
167 -[ -d $(DESTDIR)$(bindir) ] || mkdir -p $(DESTDIR)$(bindir)
168 @[ -d $(DESTDIR)$(bindir) ] && \
169 for file in $(EXE); do \
170 echo cp $$file $(DESTDIR)$(bindir) ;\
171 cp -f $$file $(DESTDIR)$(bindir) ;\
180 cd xml && $(MAKE) clean
185 -[ -d ../web/bin ] && cd ../web/bin/ && rm -f $(EXE)
189 cd xml && $(MAKE) distclean
194 @[ -d .deps ] || mkdir $@