From 7804d89ef17a16fe98e7bab59c45c3ec11e104a4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 25 Aug 2020 11:03:16 +0930 Subject: [PATCH] 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 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d4b61521c..2892c7454 100644 --- a/Makefile +++ b/Makefile @@ -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)