summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-12-31 09:51:43 -0800
committerAlex Xu <alex_y_xu@yahoo.ca>2013-12-31 09:51:43 -0800
commit7ee7422bf7b347320179b0c370c2ddee7519b05b (patch)
treef1fb4bc874546771172ac8ab0fd568e6ca947658 /Makefile
parent68efde1b5d94cbf0b994f5922fa4fc81d2d3cc95 (diff)
downloadhtml5ks-7ee7422bf7b347320179b0c370c2ddee7519b05b.tar.xz
html5ks-7ee7422bf7b347320179b0c370c2ddee7519b05b.zip
Stuff.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 24 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2d29b9d..0dc41b6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,15 @@
+null :=
+SPACE := $(null) $(null)
+
FFMPEG ?= ffmpeg
FFMPEG += -v warning $(FFMPEGFLAGS)
OPUSENC ?= opusenc
ZOPFLIPNG ?= zopflipng
JPEGOPTIM ?= jpegoptim
CWEBP ?= cwebp
+WEBPMUX ?= webpmux
CONVERT ?= convert
+APNGASM ?= apngasm
DUMP ?= www/dump
@@ -53,8 +58,12 @@ PNG := $(shell find $(DUMP) -name '*.png')
JPG := $(shell find $(DUMP) -name '*.jpg')
WEBP := $(patsubst %.png,%.webp,$(PNG)) \
$(patsubst %.jpg,%.webp,$(JPG))
+CTC_ANIM_SRC := $(DUMP)/ui/ctc_strip.png
+CTC_ANIM_TMP := $(DUMP)/ui/ctc_strip-0.png $(DUMP)/ui/ctc_strip-1.png $(DUMP)/ui/ctc_strip-2.png $(DUMP)/ui/ctc_strip-3.png $(DUMP)/ui/ctc_strip-4.png $(DUMP)/ui/ctc_strip-5.png $(DUMP)/ui/ctc_strip-6.png $(DUMP)/ui/ctc_strip-7.png $(DUMP)/ui/ctc_strip-8.png $(DUMP)/ui/ctc_strip-9.png $(DUMP)/ui/ctc_strip-10.png $(DUMP)/ui/ctc_strip-11.png $(DUMP)/ui/ctc_strip-12.png $(DUMP)/ui/ctc_strip-13.png $(DUMP)/ui/ctc_strip-14.png $(DUMP)/ui/ctc_strip-15.png $(DUMP)/ui/ctc_strip-16.png $(DUMP)/ui/ctc_strip-17.png $(DUMP)/ui/ctc_strip-18.png $(DUMP)/ui/ctc_strip-19.png $(DUMP)/ui/ctc_strip-20.png $(DUMP)/ui/ctc_strip-21.png $(DUMP)/ui/ctc_strip-22.png $(DUMP)/ui/ctc_strip-23.png $(DUMP)/ui/ctc_strip-24.png $(DUMP)/ui/ctc_strip-25.png $(DUMP)/ui/ctc_strip-26.png $(DUMP)/ui/ctc_strip-27.png $(DUMP)/ui/ctc_strip-28.png $(DUMP)/ui/ctc_strip-29.png $(DUMP)/ui/ctc_strip-30.png $(DUMP)/ui/ctc_strip-31.png $(DUMP)/ui/ctc_strip-32.png $(DUMP)/ui/ctc_strip-33.png $(DUMP)/ui/ctc_strip-34.png $(DUMP)/ui/ctc_strip-35.png $(DUMP)/ui/ctc_strip-36.png $(DUMP)/ui/ctc_strip-37.png $(DUMP)/ui/ctc_strip-38.png $(DUMP)/ui/ctc_strip-39.png $(DUMP)/ui/ctc_strip-40.png $(DUMP)/ui/ctc_strip-41.png $(DUMP)/ui/ctc_strip-42.png $(DUMP)/ui/ctc_strip-43.png $(DUMP)/ui/ctc_strip-44.png $(DUMP)/ui/ctc_strip-45.png $(DUMP)/ui/ctc_strip-46.png $(DUMP)/ui/ctc_strip-47.png $(DUMP)/ui/ctc_strip-48.png $(DUMP)/ui/ctc_strip-49.png $(DUMP)/ui/ctc_strip-50.png $(DUMP)/ui/ctc_strip-51.png $(DUMP)/ui/ctc_strip-52.png $(DUMP)/ui/ctc_strip-53.png $(DUMP)/ui/ctc_strip-54.png $(DUMP)/ui/ctc_strip-55.png $(DUMP)/ui/ctc_strip-56.png $(DUMP)/ui/ctc_strip-57.png $(DUMP)/ui/ctc_strip-58.png $(DUMP)/ui/ctc_strip-59.png $(DUMP)/ui/ctc_strip-60.png $(DUMP)/ui/ctc_strip-61.png $(DUMP)/ui/ctc_strip-62.png $(DUMP)/ui/ctc_strip-63.png
+CTC_ANIM_TMP_WEBP := $(patsubst %.png,%.webp,$(CTC_ANIM_TMP))
+CTC_ANIM := $(DUMP)/ui/ctc_anim.png $(DUMP)/ui/ctc_anim.webp
-images: $(WEBP) favicon.ico
+images: $(WEBP) $(CTC_ANIM) www/favicon.ico
%.webp: %.png
$(ZOPFLIPNG) -m -y $< $<
@@ -64,10 +73,22 @@ images: $(WEBP) favicon.ico
$(JPEGOPTIM) --strip-all $<
$(CWEBP) -q 90 -m 6 $< -o $@
-www/favicon.ico: www/dump/ui/icon.png
+www/favicon.ico: $(DUMP)/ui/icon.png
$(CONVERT) $< -resize 256x256 -transparent white $@
+$(DUMP)/ui/ctc_strip-0.png: $(CTC_ANIM_SRC)
+ $(CONVERT) $< -crop 16x16 $(patsubst %.png,%*.png,$<)
+
+$(DUMP)/ui/ctc_strip-%.png: $(CTC_ANIM_SRC) $(DUMP)/ui/ctc_strip-0.png
+ @touch $@
+
+$(DUMP)/ui/ctc_anim.png: $(CTC_ANIM_TMP)
+ $(APNGASM) $@ $^ 3 100
+
+$(DUMP)/ui/ctc_anim.webp: $(CTC_ANIM_TMP_WEBP)
+ $(WEBPMUX) -frame $(subst $(SPACE), +30 -frame ,$^) +0 -loop 0 -o $@
+
clean:
- $(RM) $(CVIDEO) $(CAUDIO) $(WEBP)
+ $(RM) $(CVIDEO) $(CAUDIO) $(WEBP) www/favicon.ico
.PHONY: video audio images clean