aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0dde3e9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+pkg-plack-core = libplack-perl
+# TODO: Extend when Plack::Middleware::IndexDir is in stable Debian
+pkg-plack-extra = libplack-middleware-deflater-perl
+# TODO: Use Leaflet.Markercluster only optionally
+pkg-js = \
+ libjs-requirejs libjs-requirejs-text \
+ libjs-leaflet libjs-leaflet-markercluster
+pkg-nodejs = node-requirejs
+pkg-code-minimal = $(pkg-plack-core) $(pkg-js)
+pkg-code-quick = $(pkg-code-minimal) $(pkg-plack-extra)
+pkg-code = $(pkg-code-quick) $(pkg-nodejs) jq
+lists = $(patsubst %,list-%,\
+ pkg-code pkg-code-quick pkg-code-minimal)
+
+all: build-compact
+
+# TODO: Call node (not nodejs) when Nodejs 6 (Debian Buster) is commonly used
+build-compact:
+ nodejs /usr/lib/nodejs/requirejs/r.js -o bin/build.js
+ jq --tab --sort-keys -c '.features|=sort_by(.geometry.type)|.features|=sort_by(.properties.name)' \
+ < build/data/staff.json \
+ > build/data/staff.json~
+ mv -f build/data/staff.json~ build/data/staff.json
+ touch $@
+
+# load httpd service
+serve-quick:
+ bin/src.psgi
+serve-compact:
+ bin/build.psgi
+
+# machine-readable output (e.g. APT package dependencies)
+$(lists): list-%:
+ @echo "$(sort $($*))"
+
+clean:
+ rm -rf build
+ rm -f build-compact
+
+.PHONY: all clean list-% serve-%