Include fasttrack in binary tarball
[phoros.git] / Makefile
blob8103f946a400aecc8a6dc472d4a6dbf6fd7ade34
1 # PHOROS -- Photogrammetric Road Survey
2 # Copyright (C) 2010, 2011, 2012, 2015 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 test -x ../sbcl/bin/sbcl && 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 all : fasttrack phoros
47 phoros : $(SOURCE) photogrammetry_lib $(OPENLAYERS_JS) \
48 $(OPENLAYERS_THEME) $(OPENLAYERS_IMG) \
49 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE)
50 CC=gcc \
51 $(LISP) --lose-on-corruption \
52 --disable-ldb \
53 --dynamic-space-size 4096 \
54 --end-runtime-options \
55 --disable-debugger \
56 --eval '(progn (pushnew :build-phoros *features*) (load "make.lisp"))'
58 fasttrack : $(SOURCE) photogrammetry_lib \
59 $(BACKGROUND_IMAGE) $(LOGO) $(CURSOR_IMAGE)
60 CC=gcc \
61 $(LISP) --lose-on-corruption \
62 --disable-ldb \
63 --dynamic-space-size 4096 \
64 --end-runtime-options \
65 --disable-debugger \
66 --eval '(progn (pushnew :build-fasttrack *features*) (load "make.lisp"))'
68 $(OPENLAYERS_TARBALL) :
69 wget https://github.com/openlayers/openlayers/releases/download/release-2.10/$@
71 $(PRISTINE_OPENLAYERS_DIR)/lib/* : $(OPENLAYERS_TARBALL)
72 tar -xmzf $<
74 $(OPENLAYERS_JS) : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
75 mkdir -p $(OPENLAYERS_DIR) && cp $< $@
77 $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js : \
78 $(PRISTINE_OPENLAYERS_DIR)/lib/* $(OPENLAYERS_CONFIG)
79 cp $(OPENLAYERS_CONFIG) $(PRISTINE_OPENLAYERS_DIR)/build/ && \
80 cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py $(OPENLAYERS_CONFIG)
81 ###### cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py full.cfg
83 .INTERMEDIATE : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
85 $(OPENLAYERS_THEME) : $(PRISTINE_OPENLAYERS_DIR)/theme $(OPENLAYERS_JS)
86 cp -R $< $@
88 $(OPENLAYERS_IMG) : $(PRISTINE_OPENLAYERS_DIR)/img $(OPENLAYERS_JS)
89 cp -R $< $@
91 photogrammetry_lib :
92 cd phoml; $(MAKE)
94 public_html :
95 mkdir -p public_html
97 $(LOGO) : Makefile public_html
98 ! convert \
99 -size 113x125 xc:transparent \
100 -font Gentium \
101 -fill black \
102 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
103 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
104 $@ 2>&1 | grep convert:
106 $(BACKGROUND_IMAGE) : Makefile public_html
107 ! convert \
108 -size 113x125 xc:transparent \
109 -font Gentium \
110 -fill "#f5f5f5" \
111 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
112 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
113 -resize 150% \
114 $@ 2>&1 | grep convert:
115 $(CURSOR_IMAGE) : Makefile public_html
116 ! convert \
117 -size 14x16 xc:transparent \
118 -font Gentium \
119 -fill Navy \
120 -pointsize 22 -gravity center -draw "text 0.21,1 'Φ'" \
121 -pointsize 7 -gravity center -draw "text 1.61,.1 'Σ'" \
122 $@ 2>&1 | grep convert:
123 # Font Gentium is in Debian package fonts-sil-gentium.
125 $(FAVICON) : favicon.png
126 icotool -c -o $@ $<
128 favicon.png : $(LOGO)
129 convert $< -resize 16x16 $@
131 .INTERMEDIATE : favicon.png
133 $(PHOROS_HELP_OUTPUT) : phoros
134 ./phoros --help > $@
136 .INTERMEDIATE : $(PHOROS_HELP_OUTPUT)
138 $(INDEX_HTML) : doc/index.org $(LOGO)
139 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
141 $(DEPLOYMENT_HTML) : doc/deployment.org $(LOGO)
142 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
144 $(PHOROS_HELP_HTML) : doc/phoros--help.org $(PHOROS_HELP_OUTPUT) $(LOGO)
145 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
147 $(PUBLIC_CSS) : doc/style.css public_html
148 cp $< $@
150 $(NOT_FOUND_HTML) : doc/404.org $(LOGO)
151 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
153 phoros-proper.tar :
154 git archive --prefix=phoros_$(LATEST_TAG)/ --output=$@ $(LATEST_TAG)
156 phoml.tar :
157 cd phoml \
158 && git archive --prefix=phoros_$(LATEST_TAG)/phoml/ --output=../$@ HEAD
160 .INTERMEDIATE : phoros-proper.tar phoml.tar
162 bin-tarball : phoros TimeSteps.history fasttrack README \
163 $(EXAMPLES_DIR) \
164 $(ETC_DIR) \
165 $(OPENLAYERS_DIR) \
166 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
167 $(LIBPHOML_DIR)/$(LIBPHOML)
168 tar -cf - \
169 --transform='s,^,phoros_$(PHOROS_VERSION)/,' \
170 phoros TimeSteps.history fasttrack README \
171 $(EXAMPLES_DIR) \
172 $(ETC_DIR) \
173 $(OPENLAYERS_DIR) \
174 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
175 --directory=$(LIBPHOML_DIR) $(LIBPHOML) \
176 | gzip -f \
177 > phoros_$(PHOROS_VERSION)_$(MACHINE_TYPE).tar.gz
179 src-tarball : phoros-proper.tar phoml.tar
180 tar --concatenate -f phoros_$(LATEST_TAG).tar $^ \
181 && gzip -f phoros_$(LATEST_TAG).tar
183 html : $(INDEX_HTML) $(DEPLOYMENT_HTML) $(PHOROS_HELP_HTML) $(PUBLIC_CSS) $(FAVICON) $(NOT_FOUND_HTML)
185 git-tag : phoros #tag name is :version string in phoros.asd
186 git tag -a $(PHOROS_VERSION) -m ""
188 clean :
189 rm -rf *.fasl *.log \
190 phoros phoros*.tar.gz \
191 fasttrack \
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/phoros-logo-plain.png \
213 gh-pages/404.html \
214 gh-pages/CNAME \
215 gh-pages/README \
216 gh-pages/favicon.ico \
217 gh-pages/robots.txt \
218 gh-pages/style.css
219 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
221 gh-pages/%.html: public_html/%.html
222 cp $< $@
224 gh-pages/favicon.ico: public_html/favicon.ico
225 cp $< $@
227 gh-pages/phoros-logo-plain.png: public_html/phoros-logo-plain.png
228 cp $< $@
230 gh-pages/%: doc/%
231 cp $< $@