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)