Merge pull request #248 from dougfelt/pngquant_update
Depend on installed pngquant, not our copypull/249/head
commit
6a609ec2eb
12
Makefile
12
Makefile
|
@ -17,8 +17,8 @@ font: $(EMOJI).ttf
|
||||||
|
|
||||||
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
||||||
LDFLAGS = -lm `pkg-config --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
|
PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force
|
||||||
BODY_DIMENSIONS = 136x128
|
BODY_DIMENSIONS = 136x128
|
||||||
IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center
|
IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center
|
||||||
|
@ -150,8 +150,6 @@ endif
|
||||||
$(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):
|
$(EMOJI_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):
|
||||||
mkdir -p "$@"
|
mkdir -p "$@"
|
||||||
|
|
||||||
$(PNGQUANT):
|
|
||||||
$(MAKE) -C $(PNGQUANTDIR)
|
|
||||||
|
|
||||||
waveflag: waveflag.c
|
waveflag: waveflag.c
|
||||||
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
||||||
|
@ -169,7 +167,7 @@ waveflag: waveflag.c
|
||||||
$(EMOJI_DIR)/%.png: $(EMOJI_SRC_DIR)/%.png | $(EMOJI_DIR)
|
$(EMOJI_DIR)/%.png: $(EMOJI_SRC_DIR)/%.png | $(EMOJI_DIR)
|
||||||
@convert $(IMOPS) "$<" -composite "PNG32:$@"
|
@convert $(IMOPS) "$<" -composite "PNG32:$@"
|
||||||
|
|
||||||
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag $(PNGQUANT) | $(FLAGS_DIR)
|
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag | $(FLAGS_DIR)
|
||||||
@./waveflag $(FLAGS_DIR)/ "$<"
|
@./waveflag $(FLAGS_DIR)/ "$<"
|
||||||
|
|
||||||
$(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR)
|
$(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR)
|
||||||
|
@ -185,10 +183,10 @@ flag-symlinks: $(RESIZED_FLAG_FILES) | $(RENAMED_FLAGS_DIR)
|
||||||
|
|
||||||
$(RENAMED_FLAG_FILES): | flag-symlinks
|
$(RENAMED_FLAG_FILES): | flag-symlinks
|
||||||
|
|
||||||
$(QUANTIZED_DIR)/%.png: $(RENAMED_FLAGS_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
|
$(QUANTIZED_DIR)/%.png: $(RENAMED_FLAGS_DIR)/%.png | $(QUANTIZED_DIR)
|
||||||
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<"; cp $< $@;; *) exit "$$?";; esac)
|
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<"; cp $< $@;; *) exit "$$?";; esac)
|
||||||
|
|
||||||
$(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
|
$(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png | $(QUANTIZED_DIR)
|
||||||
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<";cp $< $@;; *) exit "$$?";; esac)
|
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<";cp $< $@;; *) exit "$$?";; esac)
|
||||||
|
|
||||||
$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_compress_tool $(COMPRESSED_DIR)
|
$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_compress_tool $(COMPRESSED_DIR)
|
||||||
|
|
Loading…
Reference in New Issue