Makefiles: remove redundant dependencies, and have objects depend on their Makefile.

1. $(JSMN_OBJS) is not set anywhere.
2. You don't need to depend on CCAN_HEADERS, COMMON_HEADERS or JSMN_HEADERS: the top level Makefile has all object depedning on it.
3. Similarly, CCAN_OBJS.
4. Every object file should be rebuilt if its Makefile changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-10-22 19:44:26 +10:30
parent e120f87083
commit 65d997842e
8 changed files with 33 additions and 36 deletions

View File

@@ -138,12 +138,12 @@ check-common-files:
check-source: check-common-files
# 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: version_gen.h
# Rebuild objects should this file change.
$(COMMON_OBJS): common/Makefile
# We make a static library, this way linker can discard unused parts.
libcommon.a: $(COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS)
@$(call VERBOSE, "ar $@", $(AR) r $@ $?)