aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-21 10:57:36 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-11-21 10:57:36 +0900
commit97a5af62a318fcd93a4e5e4428d576c0280ddbae (patch)
tree69e94bfba6c05dd1c29794d10f0a80cca7c8ec46
parenta9d4f2d03c847ec1c89dc03a5076a9fa29ffa61f (diff)
downloadruby-97a5af62a318fcd93a4e5e4428d576c0280ddbae.tar.gz
Skip updating revision.h when the revision is unchanged
note: GNU make only.
-rw-r--r--defs/gmake.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/defs/gmake.mk b/defs/gmake.mk
index cecc2122af..0a60a83c14 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -291,9 +291,13 @@ $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: \
$(UNICODE_FILES) $(UNICODE_PROPERTY_FILES)
endif
+REVISION_IN_HEADER := $(shell sed -n 's/^\#define RUBY_FULL_REVISION "\(.*\)"/\1/p' $(srcdir)/revision.h)
+REVISION_LATEST := $(shell git -C $(srcdir) log -1 --format=%H)
+ifneq ($(REVISION_IN_HEADER),$(REVISION_LATEST))
# GNU make treat the target as unmodified when its dependents get
# updated but it is not updated, while others may not.
$(srcdir)/revision.h: $(REVISION_H)
+endif
# Query on the generated rdoc
#