From 9a46592dc6de6c201ecc8df284e40f779bd22274 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 15 Mar 2014 15:18:53 -0400 Subject: [PATCH] support minifying css files too --- Makefile | 14 ++++++++++++-- makedist.sh | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 70ee24a..5e88047 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ CLOSURE = closure-compiler --language_in ECMASCRIPT5 +YUICOMPRESSOR = yuicompressor all: @@ -8,6 +9,15 @@ all: JS_FILES = $(shell grep '[.]js$$' manifest.files) js-min: $(JS_FILES:=.min) -check: js-min +%.css.min: %.css + $(YUICOMPRESSOR) $< > $@ -.PHONY: all clean check js-min +CSS_FILES = $(shell grep '[.]css$$' manifest.files) +css-min: $(CSS_FILES:=.min) + +check: css-min js-min + +dist: + ./makedist.sh + +.PHONY: all clean check css-min dist js-min diff --git a/makedist.sh b/makedist.sh index 661f9f7..482baf8 100755 --- a/makedist.sh +++ b/makedist.sh @@ -32,10 +32,10 @@ while read line ; do done < <(sed 's:#.*::' manifest.files) cp Makefile manifest.files manifest.json "${P}/" -make -C "${P}" -j js-min +make -C "${P}" -j {css,js}-min while read line ; do mv "${line}.min" "${line}" -done < <(find "${P}" -name '*.js') +done < <(find "${P}" -name '*.js' -o -name '*.css') rm "${P}"/{manifest.files,Makefile} sed -i \ @@ -43,6 +43,7 @@ sed -i \ "${P}/manifest.json" zip="${P}.zip" +rm -f "${zip}" zip -r "${zip}" "${P}" rm -rf "${P}" du -b "${zip}" -- 2.39.5