From cee85f422b06577c9dbcce24f43618eb9e52b39f Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 20 Jun 2015 00:59:00 +0200 Subject: [PATCH] Speed up make by calling flag_glyph_name.py once This script takes ~1 second for startup, so calling it repeatedly for each flag slows the Makefile considerably, and unnecessarily since it can be called for all the flags at once. Now make clean takes about 1.2s, instead of 3m45s. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 94dae55e1..3c110bd1c 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,9 @@ FLAGS_DIR = ./flags glyph_name = $(shell ./flag_glyph_name.py $(flag)) +GLYPH_NAMES := $(shell ./flag_glyph_name.py $(FLAGS)) WAVED_FLAGS := $(foreach flag,$(FLAGS),$(FLAGS_DIR)/$(flag).png) -PNG128_FLAGS := $(foreach flag,$(FLAGS),$(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) mkdir -p $(FLAGS_DIR)