[3.6] bpo-23404: make touch becomes make regen-all (#1405) (#1461) · python/cpython@9d02f56 (original) (raw)
`@@ -229,7 +229,7 @@ LIBOBJS= @LIBOBJS@
`
229
229
`PYTHON= python$(EXE)
`
230
230
`BUILDPYTHON= python$(BUILDEXE)
`
231
231
``
232
``
`-
PYTHON_FOR_GEN=@PYTHON_FOR_GEN@
`
``
232
`+
PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
`
233
233
`PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
`
234
234
`_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
`
235
235
`BUILD_GNU_TYPE= @build@
`
`@@ -273,11 +273,6 @@ IO_OBJS= \
`
273
273
` Modules/_io/stringio.o
`
274
274
``
275
275
`##########################################################################
`
276
``
`-
Grammar
`
277
``
`-
GRAMMAR_H= Include/graminit.h
`
278
``
`-
GRAMMAR_C= Python/graminit.c
`
279
``
`-
GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
`
280
``
-
281
276
``
282
277
`LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
`
283
278
``
`@@ -316,38 +311,9 @@ PARSER_HEADERS= \
`
316
311
``
317
312
`PGENOBJS= (POBJS)(POBJS) (POBJS)(PGOBJS)
`
318
313
``
319
``
`-
##########################################################################
`
320
``
`-
opcode.h generation
`
321
``
`-
OPCODE_H_DIR= $(srcdir)/Include
`
322
``
`-
OPCODE_H_SCRIPT= $(srcdir)/Tools/scripts/generate_opcode_h.py
`
323
``
`-
OPCODE_H= $(OPCODE_H_DIR)/opcode.h
`
324
``
`-
OPCODE_H_GEN= (PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(OPCODE_H_SCRIPT) (srcdir)/Lib/opcode.py(srcdir)/Lib/opcode.py (srcdir)/Lib/opcode.py(OPCODE_H)
`
325
``
-
326
``
`-
##########################################################################
`
327
``
`-
AST
`
328
``
`-
AST_H_DIR= Include
`
329
``
`-
AST_H= $(AST_H_DIR)/Python-ast.h
`
330
``
`-
AST_C_DIR= Python
`
331
``
`-
AST_C= $(AST_C_DIR)/Python-ast.c
`
332
``
`-
AST_ASDL= $(srcdir)/Parser/Python.asdl
`
333
``
-
334
``
`-
ASDLGEN_FILES= (srcdir)/Parser/asdl.py(srcdir)/Parser/asdl.py (srcdir)/Parser/asdl.py(srcdir)/Parser/asdl_c.py
`
335
``
`-
Note that a build now requires Python to exist before the build starts.
`
336
``
`-
Use "hg touch" to fix up screwed up file mtimes in a checkout.
`
337
``
`-
ASDLGEN= (PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(srcdir)/Parser/asdl_c.py
`
338
``
-
339
314
`##########################################################################
`
340
315
`# Python
`
341
316
``
342
``
`-
OPCODETARGETS_H= \
`
343
``
`-
Python/opcode_targets.h
`
344
``
-
345
``
`-
OPCODETARGETGEN= \
`
346
``
`-
$(srcdir)/Python/makeopcodetargets.py
`
347
``
-
348
``
`-
OPCODETARGETGEN_FILES= \
`
349
``
`-
(OPCODETARGETGEN)(OPCODETARGETGEN) (OPCODETARGETGEN)(srcdir)/Lib/opcode.py
`
350
``
-
351
317
`PYTHON_OBJS= \
`
352
318
` Python/_warnings.o \
`
353
319
` Python/Python-ast.o \
`
`@@ -547,7 +513,8 @@ coverage-lcov:
`
547
513
` @echo "lcov report at $(COVERAGE_REPORT)/index.html"
`
548
514
` @echo
`
549
515
``
550
``
`-
coverage-report:
`
``
516
`+
Force regeneration of parser and importlib
`
``
517
`+
coverage-report: regen-grammar regen-importlib
`
551
518
` : # force rebuilding of parser and importlib
`
552
519
` @touch $(GRAMMAR_INPUT)
`
553
520
` @touch $(srcdir)/Lib/importlib/_bootstrap.py
`
`@@ -723,14 +690,24 @@ Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
`
723
690
`Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
`
724
691
` (LINKCC)(LINKCC) (LINKCC)(PY_LDFLAGS) -o @Programs/freezeimportlib.o@ Programs/_freeze_importlib.o @Programs/freezeimportlib.o(LIBRARY_OBJS_OMIT_FROZEN) (LIBS)(LIBS) (LIBS)(MODLIBS) (SYSLIBS)(SYSLIBS) (SYSLIBS)(LDLAST)
`
725
692
``
726
``
`-
Python/importlib_external.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib Python/marshal.c
`
``
693
`+
.PHONY: regen-importlib
`
``
694
`+
regen-importlib: Programs/_freeze_importlib
`
``
695
`+
Regenerate Python/importlib_external.h
`
``
696
`+
from Lib/importlib/_bootstrap_external.py using _freeze_importlib
`
727
697
` ./Programs/_freeze_importlib \
`
728
``
`-
$(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
`
729
``
-
730
``
`-
Python/importlib.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib Python/marshal.c
`
``
698
`+
$(srcdir)/Lib/importlib/_bootstrap_external.py \
`
``
699
`+
$(srcdir)/Python/importlib_external.h
`
``
700
`+
Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py
`
``
701
`+
using _freeze_importlib
`
731
702
` ./Programs/_freeze_importlib \
`
732
``
`-
$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
`
``
703
`+
$(srcdir)/Lib/importlib/_bootstrap.py \
`
``
704
`+
$(srcdir)/Python/importlib.h
`
``
705
+
``
706
+
``
707
`+
############################################################################
`
``
708
`+
Regenerate all generated files
`
733
709
``
``
710
`+
regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast regen-importlib
`
734
711
``
735
712
`############################################################################
`
736
713
`# Special rules for object files
`
`@@ -789,15 +766,18 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
`
789
766
``
790
767
`$(IO_OBJS): $(IO_H)
`
791
768
``
792
``
`- (GRAMMARH):@GENERATEDCOMMENT@(GRAMMAR_H): @GENERATED_COMMENT@ (GRAMMARH):@GENERATEDCOMMENT@(GRAMMAR_INPUT) $(PGEN)
`
793
``
`-
@$(MKDIR_P) Include
`
794
``
`-
(PGEN)(PGEN) (PGEN)(GRAMMAR_INPUT) (GRAMMARH)(GRAMMAR_H) (GRAMMARH)(GRAMMAR_C)
`
795
``
`- (GRAMMARC):@GENERATEDCOMMENT@(GRAMMAR_C): @GENERATED_COMMENT@ (GRAMMARC):@GENERATEDCOMMENT@(GRAMMAR_H)
`
796
``
`-
touch $(GRAMMAR_C)
`
797
``
-
798
769
`$(PGEN): $(PGENOBJS)
`
799
770
` (CC)(CC) (CC)(OPT) (PYLDFLAGS)(PY_LDFLAGS) (PYLDFLAGS)(PGENOBJS) (LIBS)−o(LIBS) -o (LIBS)−o(PGEN)
`
800
771
``
``
772
`+
.PHONY: regen-grammar
`
``
773
`+
regen-grammar: $(PGEN)
`
``
774
`+
Regenerate Include/graminit.h and Python/graminit.c
`
``
775
`+
from Grammar/Grammar using pgen
`
``
776
`+
@$(MKDIR_P) Include
`
``
777
`+
(PGEN)(PGEN) (PGEN)(srcdir)/Grammar/Grammar \
`
``
778
`+
$(srcdir)/Include/graminit.h \
`
``
779
`+
$(srcdir)/Python/graminit.c
`
``
780
+
801
781
`Parser/grammar.o: $(srcdir)/Parser/grammar.c \
`
802
782
` $(srcdir)/Include/token.h \
`
803
783
` $(srcdir)/Include/grammar.h
`
`@@ -809,18 +789,28 @@ Parser/printgrammar.o: $(srcdir)/Parser/printgrammar.c
`
809
789
``
810
790
`Parser/pgenmain.o: $(srcdir)/Include/parsetok.h
`
811
791
``
812
``
`- (ASTH):(AST_H): (ASTH):(AST_ASDL) $(ASDLGEN_FILES)
`
813
``
`-
(MKDIRP)(MKDIR_P) (MKDIRP)(AST_H_DIR)
`
814
``
`-
(ASDLGEN)−h(ASDLGEN) -h (ASDLGEN)−h(AST_H_DIR) $(AST_ASDL)
`
815
``
-
816
``
`- (ASTC):(AST_C): (ASTC):(AST_H) (ASTASDL)(AST_ASDL) (ASTASDL)(ASDLGEN_FILES)
`
817
``
`-
(MKDIRP)(MKDIR_P) (MKDIRP)(AST_C_DIR)
`
818
``
`-
(ASDLGEN)−c(ASDLGEN) -c (ASDLGEN)−c(AST_C_DIR) $(AST_ASDL)
`
819
``
-
820
``
`- (OPCODEH):(OPCODE_H): (OPCODEH):(srcdir)/Lib/opcode.py $(OPCODE_H_SCRIPT)
`
821
``
`-
$(OPCODE_H_GEN)
`
822
``
-
823
``
`-
Python/compile.o Python/symtable.o Python/ast.o: (GRAMMARH)(GRAMMAR_H) (GRAMMARH)(AST_H)
`
``
792
`+
.PHONY=regen-ast
`
``
793
`+
regen-ast:
`
``
794
`+
Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
`
``
795
`+
(MKDIRP)(MKDIR_P) (MKDIRP)(srcdir)/Include
`
``
796
`+
(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Parser/asdl_c.py \
`
``
797
`+
-h $(srcdir)/Include \
`
``
798
`+
$(srcdir)/Parser/Python.asdl
`
``
799
`+
Regenerate Python/Python-ast.c using Parser/asdl_c.py -c
`
``
800
`+
(MKDIRP)(MKDIR_P) (MKDIRP)(srcdir)/Python
`
``
801
`+
(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Parser/asdl_c.py \
`
``
802
`+
-c $(srcdir)/Python \
`
``
803
`+
$(srcdir)/Parser/Python.asdl
`
``
804
+
``
805
`+
.PHONY: regen-opcode
`
``
806
`+
regen-opcode:
`
``
807
`+
Regenerate Include/opcode.h from Lib/opcode.py
`
``
808
`+
using Tools/scripts/generate_opcode_h.py
`
``
809
`+
(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Tools/scripts/generate_opcode_h.py \
`
``
810
`+
$(srcdir)/Lib/opcode.py \
`
``
811
`+
$(srcdir)/Include/opcode.h
`
``
812
+
``
813
`+
Python/compile.o Python/symtable.o Python/ast.o: (srcdir)/Include/graminit.h(srcdir)/Include/graminit.h (srcdir)/Include/graminit.h(srcdir)/Include/Python-ast.h
`
824
814
``
825
815
`Python/getplatform.o: $(srcdir)/Python/getplatform.c
`
826
816
` (CC)−c(CC) -c (CC)−c(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o @@ @(srcdir)/Python/getplatform.c
`
`@@ -870,12 +860,16 @@ Objects/odictobject.o: $(srcdir)/Objects/dict-common.h
`
870
860
`Objects/dictobject.o: (srcdir)/Objects/stringlib/eq.h(srcdir)/Objects/stringlib/eq.h (srcdir)/Objects/stringlib/eq.h(srcdir)/Objects/dict-common.h
`
871
861
`Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
`
872
862
``
873
``
`- (OPCODETARGETSH):(OPCODETARGETS_H): (OPCODETARGETSH):(OPCODETARGETGEN_FILES)
`
874
``
`-
(PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(OPCODETARGETGEN) $(OPCODETARGETS_H)
`
``
863
`+
.PHONY: regen-opcode-targets
`
``
864
`+
regen-opcode-targets:
`
``
865
`+
Regenerate Python/opcode_targets.h from Lib/opcode.py
`
``
866
`+
using Python/makeopcodetargets.py
`
``
867
`+
(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Python/makeopcodetargets.py \
`
``
868
`+
$(srcdir)/Python/opcode_targets.h
`
875
869
``
876
``
`-
Python/ceval.o: (OPCODETARGETSH)(OPCODETARGETS_H) (OPCODETARGETSH)(srcdir)/Python/ceval_gil.h
`
``
870
`+
Python/ceval.o: (srcdir)/Python/opcodetargets.h(srcdir)/Python/opcode_targets.h (srcdir)/Python/opcodetargets.h(srcdir)/Python/ceval_gil.h
`
877
871
``
878
``
`-
Python/frozen.o: Python/importlib.h Python/importlib_external.h
`
``
872
`+
Python/frozen.o: (srcdir)/Python/importlib.h(srcdir)/Python/importlib.h (srcdir)/Python/importlib.h(srcdir)/Python/importlib_external.h
`
879
873
``
880
874
`# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
`
881
875
`# follow our naming conventions. dtrace(1) uses the output filename to generate
`
`@@ -890,8 +884,14 @@ Python/pydtrace.o: (srcdir)/Include/pydtrace.d(srcdir)/Include/pydtrace.d (srcdir)/Include/pydtrace.d(DTRACE_DEPS)
`
890
884
` (DTRACE)(DTRACE) (DTRACE)(DFLAGS) -o @−G−s@ -G -s @−G−s< $(DTRACE_DEPS)
`
891
885
``
892
886
`Objects/typeobject.o: Objects/typeslots.inc
`
893
``
`-
Objects/typeslots.inc: (srcdir)/Include/typeslots.h(srcdir)/Include/typeslots.h (srcdir)/Include/typeslots.h(srcdir)/Objects/typeslots.py
`
894
``
`-
(PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h Objects/typeslots.inc
`
``
887
+
``
888
`+
.PHONY: regen-typeslots
`
``
889
`+
regen-typeslots:
`
``
890
`+
Regenerate Objects/typeslots.inc from Include/typeslotsh
`
``
891
`+
using Objects/typeslots.py
`
``
892
`+
(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Objects/typeslots.py \
`
``
893
`+
< $(srcdir)/Include/typeslots.h \
`
``
894
`+
$(srcdir)/Objects/typeslots.inc
`
895
895
``
896
896
`############################################################################
`
897
897
`# Header files
`
`@@ -944,7 +944,7 @@ PYTHON_HEADERS= \
`
944
944
` $(srcdir)/Include/node.h \
`
945
945
` $(srcdir)/Include/object.h \
`
946
946
` $(srcdir)/Include/objimpl.h \
`
947
``
`-
$(OPCODE_H) \
`
``
947
`+
$(srcdir)/Include/opcode.h \
`
948
948
` $(srcdir)/Include/osdefs.h \
`
949
949
` $(srcdir)/Include/osmodule.h \
`
950
950
` $(srcdir)/Include/patchlevel.h \
`
`@@ -987,7 +987,7 @@ PYTHON_HEADERS= \
`
987
987
` $(srcdir)/Include/weakrefobject.h \
`
988
988
` pyconfig.h \
`
989
989
` $(PARSER_HEADERS) \
`
990
``
`-
$(AST_H) \
`
``
990
`+
$(srcdir)/Include/Python-ast.h \
`
991
991
` $(DTRACE_HEADERS)
`
992
992
``
993
993
`$(LIBRARY_OBJS) (MODOBJS)Programs/python.o:(MODOBJS) Programs/python.o: (MODOBJS)Programs/python.o:(PYTHON_HEADERS)
`
`@@ -1554,9 +1554,12 @@ recheck:
`
1554
1554
` $(SHELL) config.status --recheck
`
1555
1555
` $(SHELL) config.status
`
1556
1556
``
1557
``
`-
Rebuild the configure script from configure.ac; also rebuild pyconfig.h.in
`
``
1557
`+
Regenerate configure and pyconfig.h.in
`
``
1558
`+
.PHONY: autoconf
`
1558
1559
`autoconf:
`
``
1560
`+
Regenerate the configure script from configure.ac using autoconf
`
1559
1561
` (cd $(srcdir); autoconf -Wall)
`
``
1562
`+
Regenerate pyconfig.h.in from configure.ac using autoheader
`
1560
1563
` (cd $(srcdir); autoheader -Wall)
`
1561
1564
``
1562
1565
`# Create a tags file for vi
`
`@@ -1573,14 +1576,6 @@ TAGS::
`
1573
1576
` etags Include/*.h; \
`
1574
1577
` for i in (SRCDIRS);doetags−a(SRCDIRS); do etags -a (SRCDIRS);doetags−a$i/*.[ch]; done
`
1575
1578
``
1576
``
`-
This fixes up the mtimes of checked-in generated files, assuming that they
`
1577
``
`-
only appear to be outdated because of checkout order.
`
1578
``
`-
This is run while preparing a source release tarball, and can be run manually
`
1579
``
`-
to avoid bootstrap issues.
`
1580
``
`-
touch:
`
1581
``
`-
cd $(srcdir); \
`
1582
``
`-
hg --config extensions.touch=Tools/hg/hgtouch.py touch -v
`
1583
``
-
1584
1579
`# Sanitation targets -- clean leaves libraries, executables and tags
`
1585
1580
`# files, which clobber removes as well
`
1586
1581
`pycremoval:
`
`@@ -1698,7 +1693,7 @@ Python/thread.o: @THREADHEADERS@
`
1698
1693
`.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
`
1699
1694
`.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
`
1700
1695
`.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
`
1701
``
`-
.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
`
``
1696
`+
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
`
1702
1697
`.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
`
1703
1698
`.PHONY: gdbhooks
`
1704
1699
``