summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--include.mk12
2 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 06b3c30..a9de6e0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,9 @@
-sassfiles = $(filter-out $(wildcard */_*.scss),$(wildcard */*.scss))
-cssfiles = $(sassfiles:scss=css)
+cssprojects ?= default blueview actiontabs
-all: $(cssfiles)
+beautify ?= yes
-%.css: %.scss
- sass --style expanded $< $@
- perl -i -pe 's/ /\t/g' $@
+all: $(cssprojects)
-clean:
- rm -f $(cssfiles)
- rm -rf .sass-cache
+include include.mk
-.PHONY: clean
+.PHONY: all
diff --git a/include.mk b/include.mk
new file mode 100644
index 0000000..48d2778
--- /dev/null
+++ b/include.mk
@@ -0,0 +1,12 @@
+cssprojectinfiles = $(foreach file,$(if $1,$(shell find $1 -name '*.scss')),$(if $(filter-out _%,$(notdir $(file))),$(file)))
+cssprojectoutfiles = $(patsubst %.scss,%.css,$(call cssprojectinfiles,$1))
+
+$(cssprojects):
+ sass --update --stop-on-error $(if $(beautify),--style expanded) $@
+ $(if $(beautify),perl -i -pe 's/ /\t/g' $(call cssprojectoutfiles,$@))
+
+clean::
+ rm -f $(call cssprojectoutfiles,$(cssprojects))
+ rm -rf .sass-cache
+
+.PHONY: clean $(cssprojects)