Merge pull request #22 from dougfelt/master
Change Makefile to be smarter about dependencies.pull/28/head
commit
a258889451
19
Makefile
19
Makefile
|
@ -18,12 +18,12 @@ font: $(EMOJI).ttf
|
||||||
|
|
||||||
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
||||||
LDFLAGS = `pkg-config --libs cairo`
|
LDFLAGS = `pkg-config --libs cairo`
|
||||||
PNGQUANTDIR := $(abspath `pwd`/../third_party/pngquant)
|
PNGQUANTDIR := third_party/pngquant
|
||||||
PNGQUANT := $(PNGQUANTDIR)/pngquant
|
PNGQUANT := $(PNGQUANTDIR)/pngquant
|
||||||
PNGQUANTFLAGS = --speed 1 --skip-if-larger --ext '.png' --force
|
PNGQUANTFLAGS = --speed 1 --skip-if-larger --ext '.png' --force
|
||||||
|
|
||||||
"$(PNGQUANT)":
|
$(PNGQUANT):
|
||||||
cd "$(PNGQUANTDIR)" && make
|
$(MAKE) -C $(PNGQUANTDIR)
|
||||||
|
|
||||||
waveflag: waveflag.c
|
waveflag: waveflag.c
|
||||||
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
||||||
|
@ -62,11 +62,11 @@ GLYPH_NAMES := $(shell ./flag_glyph_name.py $(FLAGS))
|
||||||
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
|
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
|
||||||
PNG128_FLAGS := $(foreach glyph_name,$(GLYPH_NAMES),$(addprefix ./png/128/emoji_$(glyph_name),.png))
|
PNG128_FLAGS := $(foreach glyph_name,$(GLYPH_NAMES),$(addprefix ./png/128/emoji_$(glyph_name),.png))
|
||||||
|
|
||||||
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag "$(PNGQUANT)"
|
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag $(PNGQUANT)
|
||||||
mkdir -p $(FLAGS_DIR)
|
mkdir -p $(FLAGS_DIR)
|
||||||
./waveflag "$<" "$@"
|
./waveflag "$<" "$@"
|
||||||
optipng -quiet -o7 "$@"
|
optipng -quiet -o7 "$@"
|
||||||
"$(PNGQUANT)" $(PNGQUANTFLAGS) "$@"
|
$(PNGQUANT) $(PNGQUANTFLAGS) "$@"
|
||||||
|
|
||||||
flag-symlinks: $(WAVED_FLAGS)
|
flag-symlinks: $(WAVED_FLAGS)
|
||||||
$(subst ^, , \
|
$(subst ^, , \
|
||||||
|
@ -84,16 +84,19 @@ EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py
|
||||||
ADD_GLYPHS = third_party/color_emoji/add_glyphs.py
|
ADD_GLYPHS = third_party/color_emoji/add_glyphs.py
|
||||||
PUA_ADDER = map_pua_emoji.py
|
PUA_ADDER = map_pua_emoji.py
|
||||||
VS_ADDER = add_vs_cmap.py
|
VS_ADDER = add_vs_cmap.py
|
||||||
|
ifeq (, $(shell which $(VS_ADDER)))
|
||||||
|
$(error "$(VS_ADDER) not in path, run setup.py in nototools")
|
||||||
|
endif
|
||||||
|
|
||||||
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI) flag-symlinks
|
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI) $(PNG128_FLAGS)
|
||||||
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"
|
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"
|
||||||
|
|
||||||
%.ttf: %.ttx
|
%.ttf: %.ttx
|
||||||
@rm -f "$@"
|
@rm -f "$@"
|
||||||
ttx "$<"
|
ttx "$<"
|
||||||
|
|
||||||
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) $(VS_ADDER) \
|
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \
|
||||||
$(EMOJI_PNG128)*.png flag-symlinks
|
$(EMOJI_PNG128)*.png $(PNG128_FLAGS)
|
||||||
python $(EMOJI_BUILDER) -V $< "$@" $(EMOJI_PNG128)
|
python $(EMOJI_BUILDER) -V $< "$@" $(EMOJI_PNG128)
|
||||||
python $(PUA_ADDER) "$@" "$@-with-pua"
|
python $(PUA_ADDER) "$@" "$@-with-pua"
|
||||||
$(VS_ADDER) --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
|
$(VS_ADDER) --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
|
||||||
|
|
Loading…
Reference in New Issue