summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.mk4
-rw-r--r--defs/gmake.mk7
2 files changed, 9 insertions, 2 deletions
diff --git a/common.mk b/common.mk
index dd7b757ded..ab02ca925a 100644
--- a/common.mk
+++ b/common.mk
@@ -1371,12 +1371,14 @@ touch-unicode-files:
$(MAKEDIRS) $(UNICODE_SRC_DATA_DIR)
touch $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time $(UNICODE_DATA_HEADERS)
+UNICODE_TABLES_TIMESTAMP = yes
$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
$(srcdir)/template/unicode_norm_gen.tmpl \
$(ALWAYS_UPDATE_UNICODE:yes=update-unicode)
$(Q) $(MAKE) $(@D)
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
- -c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
+ -c $(UNICODE_TABLES_TIMESTAMP:yes=-t$@) \
+ -o $(srcdir)/lib/unicode_normalize/tables.rb \
-I $(srcdir) \
$(srcdir)/template/unicode_norm_gen.tmpl \
$(UNICODE_DATA_DIR) lib/unicode_normalize
diff --git a/defs/gmake.mk b/defs/gmake.mk
index eb9e35a446..496c5fe1fa 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -185,8 +185,13 @@ $(MJIT_MIN_HEADER): $(mjit_min_headers) $(PREP)
endif
-ifneq ($(wildcard $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)),)
+ifeq ($(if $(wildcard $(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)),,\
+ $(wildcard $(srcdir)/lib/unicode_normalize/tables.rb)),)
+# Needs the dependency when any Unicode data file exists, or
+# normalization tables script doesn't. Otherwise, when the target
+# only exists, use it as-is.
.PHONY: $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time
+UNICODE_TABLES_TIMESTAMP =
$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: \
$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
endif