summaryrefslogtreecommitdiff
path: root/unrpyc
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-08-17 22:22:38 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-08-17 22:22:38 -0400
commit780226fa442abda5cb5b1018e998f50e7985e908 (patch)
tree353b00372e2137e72236c5665293133114208277 /unrpyc
parent11d9810801baa3e9627e99f0a58ef0eedaeb5bae (diff)
downloadhtml5ks-780226fa442abda5cb5b1018e998f50e7985e908.tar.xz
html5ks-780226fa442abda5cb5b1018e998f50e7985e908.zip
toolchain improvements
Diffstat (limited to 'unrpyc')
-rw-r--r--unrpyc/Makefile11
-rwxr-xr-xunrpyc/find-gzip.sh10
2 files changed, 18 insertions, 3 deletions
diff --git a/unrpyc/Makefile b/unrpyc/Makefile
index b8ad495..ea97e56 100644
--- a/unrpyc/Makefile
+++ b/unrpyc/Makefile
@@ -1,7 +1,9 @@
-all: script.json.gz imachine.json.gz imachine_replay.json.gz
+gzip := $(shell ./find-gzip.sh)
+
+all: script.json script.json.gz imachine.json imachine.json.gz imachine_replay.json imachine_replay.json.gz
%.json.gz: %.json
- gzip -9c $< > $@
+ $(gzip) -c $< > $@
touch $< $@
script.json: $(patsubst %.rpyc,%.json,$(wildcard script-*.rpyc))
@@ -25,6 +27,9 @@ test: all
jshint --show-non-errors *.json
install: all
- install -t ../www/scripts script.json script.json.gz imachine.json imachine.json.gz
+ install -t ../www/scripts script.json script.json.gz imachine.json imachine.json.gz imachine_replay.json imachine_replay.json.gz
+
+uninstall:
+ rm -f ../www/scripts/*
.PHONY: all clean test install
diff --git a/unrpyc/find-gzip.sh b/unrpyc/find-gzip.sh
new file mode 100755
index 0000000..26e60c0
--- /dev/null
+++ b/unrpyc/find-gzip.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+ZOPFLI="$(command -v zopfli)"
+GZIP="$(command -v gzip)"
+if [ -n $ZOPFLI ]; then
+ echo "$ZOPFLI"
+elif [ -n $GZIP ]; then
+ echo "$GZIP -9"
+else
+ exit 1
+fi