Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/web/Makefile
Parent Directory
|
Revision Log
Revision 1557 -
(hide annotations)
(download)
Mon Apr 28 18:31:35 2014 UTC (10 years, 10 months ago) by amb
File size: 4576 byte(s)
Mon Apr 28 18:31:35 2014 UTC (10 years, 10 months ago) by amb
File size: 4576 byte(s)
Fix bug with updating XML files in web/data directory (Makefile error).
1 | amb | 1523 | # web directory Makefile |
2 | # | ||
3 | # Part of the Routino routing software. | ||
4 | # | ||
5 | # This file Copyright 2010-2014 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 | amb | 1547 | TRANS_FILES=$(wildcard $(WEBTRANSDIR)/translation.*.txt) |
52 | |||
53 | amb | 1523 | DOC_FILES=$(notdir $(wildcard $(DOCDIR)/html/*.html)) $(notdir $(wildcard $(DOCDIR)/html/*.css)) |
54 | |||
55 | EXE_FILES=planetsplitter planetsplitter-slim \ | ||
56 | router router-slim \ | ||
57 | filedumper filedumper-slim \ | ||
58 | filedumperx | ||
59 | |||
60 | ######## | ||
61 | |||
62 | all: all-bin all-data all-doc all-profiles all-icons all-translations | ||
63 | |||
64 | amb | 1528 | all-bin: all-exe |
65 | amb | 1523 | @[ -d $(WEBBINDIR) ] || mkdir -p $(WEBBINDIR) |
66 | @for file in $(EXE_FILES); do \ | ||
67 | if [ ! -f $(WEBBINDIR)/$$file ] || [ $(SRCDIR)/$$file -nt $(WEBBINDIR)/$$file ]; then \ | ||
68 | echo cp $(SRCDIR)/$$file $(WEBBINDIR) ;\ | ||
69 | cp -f $(SRCDIR)/$$file $(WEBBINDIR) ;\ | ||
70 | fi ;\ | ||
71 | done | ||
72 | |||
73 | all-data: all-xml | ||
74 | @[ -d $(WEBDATADIR) ] || mkdir -p $(WEBDATADIR) | ||
75 | @for file in $(STANDARD_XML_FILES); do \ | ||
76 | amb | 1557 | if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/routino-$$file -nt $(WEBDATADIR)/$$file ]; then \ |
77 | amb | 1523 | echo cp $(XMLDIR)/routino-$$file $(WEBDATADIR)/$$file ;\ |
78 | cp -f $(XMLDIR)/routino-$$file $(WEBDATADIR)/$$file ;\ | ||
79 | fi ;\ | ||
80 | done | ||
81 | @for file in $(SPECIAL_XML_FILES); do \ | ||
82 | amb | 1557 | if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/$$file -nt $(WEBDATADIR)/$$file ]; then \ |
83 | amb | 1523 | echo cp $(XMLDIR)/$$file $(WEBDATADIR)/$$file ;\ |
84 | cp -f $(XMLDIR)/$$file $(WEBDATADIR)/$$file ;\ | ||
85 | fi ;\ | ||
86 | done | ||
87 | |||
88 | all-doc: | ||
89 | @[ -d $(WEBDOCDIR) ] || mkdir -p $(WEBDOCDIR) | ||
90 | @for file in $(DOC_FILES); do \ | ||
91 | if [ ! -f $(WEBDOCDIR)/$$file ] || [ $(DOCDIR)/html/$$file -nt $(WEBDOCDIR)/$$file ]; then \ | ||
92 | echo cp $(DOCDIR)/html/$$file $(WEBDOCDIR) ;\ | ||
93 | cp -f $(DOCDIR)/html/$$file $(WEBDOCDIR) ;\ | ||
94 | fi ;\ | ||
95 | done | ||
96 | |||
97 | amb | 1528 | all-profiles: all-exe all-data |
98 | amb | 1523 | @if [ ! -f $(WEBWWWDIR)/profiles.js ] || [ ! -f $(WEBWWWDIR)/profiles.pl ] || \ |
99 | [ $(WEBDATADIR)/profiles.xml -nt $(WEBWWWDIR)/profiles.pl ] || \ | ||
100 | [ $(WEBDATADIR)/profiles.xml -nt $(WEBWWWDIR)/profiles.js ]; then \ | ||
101 | echo update-profiles.pl ;\ | ||
102 | ( cd $(WEBWWWDIR) ; perl update-profiles.pl ) ;\ | ||
103 | fi | ||
104 | |||
105 | all-icons: $(WEBICONDIR)/ball-0.png | ||
106 | |||
107 | amb | 1547 | $(WEBICONDIR)/ball-0.png: $(WEBICONDIR)/create-icons.pl |
108 | amb | 1523 | echo create-icons.pl |
109 | @cd $(WEBICONDIR) && perl create-icons.pl | ||
110 | |||
111 | amb | 1547 | all-translations: $(WEBWWWDIR)/router.html.en $(WEBWWWDIR)/visualiser.html.en |
112 | amb | 1523 | |
113 | amb | 1547 | $(WEBWWWDIR)/router.html.en: $(WEBTRANSDIR)/router.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl |
114 | amb | 1523 | echo translate.pl |
115 | @cd $(WEBTRANSDIR) && perl translate.pl | ||
116 | |||
117 | amb | 1547 | $(WEBWWWDIR)/visualiser.html.en: $(WEBTRANSDIR)/visualiser.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl |
118 | echo translate.pl | ||
119 | @cd $(WEBTRANSDIR) && perl translate.pl | ||
120 | |||
121 | amb | 1528 | all-exe: |
122 | cd $(SRCDIR) && $(MAKE) $(EXE_FILES) | ||
123 | amb | 1523 | |
124 | all-xml: | ||
125 | cd $(XMLDIR) && $(MAKE) all | ||
126 | |||
127 | ######## | ||
128 | |||
129 | amb | 1528 | test: |
130 | amb | 1523 | |
131 | ######## | ||
132 | |||
133 | install: all | ||
134 | @echo "******************************************************" | ||
135 | @echo "* Note: web directory is not installed automatically *" | ||
136 | @echo "******************************************************" | ||
137 | |||
138 | ######## | ||
139 | |||
140 | clean: | ||
141 | rm -f *~ | ||
142 | |||
143 | ######## | ||
144 | |||
145 | distclean: clean | ||
146 | -cd $(WEBBINDIR) && rm -f $(EXE_FILES) | ||
147 | -cd $(WEBDATADIR) && rm -f $(STANDARD_XML_FILES) $(SPECIAL_XML_FILES) | ||
148 | -cd $(WEBDOCDIR) && rm -f $(DOC_FILES) | ||
149 | -cd $(WEBWWWDIR) && rm -f $(PROFILE_FILES) | ||
150 | |||
151 | ######## | ||
152 | |||
153 | .PHONY:: all test install clean distclean | ||
154 | |||
155 | amb | 1528 | .PHONY:: all-bin all-data all-doc all-profiles all-icons all-translations all-exe all-xml |