Fasttrack: improve timing of image output
[phoros.git] / Makefile
blob02f3d68bcbe8a5ebea71687398b9cf52264c9883
1 # PHOROS -- Photogrammetric Road Survey
2 # Copyright (C) 2010, 2011, 2012, 2015, 2017 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 LIBIMREAD = libimread.so
22 CCFLAGS = -std=c99 -Wall -Wextra -pedantic -O2
23 OPENLAYERS_TARBALL = OpenLayers-2.10.tar.gz
24 PRISTINE_OPENLAYERS_DIR = OpenLayers-2.10
25 EXAMPLES_DIR = examples
26 ETC_DIR = etc
27 OPENLAYERS_DIR = ol #for compiled/shrunk OpenLayers
28 OPENLAYERS_CONFIG = phoros.cfg
29 OPENLAYERS_JS = ol/OpenLayers.js
30 OPENLAYERS_THEME = ol/theme
31 OPENLAYERS_IMG = ol/img
32 LOGO = public_html/phoros-logo-plain.png
33 BUTTON_IMAGE = public_html/phoros-logo-button.png
34 BACKGROUND_IMAGE = public_html/phoros-logo-background.png
35 CURSOR_IMAGE = public_html/phoros-cursor.png
36 FAVICON = public_html/favicon.ico
37 INDEX_HTML = public_html/index.html
38 PHOROS_HELP_HTML = public_html/phoros--help.html
39 DEPLOYMENT_HTML = public_html/deployment.html
40 PUBLIC_CSS = public_html/style.css
41 NOT_FOUND_HTML = public_html/404.html
42 PHOROS_VERSION = $(shell ./phoros --version)
43 LATEST_TAG = $(shell git describe)
44 MACHINE_TYPE = $(shell uname -m)
45 PHOROS_HELP_OUTPUT = phoros-help.txt
46 SOURCE = *.lisp *.asd Makefile
48 all : fasttrack phoros
50 phoros : $(SOURCE) photogrammetry_lib $(OPENLAYERS_JS) \
51 $(OPENLAYERS_THEME) $(OPENLAYERS_IMG) \
52 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
53 $(LIBIMREAD)
54 CC=gcc \
55 $(LISP) --lose-on-corruption \
56 --disable-ldb \
57 --dynamic-space-size 8192 \
58 --end-runtime-options \
59 --disable-debugger \
60 --eval '(progn (pushnew :build-phoros *features*) (load "make.lisp"))'
62 fasttrack : $(SOURCE) photogrammetry_lib \
63 $(BACKGROUND_IMAGE) $(LOGO) $(BUTTON_IMAGE)
64 CC=gcc \
65 $(LISP) --lose-on-corruption \
66 --disable-ldb \
67 --dynamic-space-size 4096 \
68 --end-runtime-options \
69 --disable-debugger \
70 --eval '(progn (pushnew :build-fasttrack *features*) (load "make.lisp"))'
72 $(OPENLAYERS_TARBALL) :
73 wget https://github.com/openlayers/openlayers/releases/download/release-2.10/$@
75 $(PRISTINE_OPENLAYERS_DIR)/lib/* : $(OPENLAYERS_TARBALL)
76 tar -xmzf $<
78 $(OPENLAYERS_JS) : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
79 mkdir -p $(OPENLAYERS_DIR) && cp $< $@
81 $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js : \
82 $(PRISTINE_OPENLAYERS_DIR)/lib/* $(OPENLAYERS_CONFIG)
83 cp $(OPENLAYERS_CONFIG) $(PRISTINE_OPENLAYERS_DIR)/build/ && \
84 cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py $(OPENLAYERS_CONFIG)
85 ###### cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py full.cfg
87 .INTERMEDIATE : $(PRISTINE_OPENLAYERS_DIR)/build/OpenLayers.js
89 $(OPENLAYERS_THEME) : $(PRISTINE_OPENLAYERS_DIR)/theme $(OPENLAYERS_JS)
90 cp -R $< $@
92 $(OPENLAYERS_IMG) : $(PRISTINE_OPENLAYERS_DIR)/img $(OPENLAYERS_JS)
93 cp -R $< $@
95 photogrammetry_lib :
96 cd phoml; $(MAKE)
98 public_html :
99 mkdir -p public_html
101 $(LOGO) : Makefile public_html
102 ! convert \
103 -size 113x125 xc:transparent \
104 -font Gentium \
105 -fill black \
106 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
107 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
108 $@ 2>&1 | grep convert:
109 $(BUTTON_IMAGE) : Makefile public_html
110 ! convert \
111 -size 113x125 xc:transparent \
112 -font Gentium \
113 -fill navy \
114 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
115 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
116 -resize 40% \
117 $@ 2>&1 | grep convert:
119 $(BACKGROUND_IMAGE) : Makefile public_html
120 ! convert \
121 -size 113x125 xc:transparent \
122 -font Gentium \
123 -fill "#f5f5f5" \
124 -pointsize 200 -gravity center -draw "text 3,3 'Φ'" \
125 -pointsize 57 -gravity center -draw "text 23,2 'Σ'" \
126 -resize 150% \
127 $@ 2>&1 | grep convert:
128 $(CURSOR_IMAGE) : Makefile public_html
129 ! convert \
130 -size 14x16 xc:transparent \
131 -font Gentium \
132 -fill Navy \
133 -pointsize 22 -gravity center -draw "text 0.21,1 'Φ'" \
134 -pointsize 7 -gravity center -draw "text 1.61,.1 'Σ'" \
135 $@ 2>&1 | grep convert:
136 # Font Gentium is in Debian package fonts-sil-gentium.
138 $(FAVICON) : favicon.png
139 icotool -c -o $@ $<
141 favicon.png : $(LOGO)
142 convert $< -resize 16x16 $@
144 .INTERMEDIATE : favicon.png
146 $(PHOROS_HELP_OUTPUT) : phoros
147 ./phoros --help > $@
149 .INTERMEDIATE : $(PHOROS_HELP_OUTPUT)
151 $(INDEX_HTML) : doc/index.org $(LOGO)
152 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
154 $(DEPLOYMENT_HTML) : doc/deployment.org $(LOGO)
155 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
157 $(PHOROS_HELP_HTML) : doc/phoros--help.org $(PHOROS_HELP_OUTPUT) $(LOGO)
158 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
160 $(PUBLIC_CSS) : doc/style.css public_html
161 cp $< $@
163 $(NOT_FOUND_HTML) : doc/404.org $(LOGO)
164 emacs --batch --visit=$< --eval '(progn (org-html-export-as-html) (write-file "../$@"))'
166 phoros-proper.tar :
167 git archive --prefix=phoros_$(LATEST_TAG)/ --output=$@ $(LATEST_TAG)
169 phoml.tar :
170 cd phoml \
171 && git archive --prefix=phoros_$(LATEST_TAG)/phoml/ --output=../$@ HEAD
173 .INTERMEDIATE : phoros-proper.tar phoml.tar
175 bin-tarball : phoros TimeSteps.history fasttrack README \
176 $(EXAMPLES_DIR) \
177 $(ETC_DIR) \
178 $(OPENLAYERS_DIR) \
179 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
180 $(LIBPHOML_DIR)/$(LIBPHOML) \
181 $(LIBIMREAD)
182 tar -cf - \
183 --transform='s,^,phoros_$(PHOROS_VERSION)/,' \
184 phoros TimeSteps.history fasttrack fasttrack.ui README \
185 $(EXAMPLES_DIR) \
186 $(ETC_DIR) \
187 $(OPENLAYERS_DIR) \
188 $(BACKGROUND_IMAGE) $(LOGO) $(FAVICON) $(CURSOR_IMAGE) \
189 $(BUTTON_IMAGE) \
190 $(LIBIMREAD) \
191 --directory=$(LIBPHOML_DIR) $(LIBPHOML) \
192 | gzip -f \
193 > phoros_$(PHOROS_VERSION)_$(MACHINE_TYPE).tar.gz
195 src-tarball : phoros-proper.tar phoml.tar
196 tar --concatenate -f phoros_$(LATEST_TAG).tar $^ \
197 && gzip -f phoros_$(LATEST_TAG).tar
199 html : $(INDEX_HTML) $(DEPLOYMENT_HTML) $(PHOROS_HELP_HTML) $(PUBLIC_CSS) $(FAVICON) $(NOT_FOUND_HTML)
201 git-tag : phoros #tag name is :version string in phoros.asd
202 git tag -a $(PHOROS_VERSION) -m ""
204 imreadtest : imreadtest.c $(LIBIMREAD) Makefile #for debugging
205 gcc $(CCFLAGS) imreadtest.c -o imreadtest \
206 `pkg-config --cflags --libs libpng libjpeg` -lm \
207 -L./ -limread -Wl,-rpath,"./"
209 $(LIBIMREAD) : imread.c imread.h Makefile
210 gcc $(CCFLAGS) -fpic -shared -o libimread.so \
211 `pkg-config --cflags --libs libpng libjpeg` -lm imread.c
213 clean :
214 rm -rf *.fasl *.log \
215 phoros phoros*.tar.gz \
216 fasttrack \
217 $(LIBIMREAD) imreadtest \
218 $(LOGO) $(BACKGROUND_IMAGE) $(FAVICON) $(CURSOR_IMAGE) \
219 $(BUTTON_IMAGE) \
220 $(PHOROS_HELP_OUTPUT) \
221 $(INDEX_HTML) $(DEPLOYMENT_HTML) \
222 $(PUBLIC_CSS)
223 rm -rf $(OPENLAYERS_DIR) $(PRISTINE_OPENLAYERS_DIR)
224 cd phoml; $(MAKE) clean
227 .PHONY : bin-tarball src-tarball html git-tag clean
230 # Github
232 gh-publish:
233 rm -rf gh-pages
234 mkdir gh-pages
235 $(MAKE) gh-pages/index.html \
236 gh-pages/deployment.html \
237 gh-pages/phoros--help.html \
238 gh-pages/phoros-12.8.1.png \
239 gh-pages/phoros-logo-plain.png \
240 gh-pages/404.html \
241 gh-pages/CNAME \
242 gh-pages/README \
243 gh-pages/favicon.ico \
244 gh-pages/robots.txt \
245 gh-pages/style.css
246 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
248 gh-pages/%.html: public_html/%.html
249 cp $< $@
251 gh-pages/favicon.ico: public_html/favicon.ico
252 cp $< $@
254 gh-pages/phoros-logo-plain.png: public_html/phoros-logo-plain.png
255 cp $< $@
257 gh-pages/%: doc/%
258 cp $< $@