Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/web/Makefile
Parent Directory
|
Revision Log
Revision 1569 -
(show annotations)
(download)
Sat May 17 13:20:39 2014 UTC (10 years, 10 months ago) by amb
File size: 4866 byte(s)
Sat May 17 13:20:39 2014 UTC (10 years, 10 months ago) by amb
File size: 4866 byte(s)
Re-create the xml/routino-translations.xml file if the translations are updated or the file is deleted.
1 | # 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 | 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 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 | all-bin: all-exe |
65 | @[ -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 | if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/routino-$$file -nt $(WEBDATADIR)/$$file ]; then \ |
77 | 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 | if [ ! -f $(WEBDATADIR)/$$file ] || [ $(XMLDIR)/$$file -nt $(WEBDATADIR)/$$file ]; then \ |
83 | 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 | all-profiles: all-exe all-data |
98 | @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 | $(WEBICONDIR)/ball-0.png: $(WEBICONDIR)/create-icons.pl |
108 | @echo create-icons.pl |
109 | @cd $(WEBICONDIR) && perl create-icons.pl |
110 | |
111 | all-translations: $(WEBWWWDIR)/router.html.en $(WEBWWWDIR)/visualiser.html.en $(XMLDIR)/routino-translations.xml |
112 | |
113 | $(WEBWWWDIR)/router.html.en: $(WEBTRANSDIR)/router.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl |
114 | @echo translate.pl |
115 | @cd $(WEBTRANSDIR) && perl translate.pl |
116 | |
117 | $(WEBWWWDIR)/visualiser.html.en: $(WEBTRANSDIR)/visualiser.html $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl |
118 | @echo translate.pl |
119 | @cd $(WEBTRANSDIR) && perl translate.pl |
120 | |
121 | $(XMLDIR)/routino-translations.xml: $(WEBTRANSDIR)/translations-head.xml $(WEBTRANSDIR)/translations-body.xml $(WEBTRANSDIR)/translations-tail.xml $(TRANS_FILES) $(WEBTRANSDIR)/translate.pl |
122 | @echo translate.pl |
123 | @cd $(WEBTRANSDIR) && perl translate.pl |
124 | |
125 | all-exe: |
126 | cd $(SRCDIR) && $(MAKE) $(EXE_FILES) |
127 | |
128 | all-xml: |
129 | cd $(XMLDIR) && $(MAKE) all |
130 | |
131 | ######## |
132 | |
133 | test: |
134 | |
135 | ######## |
136 | |
137 | install: all |
138 | @echo "******************************************************" |
139 | @echo "* Note: web directory is not installed automatically *" |
140 | @echo "******************************************************" |
141 | |
142 | ######## |
143 | |
144 | clean: |
145 | rm -f *~ |
146 | |
147 | ######## |
148 | |
149 | distclean: clean |
150 | -cd $(WEBBINDIR) && rm -f $(EXE_FILES) |
151 | -cd $(WEBDATADIR) && rm -f $(STANDARD_XML_FILES) $(SPECIAL_XML_FILES) |
152 | -cd $(WEBDOCDIR) && rm -f $(DOC_FILES) |
153 | -cd $(WEBWWWDIR) && rm -f $(PROFILE_FILES) |
154 | |
155 | ######## |
156 | |
157 | .PHONY:: all test install clean distclean |
158 | |
159 | .PHONY:: all-bin all-data all-doc all-profiles all-icons all-translations all-exe all-xml |