From 7d0638941cc3302a6f67043e7e17e83d76d2ef16 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Wed, 26 Nov 2025 16:42:24 +0000 Subject: [PATCH] Makefile builds: do not inherit SRC from environment in big-int In just `src/big-int` we were including `common` before defining `SRC`, which meant a possible environment-defined value of `SRC` was being used to construct some rules. The possible reason for having the `include` earlier in just that file was that we were lacking a rule for `.cc` files, the absence of which caused `make` to fail when sourcing `common` after setting `SRC`. Both fixes together now ensure that even an environment with `SRC` set won't cause builds to fail in strange ways. Fixes: #4834 --- src/big-int/makefile | 3 ++- src/common | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/big-int/makefile b/src/big-int/makefile index 96492d98b84..abc063522a7 100644 --- a/src/big-int/makefile +++ b/src/big-int/makefile @@ -1,7 +1,8 @@ +SRC = bigint-func.cc bigint.cc + include ../config.inc include ../common -SRC = bigint-func.cc bigint.cc CLEANFILES = big-int$(LIBEXT) all: big-int$(LIBEXT) diff --git a/src/common b/src/common index 742f872abff..276f7f3a6b4 100644 --- a/src/common +++ b/src/common @@ -270,6 +270,7 @@ sources: Makefile # endif D_FILES1 = $(SRC:.c=$(DEPEXT)) -D_FILES = $(D_FILES1:.cpp=$(DEPEXT)) +D_FILES2 = $(D_FILES1:.cc=$(DEPEXT)) +D_FILES = $(D_FILES2:.cpp=$(DEPEXT)) -include $(D_FILES)