Bugfix: remember image URL with cached road-section-image-data
[phoros.git] / Makefile
blob13f030cd4e243bf2137597911fd75d15f4eb63d6
1 # PHOROS -- Photogrammetric Road Survey
2 # Copyright (C) 2010, 2011, 2012 Bert Burgemeister
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 LISP = $(shell echo ../sbcl/bin/sbcl || which sbcl)
19 LIBPHOML_DIR = phoml/lib
20 LIBPHOML = libphoml.so
21 OPENLAYERS_TARBALL = OpenLayers-2.10.tar.gz
22 PRISTINE_OPENLAYERS_DIR = OpenLayers-2.10
23 EXAMPLES_DIR = examples
24 ETC_DIR = etc
25 OPENLAYERS_DIR = ol #for compiled/shrunk OpenLayers
26 OPENLAYERS_CONFIG = phoros.cfg
27 OPENLAYERS_JS = ol/OpenLayers.js
28 OPENLAYERS_THEME = ol/theme
29 OPENLAYERS_IMG = ol/img
30 LOGO = public_html/phoros-logo-plain.png
31 BACKGROUND_IMAGE = public_html/phoros-logo-background.png
32 CURSOR_IMAGE = public_html/phoros-cursor.png
33 FAVICON = public_html/favicon.ico
34 INDEX_HTML = public_html/index.html
35 PHOROS_HELP_HTML = public_html/phoros--help.html
36 DEPLOYMENT_HTML = public_html/deployment.html
37 PUBLIC_CSS = public_html/style.css
38 NOT_FOUND_HTML = public_html/404.html
39 PHOROS_VERSION = $(shell ./phoros --version)
40 LATEST_TAG = $(shell git describe)
41 MACHINE_TYPE = $(shell uname -m)
42 PHOROS_HELP_OUTPUT = phoros-help.txt
43 SOURCE = *.lisp *.asd Makefile
45 phoros : $(SOURCE) photogrammetry_lib $(OPENLAYERS_JS) \
46 $(OPENLAYERS_THEME) $(OPENLAYERS_IMG) \
47 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE)
48 CC=gcc \
49 $(LISP) --lose-on-corruption \
50 --disable-ldb \
51 --dynamic-space-size 4096 \
52 --end-runtime-options \
53 --disable-debugger \
54 --load make.lisp
56 fasttrack : $(SOURCE) photogrammetry_lib \
57 $(BACKGROUND_IMAGE) $(LOGO) $(CURSOR_IMAGE)
58 CC=gcc \
59 $(LISP) --lose-on-corruption \
60 --disable-ldb \
61 --dynamic-space-size 4096 \
62 --end-runtime-options \
63 --disable-debugger \
64 --load make-fasttrack.lisp
66 $(OPENLAYERS_TARBALL) :
67 wget http://openlayers.org/download/$@
69 $(PRISTINE_OPENLAYERS_DIR)/lib/* : $(OPENLAYERS_TARBALL)
70 tar -xmzf $<
72 $(OPENLAYERS_JS) : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
73 mkdir -p $(OPENLAYERS_DIR) && cp $< $@
75 $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js : \
76 $(PRISTINE_OPENLAYERS_DIR)/lib/* $(OPENLAYERS_CONFIG)
77 cp $(OPENLAYERS_CONFIG) $(PRISTINE_OPENLAYERS_DIR)/build/ && \
78 cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py $(OPENLAYERS_CONFIG)
79 ###### cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py full.cfg
81 .INTERMEDIATE : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
83 $(OPENLAYERS_THEME) : $(PRISTINE_OPENLAYERS_DIR)/theme $(OPENLAYERS_JS)
84 cp -R $< $@
86 $(OPENLAYERS_IMG) : $(PRISTINE_OPENLAYERS_DIR)/img $(OPENLAYERS_JS)
87 cp -R $< $@
89 photogrammetry_lib :
90 cd phoml; $(MAKE)
92 public_html :
93 mkdir -p public_html
95 $(LOGO) : Makefile public_html
96 ! convert \
97 -size 113x125 xc:transparent \
98 -font Gentium-Regular \
99 -fill black \
100 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
101 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
102 $@ 2>&1 | grep convert:
104 $(BACKGROUND_IMAGE) : Makefile public_html
105 ! convert \
106 -size 113x125 xc:transparent \
107 -font Gentium-Regular \
108 -fill "#f5f5f5" \
109 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
110 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
111 -resize 150% \
112 $@ 2>&1 | grep convert:
113 $(CURSOR_IMAGE) : Makefile public_html
114 ! convert \
115 -size 14x16 xc:transparent \
116 -font Gentium-Regular \
117 -fill Navy \
118 -pointsize 22 -gravity center -draw "text 0.21,1 'Φ'" \
119 -pointsize 7 -gravity center -draw "text 1.61,.1 'Σ'" \
120 $@ 2>&1 | grep convert:
121 # Font Gentium-Regular is in Debian package ttf-sil-gentium.
123 $(FAVICON) : favicon.png
124 icotool -c -o $@ $<
126 favicon.png : $(LOGO)
127 convert $< -resize 16x16 $@
129 .INTERMEDIATE : favicon.png
131 $(PHOROS_HELP_OUTPUT) : phoros
132 ./phoros --help > $@
134 .INTERMEDIATE : $(PHOROS_HELP_OUTPUT)
136 $(INDEX_HTML) : doc/index.org $(LOGO)
137 emacs --batch --visit=$< --funcall org-export-as-html-batch \
138 && mv doc/index.html $@
140 $(DEPLOYMENT_HTML) : doc/deployment.org $(LOGO)
141 emacs --batch --visit=$< --funcall org-export-as-html-batch \
142 && mv doc/deployment.html $@
144 $(PHOROS_HELP_HTML) : doc/phoros--help.org $(PHOROS_HELP_OUTPUT) $(LOGO)
145 emacs --batch --visit=$< --funcall org-export-as-html-batch \
146 && mv doc/phoros--help.html $@
148 $(PUBLIC_CSS) : doc/style.css public_html
149 cp $< $@
151 $(NOT_FOUND_HTML) : doc/404.org $(LOGO)
152 emacs --batch --visit=$< --funcall org-export-as-html-batch \
153 && mv doc/404.html $@
155 phoros-proper.tar :
156 git archive --prefix=phoros_$(LATEST_TAG)/ --output=$@ $(LATEST_TAG)
158 phoml.tar :
159 cd phoml \
160 && git archive --prefix=phoros_$(LATEST_TAG)/phoml/ --output=../$@ HEAD
162 .INTERMEDIATE : phoros-proper.tar phoml.tar
164 bin-tarball : phoros TimeSteps.history README \
165 $(EXAMPLES_DIR) \
166 $(ETC_DIR) \
167 $(OPENLAYERS_DIR) \
168 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
169 $(LIBPHOML_DIR)/$(LIBPHOML)
170 tar -cf - \
171 --transform='s,^,phoros_$(PHOROS_VERSION)/,' \
172 phoros TimeSteps.history README \
173 $(EXAMPLES_DIR) \
174 $(ETC_DIR) \
175 $(OPENLAYERS_DIR) \
176 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
177 --directory=$(LIBPHOML_DIR) $(LIBPHOML) \
178 | gzip -f \
179 > phoros_$(PHOROS_VERSION)_$(MACHINE_TYPE).tar.gz
181 src-tarball : phoros-proper.tar phoml.tar
182 tar --concatenate -f phoros_$(LATEST_TAG).tar $^ \
183 && gzip -f phoros_$(LATEST_TAG).tar
185 html : $(INDEX_HTML) $(DEPLOYMENT_HTML) $(PHOROS_HELP_HTML) $(PUBLIC_CSS) $(FAVICON) $(NOT_FOUND_HTML)
187 git-tag : phoros #tag name is :version string in phoros.asd
188 git tag -a $(PHOROS_VERSION) -m ""
190 clean :
191 rm -f *.fasl *.log phoros phoros*.tar.gz \
192 $(LOGO) $(BACKGROUND_IMAGE) $(FAVICON) $(CURSOR_IMAGE) \
193 $(PHOROS_HELP_OUTPUT) \
194 $(INDEX_HTML) $(DEPLOYMENT_HTML) \
195 $(PUBLIC_CSS)
196 rm -rf $(OPENLAYERS_DIR) $(PRISTINE_OPENLAYERS_DIR)
197 cd phoml; $(MAKE) clean
200 .PHONY : bin-tarball src-tarball html git-tag clean
203 # Github
205 gh-publish:
206 rm -rf gh-pages
207 mkdir gh-pages
208 $(MAKE) gh-pages/index.html \
209 gh-pages/deployment.html \
210 gh-pages/phoros--help.html \
211 gh-pages/phoros-12.8.1.png \
212 gh-pages/404.html \
213 gh-pages/CNAME \
214 gh-pages/README \
215 gh-pages/favicon.ico \
216 gh-pages/robots.txt \
217 gh-pages/style.css
218 cd gh-pages; git init; git add ./; git commit -a -m "gh-pages pseudo commit"; git push git@github.com:trebb/phoros.git +master:gh-pages
220 gh-pages/%.html: public_html/%.html
221 cp $< $@
223 gh-pages/favicon.ico: public_html/favicon.ico
224 cp $< $@
226 gh-pages/%: doc/%
227 cp $< $@