diff -ru noto-emoji-ff566b2c16f9332dc54e1b538e2bce2d213c0e3d.orig/Makefile noto-emoji-ff566b2c16f9332dc54e1b538e2bce2d213c0e3d/Makefile --- noto-emoji-ff566b2c16f9332dc54e1b538e2bce2d213c0e3d.orig/Makefile 2017-04-25 22:02:45.000000000 +0200 +++ noto-emoji-ff566b2c16f9332dc54e1b538e2bce2d213c0e3d/Makefile 2017-04-26 09:55:23.736788590 +0200 @@ -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 IMOPS = -size 136x128 canvas:none -compose copy -gravity center @@ -96,6 +95,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 @@ -125,6 +130,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 @@ -145,8 +155,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) @@ -226,5 +235,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