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`
|
2014-09-18 02:31:16 +00:00
|
|
|
PNGQUANTDIR := $(abspath `pwd`/../../third_party/pngquant)
|
|
|
|
PNGQUANT := $(PNGQUANTDIR)/pngquant
|
|
|
|
PNGQUANTFLAGS = --speed 1 --skip-if-larger --ext '.png' --force
|
|
|
|
|
|
|
|
$(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
|
|
|
|
|
|
|
|
FLAGS_SRC_DIR = ../third_party/region-flags/png
|
|
|
|
FLAGS_DIR = ./flags
|
|
|
|
|
2014-09-15 00:04:18 +00:00
|
|
|
glyph_name = $(shell ./flag_glyph_name.py $(flag))
|
2014-08-13 02:28:00 +00:00
|
|
|
|
|
|
|
WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png)
|
2014-09-15 00:04:18 +00:00
|
|
|
PNG128_FLAGS := $(foreach flag,$(FLAGS),$(addprefix ./png/128/emoji_$(glyph_name),.png))
|
2014-08-13 02:28:00 +00:00
|
|
|
|
2014-09-18 02:31:16 +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 "$@"
|
2014-09-18 02:31:16 +00:00
|
|
|
$(PNGQUANT) $(PNGQUANTFLAGS) "$@"
|
2014-08-13 02:28:00 +00:00
|
|
|
|
|
|
|
flag-symlinks: $(WAVED_FLAGS)
|
2014-09-15 00:04:18 +00:00
|
|
|
$(foreach flag,$(FLAGS),ln -fs ../../flags/$(flag).png ./png/128/emoji_$(glyph_name).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
|
|
|
|
|
|
|
EMOJI_BUILDER = ../third_party/color_emoji/emoji_builder.py
|
2014-08-13 02:28:00 +00:00
|
|
|
ADD_GLYPHS = ../third_party/color_emoji/add_glyphs.py
|
2014-07-10 06:24:42 +00:00
|
|
|
PUA_ADDER = ../nototools/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"`
|