Blob Blame History Raw
diff -ru noto-emoji-153e1d4c026c124fbac6ee93e559b5df375f24f5.orig/Makefile noto-emoji-153e1d4c026c124fbac6ee93e559b5df375f24f5/Makefile
--- noto-emoji-153e1d4c026c124fbac6ee93e559b5df375f24f5.orig/Makefile	2018-03-07 09:22:49.670696985 +0100
+++ noto-emoji-153e1d4c026c124fbac6ee93e559b5df375f24f5/Makefile	2018-03-07 09:23:06.824506178 +0100
@@ -15,10 +15,9 @@
 EMOJI = NotoColorEmoji
 font: $(EMOJI).ttf
 
-CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
+CFLAGS = $(OPT_CFLAGS) `pkg-config --cflags --libs cairo`
 LDFLAGS = -lm `pkg-config --libs cairo`
-PNGQUANTDIR := third_party/pngquant
-PNGQUANT := $(PNGQUANTDIR)/pngquant
+PNGQUANT = pngquant
 PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force
 BODY_DIMENSIONS = 136x128
 IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center
@@ -97,6 +96,12 @@
 ALL_COMPRESSED_FILES = $(addprefix $(COMPRESSED_DIR)/, $(ALL_NAMES))
 
 # tool checks
+ifeq (,$(shell which $(PNGQUANT)))
+  ifeq (,$(wildcard $(PNGQUANT)))
+    MISSING_PNGQUANT = fail
+  endif
+endif
+
 ifeq (,$(shell which $(ZOPFLIPNG)))
   ifeq (,$(wildcard $(ZOPFLIPNG)))
     MISSING_ZOPFLI = fail
@@ -126,6 +131,11 @@
 
 compressed: $(ALL_COMPRESSED_FILES)
 
+check_quantization_tool:
+ifdef MISSING_PNGQUANT
+	$(error "$(PNGQUANT) is not available")
+endif
+
 check_compress_tool:
 ifdef MISSING_ZOPFLI
   ifdef MISSING_OPTIPNG
@@ -146,8 +156,7 @@
 $(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):
 	mkdir -p "$@"
 
-$(PNGQUANT):
-	$(MAKE) -C $(PNGQUANTDIR)
+$(PNGQUANT): check_quantization_tool
 
 waveflag: waveflag.c
 	$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
@@ -227,5 +236,5 @@
 .SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \
   $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES)
 
-.PHONY:	clean flags emoji renamed_flags quantized compressed check_compress_tool
+.PHONY:	clean flags emoji renamed_flags quantized compressed check_compress_tool check_quantization_tool
 
noto-emoji-153e1d4c026c124fbac6ee93e559b5df375f24f5/ のみに存在: Makefile.orig