Update examples
[phoros.git] / Makefile
blob63fd6cd78833bfc0ecb1ee234dfabecb2bc3a9c3
1 # PHOROS -- Photogrammetric Road Survey
2 # Copyright (C) 2010, 2011 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 OPENLAYERS_DIR = ol #for compiled/shrunk OpenLayers
25 OPENLAYERS_CONFIG = phoros.cfg
26 OPENLAYERS_JS = ol/OpenLayers.js
27 OPENLAYERS_THEME = ol/theme
28 OPENLAYERS_IMG = ol/img
29 LOGO = public_html/phoros-logo-plain.png
30 BACKGROUND_IMAGE = public_html/phoros-logo-background.png
31 CURSOR_IMAGE = public_html/phoros-cursor.png
32 FAVICON = public_html/favicon.ico
33 INDEX_HTML = public_html/index.html
34 PHOROS_HELP_HTML = public_html/phoros--help.html
35 DEPLOYMENT_HTML = public_html/deployment.html
36 PUBLIC_CSS = public_html/style.css
37 NOT_FOUND_HTML = public_html/404.html
38 PHOROS_VERSION = $(shell ./phoros --version)
39 LATEST_TAG = $(shell git tag | tail -n 1)
40 MACHINE_TYPE = $(shell uname -m)
41 PHOROS_HELP_OUTPUT = phoros-help.txt
42 SOURCE = *.lisp *.asd Makefile
44 phoros : $(SOURCE) photogrammetry_lib $(OPENLAYERS_JS) \
45 $(OPENLAYERS_THEME) $(OPENLAYERS_IMG) \
46 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE)
47 $(LISP) --lose-on-corruption --disable-ldb --end-runtime-options \
48 --disable-debugger --load make.lisp
50 $(OPENLAYERS_TARBALL) :
51 wget http://openlayers.org/download/$@
53 $(PRISTINE_OPENLAYERS_DIR)/lib/* : $(OPENLAYERS_TARBALL)
54 tar -xmzf $<
56 $(OPENLAYERS_JS) : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
57 mkdir -p $(OPENLAYERS_DIR) && cp $< $@
59 $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js : \
60 $(PRISTINE_OPENLAYERS_DIR)/lib/* $(OPENLAYERS_CONFIG)
61 cp $(OPENLAYERS_CONFIG) $(PRISTINE_OPENLAYERS_DIR)/build/ && \
62 cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py $(OPENLAYERS_CONFIG)
63 ###### cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py full.cfg
65 .INTERMEDIATE : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
67 $(OPENLAYERS_THEME) : $(PRISTINE_OPENLAYERS_DIR)/theme $(OPENLAYERS_JS)
68 cp -R $< $@
70 $(OPENLAYERS_IMG) : $(PRISTINE_OPENLAYERS_DIR)/img $(OPENLAYERS_JS)
71 cp -R $< $@
73 photogrammetry_lib :
74 cd phoml; $(MAKE)
76 public_html :
77 mkdir -p public_html
79 $(LOGO) : Makefile public_html
80 ! convert \
81 -size 113x125 xc:transparent \
82 -font Gentium-Regular \
83 -fill black \
84 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
85 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
86 $@ 2>&1 | grep convert:
88 $(BACKGROUND_IMAGE) : Makefile public_html
89 ! convert \
90 -size 113x125 xc:transparent \
91 -font Gentium-Regular \
92 -fill "#f5f5f5" \
93 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
94 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
95 -resize 150% \
96 $@ 2>&1 | grep convert:
97 $(CURSOR_IMAGE) : Makefile public_html
98 ! convert \
99 -size 14x16 xc:transparent \
100 -font Gentium-Regular \
101 -fill Navy \
102 -pointsize 22 -gravity center -draw "text 0.21,1 'Φ'" \
103 -pointsize 7 -gravity center -draw "text 1.61,.1 'Σ'" \
104 $@ 2>&1 | grep convert:
105 # Font Gentium-Regular is in Debian package ttf-sil-gentium.
107 $(FAVICON) : favicon.png
108 icotool -c -o $@ $<
110 favicon.png : $(LOGO)
111 convert $< -resize 16x16 $@
113 .INTERMEDIATE : favicon.png
115 $(PHOROS_HELP_OUTPUT) : phoros
116 ./phoros --help > $@
118 .INTERMEDIATE : $(PHOROS_HELP_OUTPUT)
120 $(INDEX_HTML) : doc/index.org $(LOGO)
121 emacs --batch --visit=$< --funcall org-export-as-html-batch \
122 && mv doc/index.html $@
124 $(DEPLOYMENT_HTML) : doc/deployment.org $(LOGO)
125 emacs --batch --visit=$< --funcall org-export-as-html-batch \
126 && mv doc/deployment.html $@
128 $(PHOROS_HELP_HTML) : doc/phoros--help.org $(PHOROS_HELP_OUTPUT) $(LOGO)
129 emacs --batch --visit=$< --funcall org-export-as-html-batch \
130 && mv doc/phoros--help.html $@
132 $(PUBLIC_CSS) : doc/style.css public_html
133 cp $< $@
135 $(NOT_FOUND_HTML) : doc/404.org $(LOGO)
136 emacs --batch --visit=$< --funcall org-export-as-html-batch \
137 && mv doc/404.html $@
139 phoros-proper.tar :
140 git archive --prefix=phoros_$(LATEST_TAG)/ --output=$@ $(LATEST_TAG)
142 phoml.tar :
143 cd phoml \
144 && git archive --prefix=phoros_$(LATEST_TAG)/phoml/ --output=../$@ HEAD
146 .INTERMEDIATE : phoros-proper.tar phoml.tar
148 bin-tarball : phoros TimeSteps.history README \
149 $(EXAMPLES_DIR) \
150 $(OPENLAYERS_DIR) \
151 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
152 $(LIBPHOML_DIR)/$(LIBPHOML)
153 tar -cf - \
154 --transform='s,^,phoros_$(PHOROS_VERSION)/,' \
155 phoros TimeSteps.history README \
156 $(EXAMPLES_DIR) \
157 $(OPENLAYERS_DIR) \
158 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
159 --directory=$(LIBPHOML_DIR) $(LIBPHOML) \
160 | gzip -f \
161 > phoros_$(PHOROS_VERSION)_$(MACHINE_TYPE).tar.gz
163 src-tarball : phoros-proper.tar phoml.tar
164 tar --concatenate -f phoros_$(LATEST_TAG).tar $^ \
165 && gzip -f phoros_$(LATEST_TAG).tar
167 html : $(INDEX_HTML) $(DEPLOYMENT_HTML) $(PHOROS_HELP_HTML) $(PUBLIC_CSS) $(FAVICON) $(NOT_FOUND_HTML)
169 git-tag : phoros #tag name is :version string in phoros.asd
170 git tag -a $(PHOROS_VERSION) -m ""
172 clean :
173 rm -f *.fasl *.log phoros phoros*.tar.gz \
174 $(LOGO) $(BACKGROUND_IMAGE) $(FAVICON) $(CURSOR_IMAGE) \
175 $(PHOROS_HELP_OUTPUT) \
176 $(INDEX_HTML) $(DEPLOYMENT_HTML) \
177 $(PUBLIC_CSS)
178 rm -rf $(OPENLAYERS_DIR) $(PRISTINE_OPENLAYERS_DIR)
179 cd phoml; $(MAKE) clean
182 .PHONY : bin-tarball src-tarball html git-tag clean
185 # Github
187 gh-publish:
188 rm -rf gh-pages
189 mkdir gh-pages
190 $(MAKE) gh-pages/index.html \
191 gh-pages/deployment.html \
192 gh-pages/phoros--help.html \
193 gh-pages/phoros-12.8.1.png \
194 gh-pages/404.html \
195 gh-pages/CNAME \
196 gh-pages/README \
197 gh-pages/favicon.ico \
198 gh-pages/robots.txt \
199 gh-pages/style.css
200 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
202 gh-pages/%.html: public_html/%.html
203 cp $< $@
205 gh-pages/favicon.ico: public_html/favicon.ico
206 cp $< $@
208 gh-pages/%: doc/%
209 cp $< $@