Makefile: mark more things as intermediaries.
What changed, and why it matters
This commit only changes build-system instructions (Makefiles). It tells the build process that certain temporary files (intermediate build artifacts like generated source files and compiled library objects) can be deleted automatically after they are no longer needed, so they don't have to be bundled in release packages. There is no change to the actual Lightning node software, its networking, cryptography, or wallet logic, and no security-relevant behavior is introduced or fixed.
No security action required; review as normal build-system cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies Makefiles to replace a .PRECIOUS directive with .INTERMEDIATE directives for generated headers/sources, CCAN objects, JSMN object, libwally/libsecp256k1 build artifacts, and wire-generated files. This is a packaging/build-hygiene change: .INTERMEDIATE allows make to remove these files after downstream targets are built, reducing what ships in source/binary distributions. No code semantics change.
Changed components
Makefileexternal/Makefilewire/MakefileInspect captured patch +12 / −5
diff --git a/Makefile b/Makefile
index 87e8f32a..c18f4838 100644
--- a/Makefile
+++ b/Makefile
@@ -482,10 +482,6 @@ mkdocs.yml: $(MANPAGES:=.md)
)
-
-# Don't delete these intermediaries.
-.PRECIOUS: $(ALL_GEN_HEADERS) $(ALL_GEN_SOURCES) $(PYTHON_GENERATED)
-
# Every single object file.
ALL_OBJS := $(ALL_C_SOURCES:.c=.o)
@@ -744,6 +740,9 @@ endif
header_versions_gen.h: tools/headerversions $(FORCE)
@tools/headerversions $@
+# Once you have libccan.a, you don't need these.
+.INTERMEDIATE: $(CCAN_OBJS)
+
# We make a static library, this way linker can discard unused parts.
libccan.a: $(CCAN_OBJS)
@$(call VERBOSE, "ar $@", $(AR) r $@ $(CCAN_OBJS))
diff --git a/external/Makefile b/external/Makefile
index 5c9eb856..4ff22053 100644
--- a/external/Makefile
+++ b/external/Makefile
@@ -62,6 +62,8 @@ ifeq ($(DEBUGBUILD),1)
WALLY_OPTS=--enable-debug
endif
+.INTERMEDIATE: $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.la $(TARGET_DIR)/libwally-core-build/src/libwallycore.la
+
$(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS)
cd external/libwally-core && ./tools/autogen.sh
mkdir -p ${TARGET_DIR}/libwally-core-build
@@ -87,6 +89,8 @@ $(TARGET_DIR)/jsmn-build/jsmn.o: external/jsmn/jsmn.c Makefile
$(TARGET_DIR)/libjsmn.a: $(TARGET_DIR)/jsmn-build/jsmn.o
$(AR) rc $@ $<
+.INTERMEDIATE: $(TARGET_DIR)/jsmn-build/jsmn.o
+
# Need separate build dir: changes inside submodule make git think it's dirty.
$(TARGET_DIR)/libbacktrace.a: external/libbacktrace/backtrace.h
mkdir -p $(TARGET_DIR)/libbacktrace-build
diff --git a/wire/Makefile b/wire/Makefile
index 6d10c3e6..e52e1f16 100644
--- a/wire/Makefile
+++ b/wire/Makefile
@@ -106,7 +106,11 @@ wire/channel_type_wiregen.h_args := -s
wire/channel_type_wiregen.c_args := $(wire/channel_type_wiregen.h_args)
# All generated wire/ files depend on this Makefile
-$(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(WIRE_SRC) $(WIRE_HEADERS)): wire/Makefile
+WIRE_GENERATED := $(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(WIRE_SRC) $(WIRE_HEADERS))
+$(WIRE_GENERATED): wire/Makefile
+
+# You don't need to keep these if they don't exist.
+.INTERMEDIATE: $(WIRE_GENERATED)
maintainer-clean: wire-maintainer-clean
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.