common: global style options without page exceptions
[sheet.git] / Makefile
index 19fe1d174ba857a25383d784b66d83383cec7c2a..502c65589d55f0c9732ef08929209284d625044b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-all: sitemap.xml light.css plan.plp UPDATE data cache
+all: sitemap.xml style plan.plp UPDATE data cache
 
 .PHONY: force # applied to download after 2 hours
 download := $(shell [ -z $$(find data/download -mmin -120) ] && (touch data/download && echo force))
 
 # atomically create file by command
-cmdsave = @echo '$1' $2 \>$@; mispipe '$1 $2' 'ifne sponge $@'
+cmdsave = @echo "$1" $2 \>$@; mispipe "$1 $2" 'ifne sponge $@'
 # download git checkout
 gitsave = @if cd $@ 2>/dev/null; \
        then echo git pull $@; git pull -q --ff-only || true; \
@@ -13,14 +13,15 @@ gitsave = @if cd $@ 2>/dev/null; \
 sitemap.xml: tools/mksitemap
        $(call cmdsave,$<)
 
-light.css: tools/stripcss base.css
-       $(call cmdsave,$^)
+style: light.css sc.css
+%.css: style/%.scss $(wildcard style/_*.scss)
+       $(call cmdsave,sassc -t compressed $< | perl -pE 's/\}+\K/\n/g')
 
 plan.plp: TODO
        kramdown $< >$@
 
 UPDATE: $(download)
-       $(call cmdsave,git log -1 --date=short --pretty="%ad    %s")
+       $(call cmdsave,git log -1 --date=short --pretty='%ad    %s')
 
 cache: $(patsubst %.inc.pl,data/%.json,$(wildcard charset-*.inc.pl) $(wildcard keyboard/altgr/*.inc.pl) writing-latn.inc.pl)
 word: word/put.min.js data/wordlist.en.json data/wordlist.nl.json data/wordlist.ru.json data/wordpairs.json