diff options
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | include.mk | 14 |
2 files changed, 19 insertions, 12 deletions
@@ -1,16 +1,9 @@ -sassfiles = $(filter-out $(wildcard */_*.scss),$(wildcard */*.scss)) -cssfiles = $(sassfiles:scss=css) +cssprojects ?= default blueview actiontabs -compasscfgfile = $(wildcard config/config.rb) +beautify ?= yes -all: $(cssfiles) +all: $(cssprojects) -%.css: %.scss - compass compile --sass-dir= --css-dir= $(compasscfgfile:%=-c %) --output-style expanded --relative-assets $< - perl -i -pe 's/ /\t/g' $@ +include include.mk -clean: - rm -f $(cssfiles) - rm -rf .sass-cache - -.PHONY: clean +.PHONY: all diff --git a/include.mk b/include.mk new file mode 100644 index 0000000..58be65d --- /dev/null +++ b/include.mk @@ -0,0 +1,14 @@ +cssprojectinfiles = $(foreach file,$(if $1,$(shell find $1 -name '*.scss')),$(if $(filter-out _%,$(notdir $(file))),$(file))) +cssprojectoutfiles = $(patsubst %.scss,%.css,$(call cssprojectinfiles,$1)) + +compasscfgfile = $(wildcard config/config.rb) + +$(cssprojects): + compass compile --sass-dir= --css-dir= $(compasscfgfile:%=-c %) $(if $(beautify),--output-style expanded) --relative-assets $(call cssprojectoutfiles,$@) + $(if $(beautify),perl -i -pe 's/ /\t/g' $(call cssprojectoutfiles,$@)) + +clean:: + rm -f $(call cssprojectoutfiles,$(cssprojects)) + rm -rf .sass-cache + +.PHONY: clean $(cssprojects) |