Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/web/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1784 - (show annotations) (download)
Sat Aug 15 13:08:37 2015 UTC (9 years, 7 months ago) by amb
File size: 6525 byte(s)
Merge libroutino branch back into the trunk.

1 # web directory Makefile
2 #
3 # Part of the Routino routing software.
4 #
5 # This file Copyright 2010-2015 Andrew M. Bishop
6 #
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
21 # All configuration is in the top-level Makefile.conf
22
23 include ../Makefile.conf
24
25 # Web file paths and other paths
26
27 WEBBINDIR=bin
28 WEBDATADIR=data
29 WEBTRANSDIR=translations
30 WEBWWWDIR=www/routino
31 WEBICONDIR=www/routino/icons
32 WEBDOCDIR=www/routino/documentation
33
34 XMLDIR=../xml
35 DOCDIR=../doc
36 SRCDIR=../src
37
38 # Files to install
39
40 STANDARD_XML_FILES=profiles.xml \
41 translations.xml \
42 tagging.xml
43
44 SPECIAL_XML_FILES=tagging-drive.xml \
45 tagging-ride.xml \
46 tagging-walk.xml
47
48 PROFILE_FILES=profiles.pl \
49 profiles.js
50
51 TRANS_FILES=$(wildcard $(WEBTRANSDIR)/translation.*.txt)
52
53 DOC_FILES=$(notdir $(wildcard $(DOCDIR)/html/*.html)) $(notdir $(wildcard $(DOCDIR)/html/*.css))
54
55 EXE_FILES=planetsplitter$(.EXE) planetsplitter-slim$(.EXE) router$(.EXE) router-slim$(.EXE) filedumperx$(.EXE) filedumper$(.EXE) filedumper-slim$(.EXE)
56
57 ########
58
59 all: all-bin all-data all-doc all-profiles all-translations all-icons
60
61 ####
62
63 all-bin: all-exe
64 @[ -d $(WEBBINDIR) ] || mkdir -p $(WEBBINDIR)
65 @for file in $(EXE_FILES); do \
66 if [ -f $(SRCDIR)/$$file -a ! -f $(WEBBINDIR)/$$file ] || [ $(SRCDIR)/$$file -nt $(WEBBINDIR)/$$file ]; then \
67 echo cp $(SRCDIR)/$$file $(WEBBINDIR) ;\
68 cp -f $(SRCDIR)/$$file $(WEBBINDIR) ;\
69 fi ;\
70 done
71
72 ####
73
74 all-data: all-xml
75 @[ -d $(WEBDATADIR) ] || mkdir -p $(WEBDATADIR)
76 @for file in $(STANDARD_XML_FILES); do \
77 if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/routino-$$file -nt $(WEBDATADIR)/$$file ]; then \
78 echo cp $(XMLDIR)/routino-$$file $(WEBDATADIR)/$$file ;\
79 cp -f $(XMLDIR)/routino-$$file $(WEBDATADIR)/$$file ;\
80 fi ;\
81 done
82 @for file in $(SPECIAL_XML_FILES); do \
83 if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/$$file -nt $(WEBDATADIR)/$$file ]; then \
84 echo cp $(XMLDIR)/$$file $(WEBDATADIR)/$$file ;\
85 cp -f $(XMLDIR)/$$file $(WEBDATADIR)/$$file ;\
86 fi ;\
87 done
88
89 ####
90
91 all-doc:
92 @[ -d $(WEBDOCDIR) ] || mkdir -p $(WEBDOCDIR)
93 @for file in $(DOC_FILES); do \
94 if [ ! -f $(WEBDOCDIR)/$$file ] || [ $(DOCDIR)/html/$$file -nt $(WEBDOCDIR)/$$file ]; then \
95 echo cp $(DOCDIR)/html/$$file $(WEBDOCDIR) ;\
96 cp -f $(DOCDIR)/html/$$file $(WEBDOCDIR) ;\
97 fi ;\
98 done
99
100 ####
101
102 all-profiles: all-exe all-data
103 @if [ ! -f $(WEBWWWDIR)/profiles.js ] || [ ! -f $(WEBWWWDIR)/profiles.pl ] || \
104 [ $(WEBDATADIR)/profiles.xml -nt $(WEBWWWDIR)/profiles.pl ] || \
105 [ $(WEBDATADIR)/profiles.xml -nt $(WEBWWWDIR)/profiles.js ]; then \
106 echo update-profiles.pl ;\
107 ( cd $(WEBWWWDIR) ; perl update-profiles.pl ) ;\
108 fi
109
110 ####
111
112 all-translations: $(WEBWWWDIR)/router.html $(WEBWWWDIR)/visualiser.html \
113 $(WEBWWWDIR)/router.html.en $(WEBWWWDIR)/visualiser.html.en \
114 $(XMLDIR)/routino-translations.xml
115
116 ifeq ($(HOST),MINGW)
117
118 $(WEBWWWDIR)/router.html: $(WEBWWWDIR)/router.html.en
119 @echo cp $< $@
120 @cp -f $< $@
121
122 $(WEBWWWDIR)/visualiser.html: $(WEBWWWDIR)/visualiser.html.en
123 @echo cp $< $@
124 @cp -f $< $@
125
126 else
127
128 $(WEBWWWDIR)/router.html: $(WEBWWWDIR)/router.html.en
129 @echo ln -s `basename $<` $@
130 @ln -s -f `basename $<` $@
131
132 $(WEBWWWDIR)/visualiser.html: $(WEBWWWDIR)/visualiser.html.en
133 @echo ln -s `basename $<` $@
134 @ln -s -f `basename $<` $@
135
136 endif
137
138 $(WEBWWWDIR)/router.html.en: $(WEBTRANSDIR)/router.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl
139 @echo translate.pl
140 @cd $(WEBTRANSDIR) && perl translate.pl
141
142 $(WEBWWWDIR)/visualiser.html.en: $(WEBTRANSDIR)/visualiser.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl
143 @echo translate.pl
144 @cd $(WEBTRANSDIR) && perl translate.pl
145
146 $(XMLDIR)/routino-translations.xml: $(WEBTRANSDIR)/translations-head.xml $(WEBTRANSDIR)/translations-body.xml $(WEBTRANSDIR)/translations-tail.xml $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl
147 @echo translate.pl
148 @cd $(WEBTRANSDIR) && perl translate.pl
149
150 ####
151
152 all-icons: $(WEBICONDIR)/ball-0.png
153
154 $(WEBICONDIR)/ball-0.png: $(WEBICONDIR)/create-icons.pl
155 @echo create-icons.pl
156 @cd $(WEBICONDIR) && perl create-icons.pl
157
158 ####
159
160 all-exe:
161 cd $(SRCDIR) && $(MAKE) $(EXE_FILES)
162
163 ####
164
165 all-xml: $(XMLDIR)/routino-translations.xml
166 cd $(XMLDIR) && $(MAKE) all
167
168 ########
169
170 test:
171
172 ########
173
174 install: all
175 @echo "******************************************************"
176 @echo "* Note: web directory is not installed automatically *"
177 @echo "******************************************************"
178
179 ########
180
181 clean: clean clean-all-bin clean-all-data clean-all-doc clean-all-profiles clean-all-translations clean-all-icons
182 rm -f *~
183
184 clean-all-bin:
185 -cd $(WEBBINDIR) && rm -f $(EXE_FILES)
186
187 clean-all-data:
188 -cd $(WEBDATADIR) && rm -f $(STANDARD_XML_FILES)
189 -cd $(WEBDATADIR) && rm -f $(SPECIAL_XML_FILES)
190
191 clean-all-doc:
192 -cd $(WEBDOCDIR) && rm -f $(DOC_FILES)
193
194 clean-all-profiles:
195
196 clean-all-translations:
197
198 clean-all-icons:
199
200 ########
201
202 distclean: distclean-all-bin distclean-all-data distclean-all-doc distclean-all-profiles distclean-all-translations distclean-all-icons
203
204 distclean-all-bin: clean-all-bin
205
206 distclean-all-data: clean-all-data
207
208 distclean-all-doc: clean-all-doc
209
210 distclean-all-profiles: clean-all-profiles
211 -cd $(WEBWWWDIR) && rm -f $(PROFILE_FILES)
212
213 distclean-all-translations: clean-all-translations
214 -cd $(WEBWWWDIR) && rm -f router.html*
215 -cd $(WEBWWWDIR) && rm -f visualiser.html*
216
217 distclean-all-icons: clean-all-icons
218 -cd $(WEBICONDIR) && rm -f ball-*.png limit-*.png marker-*.png
219
220 ########
221
222 .PHONY:: all test install clean distclean
223
224 .PHONY:: all-bin all-data all-doc all-profiles all-icons all-translations all-exe all-xml
225
226 .PHONY:: clean-all-bin clean-all-data clean-all-doc clean-all-profiles clean-all-translations clean-all-icons
227
228 .PHONY:: distclean-all-bin distclean-all-data distclean-all-doc distclean-all-profiles distclean-all-translations distclean-all-icons