common: generate optimised css file for light
[sheet.git] / Makefile
index a21f87bd95fbf125fc7d4312c1b0240f577845c8..349e34f9399f2d8d2584c13c7caf4388653cdcfb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
-all: sitemap.xml data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.inc.pl
+all: sitemap.xml light.css data/digraphs.inc.pl data/unicode-cover.inc.pl data/countries.inc.pl data/browser data/termcol-xcolor.inc.pl data/digraphs-xorg.inc.pl
 more: all
 
 download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv data/xcolors data/unicode-sampler
 .PHONY: download
 
 # 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; \
@@ -14,6 +14,9 @@ gitsave = @if cd $@ 2>/dev/null; \
 sitemap.xml: tools/mksitemap
        $(call cmdsave,$<)
 
+light.css: base.css
+       $(call cmdsave,perl -pe '\''s!\s*/\*.*\*/\Z!!; s/^\s*//; s/\h+/ /g; s/:\K\h+//;'\'',$<)
+
 data/DerivedAge.txt:
        tools/wget-ifmodified http://www.unicode.org/Public/UNIDATA/$(@F) $@