bpo-23404: make touch becomes make regen-all (#1405) (#1461) (#1465) · python/cpython@ab6b962 (original) (raw)

`@@ -224,7 +224,7 @@ LIBOBJS= @LIBOBJS@

`

224

224

`PYTHON= python$(EXE)

`

225

225

`BUILDPYTHON= python$(BUILDEXE)

`

226

226

``

227

``

`-

PYTHON_FOR_GEN=@PYTHON_FOR_GEN@

`

``

227

`+

PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@

`

228

228

`PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@

`

229

229

`_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@

`

230

230

`BUILD_GNU_TYPE= @build@

`

`@@ -271,11 +271,6 @@ IO_OBJS= \

`

271

271

` Modules/_io/stringio.o

`

272

272

``

273

273

`##########################################################################

`

274

``

`-

Grammar

`

275

``

`-

GRAMMAR_H= Include/graminit.h

`

276

``

`-

GRAMMAR_C= Python/graminit.c

`

277

``

`-

GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar

`

278

``

-

279

274

``

280

275

`LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@

`

281

276

``

`@@ -337,38 +332,9 @@ PARSER_HEADERS= \

`

337

332

`PGENSRCS= (PSRCS)(PSRCS) (PSRCS)(PGSRCS)

`

338

333

`PGENOBJS= (POBJS)(POBJS) (POBJS)(PGOBJS)

`

339

334

``

340

``

`-

##########################################################################

`

341

``

`-

opcode.h generation

`

342

``

`-

OPCODE_H_DIR= $(srcdir)/Include

`

343

``

`-

OPCODE_H_SCRIPT= $(srcdir)/Tools/scripts/generate_opcode_h.py

`

344

``

`-

OPCODE_H= $(OPCODE_H_DIR)/opcode.h

`

345

``

`-

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)

`

346

``

`-

`

347

``

`-

##########################################################################

`

348

``

`-

AST

`

349

``

`-

AST_H_DIR= Include

`

350

``

`-

AST_H= $(AST_H_DIR)/Python-ast.h

`

351

``

`-

AST_C_DIR= Python

`

352

``

`-

AST_C= $(AST_C_DIR)/Python-ast.c

`

353

``

`-

AST_ASDL= $(srcdir)/Parser/Python.asdl

`

354

``

-

355

``

`-

ASDLGEN_FILES= (srcdir)/Parser/asdl.py(srcdir)/Parser/asdl.py (srcdir)/Parser/asdl.py(srcdir)/Parser/asdl_c.py

`

356

``

`-

Note that a build now requires Python to exist before the build starts.

`

357

``

`-

Use "hg touch" to fix up screwed up file mtimes in a checkout.

`

358

``

`-

ASDLGEN= (PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(srcdir)/Parser/asdl_c.py

`

359

``

-

360

335

`##########################################################################

`

361

336

`# Python

`

362

337

``

363

``

`-

OPCODETARGETS_H= \

`

364

``

`-

Python/opcode_targets.h

`

365

``

-

366

``

`-

OPCODETARGETGEN= \

`

367

``

`-

$(srcdir)/Python/makeopcodetargets.py

`

368

``

-

369

``

`-

OPCODETARGETGEN_FILES= \

`

370

``

`-

(OPCODETARGETGEN)(OPCODETARGETGEN) (OPCODETARGETGEN)(srcdir)/Lib/opcode.py

`

371

``

-

372

338

`PYTHON_OBJS= \

`

373

339

` Python/_warnings.o \

`

374

340

` Python/Python-ast.o \

`

`@@ -551,7 +517,8 @@ coverage-lcov:

`

551

517

` @echo "lcov report at $(COVERAGE_REPORT)/index.html"

`

552

518

` @echo

`

553

519

``

554

``

`-

coverage-report:

`

``

520

`+

Force regeneration of parser and importlib

`

``

521

`+

coverage-report: regen-grammar regen-importlib

`

555

522

` : # force rebuilding of parser and importlib

`

556

523

` @touch $(GRAMMAR_INPUT)

`

557

524

` @touch $(srcdir)/Lib/importlib/_bootstrap.py

`

`@@ -721,14 +688,24 @@ Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile

`

721

688

`Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)

`

722

689

` (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)

`

723

690

``

724

``

`-

Python/importlib_external.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib

`

``

691

`+

.PHONY: regen-importlib

`

``

692

`+

regen-importlib: Programs/_freeze_importlib

`

``

693

`+

Regenerate Python/importlib_external.h

`

``

694

`+

from Lib/importlib/_bootstrap_external.py using _freeze_importlib

`

725

695

` ./Programs/_freeze_importlib \

`

726

``

`-

$(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h

`

727

``

-

728

``

`-

Python/importlib.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib

`

``

696

`+

$(srcdir)/Lib/importlib/_bootstrap_external.py \

`

``

697

`+

$(srcdir)/Python/importlib_external.h

`

``

698

`+

Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py

`

``

699

`+

using _freeze_importlib

`

729

700

` ./Programs/_freeze_importlib \

`

730

``

`-

$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h

`

``

701

`+

$(srcdir)/Lib/importlib/_bootstrap.py \

`

``

702

`+

$(srcdir)/Python/importlib.h

`

``

703

+

``

704

+

``

705

`+

############################################################################

`

``

706

`+

Regenerate all generated files

`

731

707

``

``

708

`+

regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast regen-importlib

`

732

709

``

733

710

`############################################################################

`

734

711

`# Special rules for object files

`

`@@ -787,15 +764,18 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile

`

787

764

``

788

765

`$(IO_OBJS): $(IO_H)

`

789

766

``

790

``

`- (GRAMMARH):@GENERATEDCOMMENT@(GRAMMAR_H): @GENERATED_COMMENT@ (GRAMMARH):@GENERATEDCOMMENT@(GRAMMAR_INPUT) $(PGEN)

`

791

``

`-

@$(MKDIR_P) Include

`

792

``

`-

(PGEN)(PGEN) (PGEN)(GRAMMAR_INPUT) (GRAMMARH)(GRAMMAR_H) (GRAMMARH)(GRAMMAR_C)

`

793

``

`- (GRAMMARC):@GENERATEDCOMMENT@(GRAMMAR_C): @GENERATED_COMMENT@ (GRAMMARC):@GENERATEDCOMMENT@(GRAMMAR_H)

`

794

``

`-

touch $(GRAMMAR_C)

`

795

``

-

796

767

`$(PGEN): $(PGENOBJS)

`

797

768

` (CC)(CC) (CC)(OPT) (PYLDFLAGS)(PY_LDFLAGS) (PYLDFLAGS)(PGENOBJS) (LIBS)−o(LIBS) -o (LIBS)o(PGEN)

`

798

769

``

``

770

`+

.PHONY: regen-grammar

`

``

771

`+

regen-grammar: $(PGEN)

`

``

772

`+

Regenerate Include/graminit.h and Python/graminit.c

`

``

773

`+

from Grammar/Grammar using pgen

`

``

774

`+

@$(MKDIR_P) Include

`

``

775

`+

(PGEN)(PGEN) (PGEN)(srcdir)/Grammar/Grammar \

`

``

776

`+

$(srcdir)/Include/graminit.h \

`

``

777

`+

$(srcdir)/Python/graminit.c

`

``

778

+

799

779

`Parser/grammar.o: $(srcdir)/Parser/grammar.c \

`

800

780

` $(srcdir)/Include/token.h \

`

801

781

` $(srcdir)/Include/grammar.h

`

`@@ -807,18 +787,28 @@ Parser/printgrammar.o: $(srcdir)/Parser/printgrammar.c

`

807

787

``

808

788

`Parser/pgenmain.o: $(srcdir)/Include/parsetok.h

`

809

789

``

810

``

`- (ASTH):(AST_H): (ASTH):(AST_ASDL) $(ASDLGEN_FILES)

`

811

``

`-

(MKDIRP)(MKDIR_P) (MKDIRP)(AST_H_DIR)

`

812

``

`-

(ASDLGEN)−h(ASDLGEN) -h (ASDLGEN)h(AST_H_DIR) $(AST_ASDL)

`

813

``

-

814

``

`- (ASTC):(AST_C): (ASTC):(AST_H) (ASTASDL)(AST_ASDL) (ASTASDL)(ASDLGEN_FILES)

`

815

``

`-

(MKDIRP)(MKDIR_P) (MKDIRP)(AST_C_DIR)

`

816

``

`-

(ASDLGEN)−c(ASDLGEN) -c (ASDLGEN)c(AST_C_DIR) $(AST_ASDL)

`

817

``

-

818

``

`- (OPCODEH):(OPCODE_H): (OPCODEH):(srcdir)/Lib/opcode.py $(OPCODE_H_SCRIPT)

`

819

``

`-

$(OPCODE_H_GEN)

`

820

``

-

821

``

`-

Python/compile.o Python/symtable.o Python/ast.o: (GRAMMARH)(GRAMMAR_H) (GRAMMARH)(AST_H)

`

``

790

`+

.PHONY=regen-ast

`

``

791

`+

regen-ast:

`

``

792

`+

Regenerate Include/Python-ast.h using Parser/asdl_c.py -h

`

``

793

`+

(MKDIRP)(MKDIR_P) (MKDIRP)(srcdir)/Include

`

``

794

`+

(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Parser/asdl_c.py \

`

``

795

`+

-h $(srcdir)/Include \

`

``

796

`+

$(srcdir)/Parser/Python.asdl

`

``

797

`+

Regenerate Python/Python-ast.c using Parser/asdl_c.py -c

`

``

798

`+

(MKDIRP)(MKDIR_P) (MKDIRP)(srcdir)/Python

`

``

799

`+

(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Parser/asdl_c.py \

`

``

800

`+

-c $(srcdir)/Python \

`

``

801

`+

$(srcdir)/Parser/Python.asdl

`

``

802

+

``

803

`+

.PHONY: regen-opcode

`

``

804

`+

regen-opcode:

`

``

805

`+

Regenerate Include/opcode.h from Lib/opcode.py

`

``

806

`+

using Tools/scripts/generate_opcode_h.py

`

``

807

`+

(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Tools/scripts/generate_opcode_h.py \

`

``

808

`+

$(srcdir)/Lib/opcode.py \

`

``

809

`+

$(srcdir)/Include/opcode.h

`

``

810

+

``

811

`+

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

`

822

812

``

823

813

`Python/getplatform.o: $(srcdir)/Python/getplatform.c

`

824

814

` (CC)−c(CC) -c (CC)c(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o @@ @(srcdir)/Python/getplatform.c

`

`@@ -867,16 +857,26 @@ Objects/unicodeobject.o: (srcdir)/Objects/unicodeobject.c(srcdir)/Objects/unicodeobject.c (srcdir)/Objects/unicodeobject.c(UNICODE_DEPS)

`

867

857

`Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h

`

868

858

`Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h

`

869

859

``

870

``

`- (OPCODETARGETSH):(OPCODETARGETS_H): (OPCODETARGETSH):(OPCODETARGETGEN_FILES)

`

871

``

`-

(PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(OPCODETARGETGEN) $(OPCODETARGETS_H)

`

``

860

`+

.PHONY: regen-opcode-targets

`

``

861

`+

regen-opcode-targets:

`

``

862

`+

Regenerate Python/opcode_targets.h from Lib/opcode.py

`

``

863

`+

using Python/makeopcodetargets.py

`

``

864

`+

(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Python/makeopcodetargets.py \

`

``

865

`+

$(srcdir)/Python/opcode_targets.h

`

872

866

``

873

``

`-

Python/ceval.o: (OPCODETARGETSH)(OPCODETARGETS_H) (OPCODETARGETSH)(srcdir)/Python/ceval_gil.h

`

``

867

`+

Python/ceval.o: (srcdir)/Python/opcodetargets.h(srcdir)/Python/opcode_targets.h (srcdir)/Python/opcodetargets.h(srcdir)/Python/ceval_gil.h

`

874

868

``

875

``

`-

Python/frozen.o: Python/importlib.h Python/importlib_external.h

`

``

869

`+

Python/frozen.o: (srcdir)/Python/importlib.h(srcdir)/Python/importlib.h (srcdir)/Python/importlib.h(srcdir)/Python/importlib_external.h

`

876

870

``

877

871

`Objects/typeobject.o: Objects/typeslots.inc

`

878

``

`-

Objects/typeslots.inc: (srcdir)/Include/typeslots.h(srcdir)/Include/typeslots.h (srcdir)/Include/typeslots.h(srcdir)/Objects/typeslots.py

`

879

``

`-

(PYTHONFORGEN)(PYTHON_FOR_GEN) (PYTHONFORGEN)(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h Objects/typeslots.inc

`

``

872

+

``

873

`+

.PHONY: regen-typeslots

`

``

874

`+

regen-typeslots:

`

``

875

`+

Regenerate Objects/typeslots.inc from Include/typeslotsh

`

``

876

`+

using Objects/typeslots.py

`

``

877

`+

(PYTHONFORREGEN)(PYTHON_FOR_REGEN) (PYTHONFORREGEN)(srcdir)/Objects/typeslots.py \

`

``

878

`+

< $(srcdir)/Include/typeslots.h \

`

``

879

`+

$(srcdir)/Objects/typeslots.inc

`

880

880

``

881

881

`############################################################################

`

882

882

`# Header files

`

`@@ -929,7 +929,7 @@ PYTHON_HEADERS= \

`

929

929

` $(srcdir)/Include/node.h \

`

930

930

` $(srcdir)/Include/object.h \

`

931

931

` $(srcdir)/Include/objimpl.h \

`

932

``

`-

$(OPCODE_H) \

`

``

932

`+

$(srcdir)/Include/opcode.h \

`

933

933

` $(srcdir)/Include/osdefs.h \

`

934

934

` $(srcdir)/Include/patchlevel.h \

`

935

935

` $(srcdir)/Include/pgen.h \

`

`@@ -970,7 +970,7 @@ PYTHON_HEADERS= \

`

970

970

` $(srcdir)/Include/weakrefobject.h \

`

971

971

` pyconfig.h \

`

972

972

` $(PARSER_HEADERS) \

`

973

``

`-

$(AST_H)

`

``

973

`+

$(srcdir)/Include/Python-ast.h

`

974

974

``

975

975

`$(LIBRARY_OBJS) (MODOBJS)Programs/python.o:(MODOBJS) Programs/python.o: (MODOBJS)Programs/python.o:(PYTHON_HEADERS)

`

976

976

``

`@@ -1551,9 +1551,12 @@ recheck:

`

1551

1551

` $(SHELL) config.status --recheck

`

1552

1552

` $(SHELL) config.status

`

1553

1553

``

1554

``

`-

Rebuild the configure script from configure.ac; also rebuild pyconfig.h.in

`

``

1554

`+

Regenerate configure and pyconfig.h.in

`

``

1555

`+

.PHONY: autoconf

`

1555

1556

`autoconf:

`

``

1557

`+

Regenerate the configure script from configure.ac using autoconf

`

1556

1558

` (cd $(srcdir); autoconf -Wall)

`

``

1559

`+

Regenerate pyconfig.h.in from configure.ac using autoheader

`

1557

1560

` (cd $(srcdir); autoheader -Wall)

`

1558

1561

``

1559

1562

`# Create a tags file for vi

`

`@@ -1570,14 +1573,6 @@ TAGS::

`

1570

1573

` etags Include/*.h; \

`

1571

1574

` for i in (SRCDIRS);doetags−a(SRCDIRS); do etags -a (SRCDIRS);doetagsa$i/*.[ch]; done

`

1572

1575

``

1573

``

`-

This fixes up the mtimes of checked-in generated files, assuming that they

`

1574

``

`-

only appear to be outdated because of checkout order.

`

1575

``

`-

This is run while preparing a source release tarball, and can be run manually

`

1576

``

`-

to avoid bootstrap issues.

`

1577

``

`-

touch:

`

1578

``

`-

cd $(srcdir); \

`

1579

``

`-

hg --config extensions.touch=Tools/hg/hgtouch.py touch -v

`

1580

``

-

1581

1576

`# Sanitation targets -- clean leaves libraries, executables and tags

`

1582

1577

`# files, which clobber removes as well

`

1583

1578

`pycremoval:

`

`@@ -1695,7 +1690,7 @@ Python/thread.o: @THREADHEADERS@

`

1695

1690

`.PHONY: maninstall libinstall inclinstall libainstall sharedinstall

`

1696

1691

`.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure

`

1697

1692

`.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools

`

1698

``

`-

.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean

`

``

1693

`+

.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean

`

1699

1694

`.PHONY: smelly funny patchcheck touch altmaninstall commoninstall

`

1700

1695

`.PHONY: gdbhooks

`

1701

1696

``