summaryrefslogtreecommitdiff
path: root/common.mk
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-07-14 15:04:01 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-07-14 15:04:01 -0600
commit7ccccb7abbf0f7a393fea8d3334abdbf2025db62 (patch)
treed5a6fedb84d32c7bf7b5b029a0cecca4d167bac4 /common.mk
parentf6b335b268f5f47e5c48f84f5994f7bdcd8b7e5a (diff)
Add Makefiles to download .js files, and generate .min.js files.
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk22
1 files changed, 22 insertions, 0 deletions
diff --git a/common.mk b/common.mk
new file mode 100644
index 00000000..a0db5d70
--- /dev/null
+++ b/common.mk
@@ -0,0 +1,22 @@
+topdir := $(dir $(lastword $(MAKEFILE_LIST)))
+www = $(topdir)/../web-cache/www
+
+#JSMIN = cp $1 $2
+#JSMIN = compiler $1
+#JSMIN = uglify-js -nc $1 > $2
+JSMIN = { sed -n '1,/\*\//p' $1; closure-compiler --js $1; } > $2
+
+%.min.js: %.js
+ $(call JSMIN,$<,$@)
+
+$(www)/http/%:
+ mkdir -p '$(@D)'
+ wget 'http://$*' -O '$@'
+ touch '$@'
+
+$(www)/https/%:
+ mkdir -p '$(@D)'
+ wget 'http://$*' -O '$@'
+ touch '$@'
+
+.PHONY: PHONY