Makefile: Remove gen_version.h from ALL_GEN_HEADERS.

This prevents recompiling everything when you are changing just a doc, or
touching only one file among hundreds of sources, just because the
`gen_version.h` is changed, especially since only one source actually
depends on that header.
This commit is contained in:
ZmnSCPxj jxPCSnmZ 2020-08-05 22:26:16 +08:00 committed by Rusty Russell
parent a5fc66c382
commit 6fadd5aea2
3 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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)

View file

@ -1,7 +1,9 @@
#include "gen_version.h"
#include "version.h"
#include <stdio.h>
/* Only common/version.c can safely include this. */
# include "gen_version.h"
const char *version(void)
{
return VERSION;