Makefile: don't output on stderr if file not yet checking into git.

And if both aren't checked in, consider them changed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-08-25 11:03:16 +09:30
parent b38b913694
commit 7804d89ef1
1 changed files with 2 additions and 1 deletions

View File

@ -276,7 +276,8 @@ gen_list_of_builtin_plugins.h : plugins/Makefile Makefile
@echo '};' >> $@
# Git doesn't maintain timestamps, so we only regen if git says we should.
CHANGED_FROM_GIT = [ x"`git log $@ | head -n1`" != x"`git log $< | head -n1`" -o x"`git diff $<`" != x"" ]
# If neither is in git, we generate (note: one combines stderr, one discards)
CHANGED_FROM_GIT = [ x"`git log $@ 2>&1 | head -n1`" != x"`git log $< 2>/dev/null | head -n1`" -o x"`git diff $<`" != x"" ]
ifneq ($(TEST_GROUP_COUNT),)
PYTEST_OPTS += --test-group=$(TEST_GROUP) --test-group-count=$(TEST_GROUP_COUNT)