Extract only one revision in header [ci skip]

Both of `$(srcdir)/revision.h` and `revision.h` exist because they are
the same file when in-place build.
This commit is contained in:
Nobuyoshi Nakada 2023-01-05 15:13:10 +09:00
parent b496578758
commit ee6e4d63df
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -396,7 +396,7 @@ REVISION_LATEST := $(shell $(CHDIR) $(srcdir) && $(GIT) log -1 --format=%H 2>/de
else
REVISION_LATEST := update
endif
REVISION_IN_HEADER := $(shell sed -n 's/^\#define RUBY_FULL_REVISION "\(.*\)"/\1/p' $(wildcard $(srcdir)/revision.h revision.h) /dev/null 2>/dev/null)
REVISION_IN_HEADER := $(shell sed '/^\#define RUBY_FULL_REVISION "\(.*\)"/!d;s//\1/;q' $(wildcard $(srcdir)/revision.h revision.h) /dev/null 2>/dev/null)
ifeq ($(REVISION_IN_HEADER),)
REVISION_IN_HEADER := none
endif