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 OPENLAYERS_DIR
= ol
#for compiled/shrunk OpenLayers
24 OPENLAYERS_CONFIG
= phoros.cfg
25 OPENLAYERS_JS
= ol
/OpenLayers.js
26 OPENLAYERS_THEME
= ol
/theme
27 OPENLAYERS_IMG
= ol
/img
28 SERVER_CSS
= css
/style.css
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 PHOROS_VERSION
= $(shell .
/phoros
--version
)
38 LATEST_TAG
= $(shell git tag | tail
-n
1)
39 MACHINE_TYPE
= $(shell uname
-m
)
40 PHOROS_HELP_OUTPUT
= phoros-help.txt
41 SOURCE
= *.lisp
*.asd Makefile
43 phoros
: $(SOURCE
) photogrammetry_lib
$(OPENLAYERS_JS
) \
44 $(OPENLAYERS_THEME
) $(OPENLAYERS_IMG
) \
45 $(BACKGROUND_IMAGE
) $(LOGO
) $(FAVICON
) $(CURSOR_IMAGE
)
46 $(LISP
) --lose-on-corruption
--disable-ldb
--end-runtime-options \
47 --disable-debugger
--load make.lisp
49 $(OPENLAYERS_TARBALL
) :
50 wget http
://openlayers.org
/download
/$@
52 $(PRISTINE_OPENLAYERS_DIR
)/lib
/* : $(OPENLAYERS_TARBALL
)
55 $(OPENLAYERS_JS
) : $(PRISTINE_OPENLAYERS_DIR
)/build
/OpenLayers.js
56 mkdir
-p
$(OPENLAYERS_DIR
) && cp
$< $@
58 $(PRISTINE_OPENLAYERS_DIR
)/build
/OpenLayers.js
: \
59 $(PRISTINE_OPENLAYERS_DIR
)/lib
/* $(OPENLAYERS_CONFIG
)
60 cp
$(OPENLAYERS_CONFIG
) $(PRISTINE_OPENLAYERS_DIR
)/build
/ && \
61 cd
$(PRISTINE_OPENLAYERS_DIR
)/build
&& .
/build.py
$(OPENLAYERS_CONFIG
)
62 ###### cd $(PRISTINE_OPENLAYERS_DIR)/build && ./build.py full.cfg
64 .INTERMEDIATE
: $(PRISTINE_OPENLAYERS_DIR
)/build
/OpenLayers.js
66 $(OPENLAYERS_THEME
) : $(PRISTINE_OPENLAYERS_DIR
)/theme
$(OPENLAYERS_JS
)
69 $(OPENLAYERS_IMG
) : $(PRISTINE_OPENLAYERS_DIR
)/img
$(OPENLAYERS_JS
)
78 $(LOGO
) : Makefile public_html
80 -size
113x125 xc
:transparent \
81 -font Gentium-Regular \
83 -pointsize
200 -gravity center
-draw
"text 3,3 'Φ'" \
84 -pointsize
57 -gravity center
-draw
"text 23,2 'Σ'" \
85 $@
2>&1 | grep convert
:
87 $(BACKGROUND_IMAGE
) : Makefile public_html
89 -size
113x125 xc
:transparent \
90 -font Gentium-Regular \
92 -pointsize
200 -gravity center
-draw
"text 3,3 'Φ'" \
93 -pointsize
57 -gravity center
-draw
"text 23,2 'Σ'" \
95 $@
2>&1 | grep convert
:
96 $(CURSOR_IMAGE
) : Makefile public_html
98 -size
14x16 xc
:transparent \
99 -font Gentium-Regular \
101 -pointsize
22 -gravity center
-draw
"text 0.21,1 'Φ'" \
102 -pointsize
7 -gravity center
-draw
"text 1.61,.1 'Σ'" \
103 $@
2>&1 | grep convert
:
104 # Font Gentium-Regular is in Debian package ttf-sil-gentium.
106 $(FAVICON
) : favicon.png
109 favicon.png
: $(LOGO
)
110 convert
$< -resize
16x16
$@
112 .INTERMEDIATE
: favicon.png
114 $(PHOROS_HELP_OUTPUT
) : phoros
117 .INTERMEDIATE
: $(PHOROS_HELP_OUTPUT
)
119 $(INDEX_HTML
) : doc
/index.org
$(LOGO
)
120 emacs
--batch
--visit
=$< --funcall org-export-as-html-batch \
121 && mv doc
/index.html
$@
123 $(DEPLOYMENT_HTML
) : doc
/deployment.org
$(LOGO
)
124 emacs
--batch
--visit
=$< --funcall org-export-as-html-batch \
125 && mv doc
/deployment.html
$@
127 $(PHOROS_HELP_HTML
) : doc
/phoros--help.org
$(PHOROS_HELP_OUTPUT
) $(LOGO
)
128 emacs
--batch
--visit
=$< --funcall org-export-as-html-batch \
129 && mv doc
/phoros--help.html
$@
131 $(PUBLIC_CSS
) : doc
/style.css public_html
135 git archive
--prefix=phoros_
$(LATEST_TAG
)/ --output
=$@
$(LATEST_TAG
)
139 && git archive
--prefix=phoros_
$(LATEST_TAG
)/phoml
/ --output
=..
/$@ HEAD
141 .INTERMEDIATE
: phoros-proper.
tar phoml.
tar
143 bin-tarball
: phoros TimeSteps.history README trigger-example.sql \
144 $(SERVER_CSS
) $(OPENLAYERS_DIR
) \
145 $(BACKGROUND_IMAGE
) $(LOGO
) $(FAVICON
) $(CURSOR_IMAGE
) \
146 $(LIBPHOML_DIR
)/$(LIBPHOML
)
148 --transform
='s,^,phoros_$(PHOROS_VERSION)/,' \
149 phoros TimeSteps.history README trigger-example.sql \
150 $(SERVER_CSS
) $(OPENLAYERS_DIR
) \
151 $(BACKGROUND_IMAGE
) $(LOGO
) $(FAVICON
) $(CURSOR_IMAGE
) \
152 --directory
=$(LIBPHOML_DIR
) $(LIBPHOML
) \
154 > phoros_
$(PHOROS_VERSION
)_
$(MACHINE_TYPE
).
tar.gz
156 src-tarball
: phoros-proper.
tar phoml.
tar
157 tar --concatenate
-f phoros_
$(LATEST_TAG
).
tar $^ \
158 && gzip
-f phoros_
$(LATEST_TAG
).
tar
160 html
: $(INDEX_HTML
) $(DEPLOYMENT_HTML
) $(PHOROS_HELP_HTML
) $(PUBLIC_CSS
) $(FAVICON
)
162 git-tag
: phoros
#tag name is :version string in phoros.asd
163 git tag
-a
$(PHOROS_VERSION
) -m
""
166 rm -f
*.fasl
*.log phoros phoros
*.
tar.gz \
167 $(LOGO
) $(BACKGROUND_IMAGE
) $(FAVICON
) $(CURSOR_IMAGE
)\
168 $(PHOROS_HELP_OUTPUT
) $(INDEX_HTML
) $(DEPLOYMENT_HTML
) $(PUBLIC_CSS
)
169 rm -rf
$(OPENLAYERS_DIR
) $(PRISTINE_OPENLAYERS_DIR
)
170 cd phoml
; $(MAKE
) clean
173 .PHONY
: bin-tarball src-tarball html git-tag
clean