Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0a669e

Browse files
author
Victor Stinner
committed
Close #13596: Only recompile Lib/_sysconfigdata.py when needed
1 parent 57c9c7b commit e0a669e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

Makefile.pre.in

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ OBJECT_OBJS= \
379379
Objects/unicodectype.o \
380380
Objects/weakrefobject.o
381381

382+
SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py
382383

383384
##########################################################################
384385
# objects that get linked into the Python library
@@ -396,7 +397,7 @@ LIBRARY_OBJS= \
396397

397398
# Default target
398399
all: build_all
399-
build_all: $(BUILDPYTHON) sysconfig oldsharedmods sharedmods gdbhooks Modules/_testembed
400+
build_all: $(BUILDPYTHON) $(SYSCONFIGDATA) oldsharedmods sharedmods gdbhooks Modules/_testembed
400401

401402
# Compile a binary with gcc profile guided optimization.
402403
profile-opt:
@@ -429,15 +430,15 @@ coverage:
429430
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
430431
$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
431432

432-
platform: $(BUILDPYTHON) sysconfig
433+
platform: $(BUILDPYTHON) $(SYSCONFIGDATA)
433434
$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
434435

435436
# Generate the sysconfig build-time data
436-
sysconfig: $(BUILDPYTHON)
437+
$(SYSCONFIGDATA): $(BUILDPYTHON)
437438
$(RUNSHARED) ./$(BUILDPYTHON) -SE -m sysconfig --generate-posix-vars
438439

439440
# Build the shared modules
440-
sharedmods: $(BUILDPYTHON) sysconfig
441+
sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA)
441442
@case $$MAKEFLAGS in \
442443
*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
443444
*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
@@ -1315,7 +1316,7 @@ clean: pycremoval
13151316
find build -name 'fficonfig.h' -exec rm -f {} ';' || true
13161317
find build -name 'fficonfig.py' -exec rm -f {} ';' || true
13171318
-rm -f Lib/lib2to3/*Grammar*.pickle
1318-
-rm -f Lib/_sysconfigdata.py
1319+
-rm -f $(SYSCONFIGDATA)
13191320
-rm -f Modules/_testembed
13201321

13211322
profile-removal:
@@ -1393,7 +1394,7 @@ patchcheck:
13931394
Python/thread.o: @THREADHEADERS@
13941395

13951396
# Declare targets that aren't real files
1396-
.PHONY: all build_all sysconfig sharedmods oldsharedmods test quicktest
1397+
.PHONY: all build_all sharedmods oldsharedmods test quicktest
13971398
.PHONY: install altinstall oldsharedinstall bininstall altbininstall
13981399
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
13991400
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure

0 commit comments

Comments
 (0)