From c57e0548bd7d44fd8318b85f021ab32812db4ff8 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Fri, 29 Aug 2025 11:15:33 +0300
Subject: [PATCH 127/N] Add ABIFLAGS to targets when needed, required for
 DEBUG builds

---
 Makefile.pre.in | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 741be73..43c5d3f 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -168,8 +168,8 @@ WHEEL_PKG_DIR=	@WHEEL_PKG_DIR@
 # Detailed destination directories
 BINLIBDEST=	@BINLIBDEST@
 LIBDEST=	$(SCRIPTDIR)/python$(VERSION)$(ABI_THREAD)
-INCLUDEPY=	$(INCLUDEDIR)/python$(VERSION)
-CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(VERSION)
+INCLUDEPY=	$(INCLUDEDIR)/python$(LDVERSION)
+CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(LDVERSION)
 VENVLAUNCHERDIR=	$(BINLIBDEST)/venv/scripts/nt
 
 # Symbols used for using shared libraries
@@ -304,11 +304,11 @@ MACHDEP_OBJS=	@MACHDEP_OBJS@
 LIBOBJDIR=	Python/
 LIBOBJS=	@LIBOBJS@
 
-PYTHON=		python$(EXE)
-BUILDPYTHON=	python$(BUILDEXE)
-BUILDPYTHONW=	pythonw$(BUILDEXE)
-BUILDVENVLAUNCHER=	venvlauncher$(BUILDEXE)
-BUILDVENVWLAUNCHER=	venvwlauncher$(BUILDEXE)
+PYTHON=		python$(ABIFLAGS)$(EXE)
+BUILDPYTHON=	python$(ABIFLAGS)$(BUILDEXE)
+BUILDPYTHONW=	pythonw$(ABIFLAGS)$(BUILDEXE)
+BUILDVENVLAUNCHER=	venvlauncher$(ABIFLAGS)$(BUILDEXE)
+BUILDVENVWLAUNCHER=	venvwlauncher$(ABIFLAGS)$(BUILDEXE)
 
 HOSTRUNNER= @HOSTRUNNER@
 
@@ -2249,9 +2249,9 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
 	done
 	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
 		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
-		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(EXE); \
-		$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(EXE); \
-		$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(EXE); \
+		$(INSTALL_PROGRAM) $(BUILDPYTHONW) $(DESTDIR)$(BINDIR)/python3w$(ABIFLAGS)$(EXE); \
+		$(INSTALL_PROGRAM) $(BUILDVENVLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/python$(ABIFLAGS)$(EXE); \
+		$(INSTALL_PROGRAM) $(BUILDVENVWLAUNCHER) $(DESTDIR)$(VENVLAUNCHERDIR)/pythonw$(ABIFLAGS)$(EXE); \
 	else \
 		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
 	fi
@@ -3059,7 +3059,7 @@ clean: clean-retain-profile clean-bolt
 
 .PHONY: clobber
 clobber: clean
-	-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY)$(ABI3LDLIBRARY) $(ABI3DLLLIBRARY) \
+	-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) $(ABI3LDLIBRARY) $(ABI3DLLLIBRARY) \
 		tags TAGS \
 		config.cache config.log pyconfig.h Modules/config.c
 	-rm -rf build platform
