diff --git a/Makefile b/Makefile index a396fbf5f..b5a3eda67 100644 --- a/Makefile +++ b/Makefile @@ -196,8 +196,6 @@ CCAN_HEADERS := \ $(CCANDIR)/ccan/typesafe_cb/typesafe_cb.h \ $(CCANDIR)/ccan/utf8/utf8.h -ALL_GEN_HEADERS += gen_version.h - CDUMP_OBJS := ccan-cdump.o ccan-strmap.o BOLT_GEN := tools/generate-wire.py diff --git a/common/Makefile b/common/Makefile index bcce39002..c56be7466 100644 --- a/common/Makefile +++ b/common/Makefile @@ -96,6 +96,9 @@ COMMON_OBJS := $(COMMON_SRC:.c=.o) # Common objects depends on bitcoin/ external/ and ccan $(COMMON_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(EXTERNAL_HEADERS) $(COMMON_HEADERS_GEN) +# Only common/version.c can include this header. +common/version.o: gen_version.h + ALL_GEN_HEADERS += $(COMMON_HEADERS_GEN) ALL_OBJS += $(COMMON_OBJS) diff --git a/common/version.c b/common/version.c index 0bc7772ef..ea6aef255 100644 --- a/common/version.c +++ b/common/version.c @@ -1,7 +1,9 @@ -#include "gen_version.h" #include "version.h" #include +/* Only common/version.c can safely include this. */ +# include "gen_version.h" + const char *version(void) { return VERSION;