2014-07-09 07:20:14 +00:00
|
|
|
# Copyright 2014 Google Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2014-08-13 02:28:00 +00:00
|
|
|
|
2014-07-10 04:04:19 +00:00
|
|
|
EMOJI = NotoColorEmoji
|
2014-08-13 02:28:00 +00:00
|
|
|
font: $(EMOJI).ttf
|
|
|
|
|
|
|
|
CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
|
|
|
|
LDFLAGS = `pkg-config --libs cairo`
|
2015-06-19 16:34:08 +00:00
|
|
|
PNGQUANTDIR := $(abspath `pwd`/../third_party/pngquant)
|
2014-09-18 02:31:16 +00:00
|
|
|
PNGQUANT := $(PNGQUANTDIR)/pngquant
|
|
|
|
PNGQUANTFLAGS = --speed 1 --skip-if-larger --ext '.png' --force
|
|
|
|
|
2015-06-24 09:31:51 +00:00
|
|
|
"$(PNGQUANT)":
|
|
|
|
cd "$(PNGQUANTDIR)" && make
|
2014-08-13 02:28:00 +00:00
|
|
|
|
|
|
|
waveflag: waveflag.c
|
|
|
|
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)
|
|
|
|
|
2014-08-14 19:02:14 +00:00
|
|
|
LIMITED_FLAGS = CN DE ES FR GB IT JP KR RU US
|
2014-08-13 02:28:00 +00:00
|
|
|
FLAGS = AD AE AF AG AI AL AM AO AR AS AT AU AW AX AZ \
|
|
|
|
BA BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BW BY BZ \
|
|
|
|
CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ \
|
|
|
|
DE DJ DK DM DO DZ \
|
|
|
|
EC EE EG ER ES ET EU \
|
|
|
|
FI FJ FM FO FR \
|
|
|
|
GA GB GD GE GG GH GI GL GM GN GQ GR GT GU GW GY \
|
|
|
|
HK HN HR HT HU \
|
|
|
|
ID IE IL IM IN IO IQ IR IS IT \
|
|
|
|
JE JM JO JP \
|
|
|
|
KE KG KH KI KM KN KP KR KW KY KZ \
|
|
|
|
LA LB LC LI LK LR LS LT LU LV LY \
|
|
|
|
MA MC MD ME MG MH MK ML MM MN MO MP MR MS MT MU MV MW MX MY MZ \
|
|
|
|
NA NE NF NG NI NL NO NP NR NU NZ \
|
|
|
|
OM \
|
|
|
|
PA PE PF PG PH PK PL PN PR PS PT PW PY \
|
|
|
|
QA \
|
|
|
|
RO RS RU RW \
|
|
|
|
SA SB SC SD SE SG SI SK SL SM SN SO SR SS ST SV SX SY SZ \
|
|
|
|
TC TD TG TH TJ TK TL TM TN TO TR TT TV TW TZ \
|
|
|
|
UA UG US UY UZ \
|
|
|
|
VA VC VE VG VI VN VU \
|
|
|
|
WS \
|
|
|
|
YE \
|
|
|
|
ZA ZM ZW
|
|
|
|
|
2015-06-19 16:34:08 +00:00
|
|
|
FLAGS_SRC_DIR = third_party/region-flags/png
|
2014-08-13 02:28:00 +00:00
|
|
|
FLAGS_DIR = ./flags
|
|
|
|
|
2015-06-19 22:59:00 +00:00
|
|
|
GLYPH_NAMES := $(shell ./flag_glyph_name.py $(FLAGS))
|
2014-08-13 02:28:00 +00:00
|
|
|
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
|
2015-06-19 22:59:00 +00:00
|
|
|
PNG128_FLAGS := $(foreach glyph_name,$(GLYPH_NAMES),$(addprefix ./png/128/emoji_$(glyph_name),.png))
|
2014-08-13 02:28:00 +00:00
|
|
|
|
2015-06-24 09:31:51 +00:00
|
|
|
$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag "$(PNGQUANT)"
|
2014-08-13 02:28:00 +00:00
|
|
|
mkdir -p $(FLAGS_DIR)
|
|
|
|
./waveflag "$<" "$@"
|
|
|
|
optipng -quiet -o7 "$@"
|
2015-06-24 09:31:51 +00:00
|
|
|
"$(PNGQUANT)" $(PNGQUANTFLAGS) "$@"
|
2014-08-13 02:28:00 +00:00
|
|
|
|
|
|
|
flag-symlinks: $(WAVED_FLAGS)
|
2015-06-22 01:32:08 +00:00
|
|
|
$(subst ^, , \
|
|
|
|
$(join \
|
|
|
|
$(FLAGS:%=ln^-fs^../../flags/%.png^), \
|
|
|
|
$(GLYPH_NAMES:%=./png/128/emoji_%.png;) \
|
|
|
|
) \
|
|
|
|
)
|
2014-08-13 02:28:00 +00:00
|
|
|
|
|
|
|
$(PNG128_FLAGS): flag-symlinks
|
|
|
|
|
2014-07-10 04:04:19 +00:00
|
|
|
EMOJI_PNG128 = ./png/128/emoji_u
|
2014-07-09 07:20:14 +00:00
|
|
|
|
2015-06-19 16:34:08 +00:00
|
|
|
EMOJI_BUILDER = third_party/color_emoji/emoji_builder.py
|
|
|
|
ADD_GLYPHS = third_party/color_emoji/add_glyphs.py
|
|
|
|
PUA_ADDER = map_pua_emoji.py
|
2014-07-09 07:20:14 +00:00
|
|
|
|
2014-08-13 02:28:00 +00:00
|
|
|
%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(UNI) flag-symlinks
|
2014-07-10 04:04:19 +00:00
|
|
|
python $(ADD_GLYPHS) "$<" "$@" "$(EMOJI_PNG128)"
|
2014-07-09 07:20:14 +00:00
|
|
|
|
|
|
|
%.ttf: %.ttx
|
|
|
|
@rm -f "$@"
|
|
|
|
ttx "$<"
|
|
|
|
|
2014-09-18 02:31:16 +00:00
|
|
|
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) $(EMOJI_PNG128)*.png flag-symlinks
|
|
|
|
python $(EMOJI_BUILDER) -V $< "$@" $(EMOJI_PNG128)
|
2014-07-10 06:24:42 +00:00
|
|
|
python $(PUA_ADDER) "$@" "$@-with-pua"
|
|
|
|
mv "$@-with-pua" "$@"
|
2014-07-09 07:20:14 +00:00
|
|
|
|
|
|
|
clean:
|
2014-07-10 04:04:19 +00:00
|
|
|
rm -f $(EMOJI).ttf $(EMOJI).tmpl.ttf $(EMOJI).tmpl.ttx
|
2014-08-13 02:28:00 +00:00
|
|
|
rm -f waveflag
|
|
|
|
rm -rf $(FLAGS_DIR)
|
|
|
|
rm -f `find -type l -name "*.png"`
|