From 105a75b92cab324da1fe3a14fb9c12587ef6f4a8 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Wed, 22 Apr 2026 10:47:59 +1000 Subject: [PATCH] py/mkrules.mk: Allow PROG to be set on the command line for .exe targets. When PROG is provided on the make command line (e.g. PROG=pydfu), the existing .exe-suffix rule for mingw targets has no effect because command-line variables override Makefile assignments. Use 'override' so the .exe suffix is still applied in this case. Without this, mingw builds invoked with PROG=foo produce 'foo' but the build rules still expect 'foo.exe', leading to spurious rebuilds and missing artifacts. Signed-off-by: Andrew Leech --- py/mkrules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 6ac731b368b07..5b7520a1d3b26 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -250,7 +250,7 @@ ifneq ($(PROG),) # Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc. COMPILER_TARGET := $(shell $(CC) -dumpmachine) ifneq (,$(findstring mingw,$(COMPILER_TARGET))) -PROG := $(PROG).exe +override PROG := $(PROG).exe endif all: $(BUILD)/$(PROG)