summaryrefslogtreecommitdiffstats
path: root/web/css/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'web/css/Makefile')
-rw-r--r--web/css/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/web/css/Makefile b/web/css/Makefile
new file mode 100644
index 0000000..886b5a2
--- /dev/null
+++ b/web/css/Makefile
@@ -0,0 +1,25 @@
+DIRS=$(wildcard *.d)
+FILEEXT=ss # less or css
+OUTEXT=.css
+SRCTARGETS=$(patsubst %.d,dist/%.src$(OUTEXT),$(DIRS))
+MINTARGETS=$(patsubst %.d,dist/%.min$(OUTEXT),$(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$(OUTEXT),%.src$(OUTEXT),$$@)
+ date
+ lessc -x $^ > $@