2015-10-01 06:28:10 +00:00
# ** Variables
VPATH = .:sites
CSS_DIR := css
COLORS := light dark
2015-10-14 21:09:45 +00:00
COMMON_FILES := $( wildcard styl/*.styl) sites/generic.styl
2015-10-01 11:05:18 +00:00
SITES := $( patsubst sites/%.styl,%,$( wildcard sites/*) )
2015-10-01 06:28:10 +00:00
# ** Functions
2015-10-14 20:31:56 +00:00
make_site = for color in $( COLORS) ; do stylus --include styl --import styl/$$ color.styl --import styl -p sites/$( 1) .styl >$( CSS_DIR) /solarized-$( 1) -$$ color.css; done
2015-10-01 06:28:10 +00:00
# ** Rules
.PHONY : all
all : $( SITES )
$(CSS_DIR) :
mkdir $( CSS_DIR)
2015-10-01 11:05:18 +00:00
# Make all-sites explicitly depend on everything so it will be rebuilt when anything changes
$(CSS_DIR)/solarized-all-sites-*.css : $( wildcard sites /*)
2015-10-01 06:28:10 +00:00
$(SITES) : %: $( CSS_DIR ) /solarized -%-dark .css $( CSS_DIR ) /solarized -%-light .css
$(foreach color, $(COLORS), $(CSS_DIR)/solarized-%-$(color).css) : sites /%.styl $( COMMON_FILES ) | $( CSS_DIR )
$( call make_site,$* )