summaryrefslogtreecommitdiffstats
path: root/web/js/Makefile
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>2012-06-28 19:49:45 +0000
committerAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>2012-06-28 19:49:45 +0000
commit5e54ba7aa27b95d1e0568693915e735ab8058ff7 (patch)
tree1c2743605a6cce00edb82b5f15b9a3f08f6ace30 /web/js/Makefile
downloadlabitrack-5e54ba7aa27b95d1e0568693915e735ab8058ff7.tar.gz
labitrack-5e54ba7aa27b95d1e0568693915e735ab8058ff7.tar.xz
labitrack-5e54ba7aa27b95d1e0568693915e735ab8058ff7.zip
Initial version
Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
Diffstat (limited to 'web/js/Makefile')
-rw-r--r--web/js/Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/web/js/Makefile b/web/js/Makefile
new file mode 100644
index 0000000..7664ea1
--- /dev/null
+++ b/web/js/Makefile
@@ -0,0 +1,24 @@
+DIRS=$(wildcard *.d)
+FILEEXT=.js
+SRCTARGETS=$(patsubst %.d,dist/%.src.js,$(DIRS))
+MINTARGETS=$(patsubst %.d,dist/%.min.js,$(DIRS))
+
+depend=$(shell sh -c 'ls $$(echo $1 | cut -d/ -f2 | cut -d. -f1).d/*$(FILEEXT)')
+
+.PHONY: all mkdist
+all: $(MINTARGETS)
+clean:
+ rm -f $(SRCTARGETS)
+ rm -f $(MINTARGETS)
+mkdist:
+ @@mkdir -p dist
+
+.SECONDEXPANSION:
+$(SRCTARGETS): $$(call depend,$$@) | mkdist
+ date
+ cat $^ > $@
+
+.SECONDEXPANSION:
+$(MINTARGETS): $$(patsubst %.min.js,%.src.js,$$@)
+ date
+ uglifyjs $^ > $@