From 6f4c832e1f581addb9590535266a4b78999345ae Mon Sep 17 00:00:00 2001
From: Alex Xu <alex_y_xu@yahoo.ca>
Date: Wed, 5 Mar 2014 18:41:35 -0500
Subject: adjust makefile

---
 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 14372c2..cb7c1ec 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ SPACE := $(null) $(null)
 FFMPEG ?= ffmpeg
 FFMPEG += -v warning -y
 CWEBP ?= cwebp
-CWEBP += -quiet -alpha_cleanup
+CWEBP += -quiet -alpha_cleanup -m 6
 WEBPMUX ?= webpmux
 CONVERT ?= convert
 APNGASM ?= apngasm
@@ -107,6 +107,7 @@ images: $(CIMAGE)
 $(DUMP)/ui/ctc_strip.webp: $(DUMP)/ui/ctc_strip.png
 
 define png2webp =
+	$(CWEBP) -q 99 "$<" -o "$@"
 	$(PNGQUANT) --force --speed 1 --ext .png "$<"
 ifdef ZOPFLIPNG
 	$(ZOPFLIPNG) -m -y "$<" "$<"
@@ -121,11 +122,10 @@ endif
 endef
 
 %.webp: %.png
-	$(CWEBP) -q 99 -m 6 "$<" -o "$@"
 	$(png2webp)
 
 %.webp: %.jpg
-	$(CWEBP) -q 90 -m 6 "$<" -o "$@"
+	$(CWEBP) -q 90 "$<" -o "$@"
 
 www/favicon.ico: $(DUMP)/ui/icon.png
 	$(CONVERT) "$<" -resize 256x256 -transparent white "$@"
@@ -140,7 +140,8 @@ $(DUMP)/ui/ctc_strip-0.png: $(CTC_ANIM_SRC)
 $(DUMP)/ui/ctc_strip-%.png: $(CTC_ANIM_SRC) $(DUMP)/ui/ctc_strip-0.png
 	@
 
-$(DUMP)/ui/ctc_anim.png: $(CTC_ANIM_TMP)
+# depend on webp to wait for recompression
+$(DUMP)/ui/ctc_anim.png: $(CTC_ANIM_TMP_WEBP)
 	$(APNGASM) "$@" $^ 3 100
 
 $(DUMP)/ui/ctc_anim.webp: $(CTC_ANIM_TMP_WEBP)
-- 
cgit v1.2.3-70-g09d2