bpo-23404: make touch becomes make regen-all (#1405) · python/cpython@a5c62a8 (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 \

`

`@@ -548,11 +514,8 @@ coverage-lcov:

`

548

514

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

`

549

515

` @echo

`

550

516

``

551

``

`-

coverage-report:

`

552

``

`-

@ # force rebuilding of parser and importlib

`

553

``

`-

@touch $(GRAMMAR_INPUT)

`

554

``

`-

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

`

555

``

`-

@touch $(srcdir)/Lib/importlib/_bootstrap_external.py

`

``

517

`+

Force regeneration of parser and importlib

`

``

518

`+

coverage-report: regen-grammar regen-importlib

`

556

519

` @ # build with coverage info

`

557

520

` $(MAKE) coverage

`

558

521

` @ # run tests, ignore failures

`

`@@ -724,14 +687,24 @@ Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile

`

724

687

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

`

725

688

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

`

726

689

``

727

``

`-

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

`

``

690

`+

.PHONY: regen-importlib

`

``

691

`+

regen-importlib: Programs/_freeze_importlib

`

``

692

`+

Regenerate Python/importlib_external.h

`

``

693

`+

from Lib/importlib/_bootstrap_external.py using _freeze_importlib

`

728

694

` ./Programs/_freeze_importlib \

`

729

``

`-

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

`

730

``

-

731

``

`-

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

`

``

695

`+

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

`

``

696

`+

$(srcdir)/Python/importlib_external.h

`

``

697

`+

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

`

``

698

`+

using _freeze_importlib

`

732

699

` ./Programs/_freeze_importlib \

`

733

``

`-

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

`

``

700

`+

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

`

``

701

`+

$(srcdir)/Python/importlib.h

`

``

702

+

``

703

+

``

704

`+

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

`

``

705

`+

Regenerate all generated files

`

734

706

``

``

707

`+

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

`

735

708

``

736

709

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

`

737

710

`# Special rules for object files

`

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

`

790

763

``

791

764

`$(IO_OBJS): $(IO_H)

`

792

765

``

793

``

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

`

794

``

`-

@$(MKDIR_P) Include

`

795

``

`-

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

`

796

``

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

`

797

``

`-

touch $(GRAMMAR_C)

`

798

``

-

799

766

`$(PGEN): $(PGENOBJS)

`

800

767

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

`

801

768

``

``

769

`+

.PHONY: regen-grammar

`

``

770

`+

regen-grammar: $(PGEN)

`

``

771

`+

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

`

``

772

`+

from Grammar/Grammar using pgen

`

``

773

`+

@$(MKDIR_P) Include

`

``

774

`+

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

`

``

775

`+

$(srcdir)/Include/graminit.h \

`

``

776

`+

$(srcdir)/Python/graminit.c

`

``

777

+

802

778

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

`

803

779

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

`

804

780

` $(srcdir)/Include/grammar.h

`

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

`

810

786

``

811

787

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

`

812

788

``

813

``

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

`

814

``

`-

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

`

815

``

`-

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

`

816

``

-

817

``

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

`

818

``

`-

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

`

819

``

`-

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

`

820

``

-

821

``

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

`

822

``

`-

$(OPCODE_H_GEN)

`

823

``

-

824

``

`-

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

`

``

789

`+

.PHONY=regen-ast

`

``

790

`+

regen-ast:

`

``

791

`+

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

`

``

792

`+

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

`

``

793

`+

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

`

``

794

`+

-h $(srcdir)/Include \

`

``

795

`+

$(srcdir)/Parser/Python.asdl

`

``

796

`+

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

`

``

797

`+

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

`

``

798

`+

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

`

``

799

`+

-c $(srcdir)/Python \

`

``

800

`+

$(srcdir)/Parser/Python.asdl

`

``

801

+

``

802

`+

.PHONY: regen-opcode

`

``

803

`+

regen-opcode:

`

``

804

`+

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

`

``

805

`+

using Tools/scripts/generate_opcode_h.py

`

``

806

`+

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

`

``

807

`+

$(srcdir)/Lib/opcode.py \

`

``

808

`+

$(srcdir)/Include/opcode.h

`

``

809

+

``

810

`+

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

`

825

811

``

826

812

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

`

827

813

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

`

`@@ -871,12 +857,16 @@ Objects/odictobject.o: $(srcdir)/Objects/dict-common.h

`

871

857

`Objects/dictobject.o: (srcdir)/Objects/stringlib/eq.h(srcdir)/Objects/stringlib/eq.h (srcdir)/Objects/stringlib/eq.h(srcdir)/Objects/dict-common.h

`

872

858

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

`

873

859

``

874

``

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

`

875

``

`-

(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

`

876

866

``

877

``

`-

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

`

878

868

``

879

``

`-

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

`

880

870

``

881

871

`# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to

`

882

872

`# follow our naming conventions. dtrace(1) uses the output filename to generate

`

`@@ -891,8 +881,14 @@ Python/pydtrace.o: (srcdir)/Include/pydtrace.d(srcdir)/Include/pydtrace.d (srcdir)/Include/pydtrace.d(DTRACE_DEPS)

`

891

881

` (DTRACE)(DTRACE) (DTRACE)(DFLAGS) -o @−G−s@ -G -s @Gs< $(DTRACE_DEPS)

`

892

882

``

893

883

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

`

894

``

`-

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

`

895

``

`-

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

`

``

884

+

``

885

`+

.PHONY: regen-typeslots

`

``

886

`+

regen-typeslots:

`

``

887

`+

Regenerate Objects/typeslots.inc from Include/typeslotsh

`

``

888

`+

using Objects/typeslots.py

`

``

889

`+

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

`

``

890

`+

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

`

``

891

`+

$(srcdir)/Objects/typeslots.inc

`

896

892

``

897

893

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

`

898

894

`# Header files

`

`@@ -945,7 +941,7 @@ PYTHON_HEADERS= \

`

945

941

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

`

946

942

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

`

947

943

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

`

948

``

`-

$(OPCODE_H) \

`

``

944

`+

$(srcdir)/Include/opcode.h \

`

949

945

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

`

950

946

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

`

951

947

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

`

`@@ -988,7 +984,7 @@ PYTHON_HEADERS= \

`

988

984

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

`

989

985

` pyconfig.h \

`

990

986

` $(PARSER_HEADERS) \

`

991

``

`-

$(AST_H) \

`

``

987

`+

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

`

992

988

` $(DTRACE_HEADERS)

`

993

989

``

994

990

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

`

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

`

1555

1551

` $(SHELL) config.status --recheck

`

1556

1552

` $(SHELL) config.status

`

1557

1553

``

1558

``

`-

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

`

``

1554

`+

Regenerate configure and pyconfig.h.in

`

``

1555

`+

.PHONY: autoconf

`

1559

1556

`autoconf:

`

``

1557

`+

Regenerate the configure script from configure.ac using autoconf

`

1560

1558

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

`

``

1559

`+

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

`

1561

1560

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

`

1562

1561

``

1563

1562

`# Create a tags file for vi

`

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

`

1574

1573

` etags Include/*.h; \

`

1575

1574

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

`

1576

1575

``

1577

``

`-

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

`

1578

``

`-

only appear to be outdated because of checkout order.

`

1579

``

`-

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

`

1580

``

`-

to avoid bootstrap issues.

`

1581

``

`-

touch:

`

1582

``

`-

cd $(srcdir); \

`

1583

``

`-

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

`

1584

``

-

1585

1576

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

`

1586

1577

`# files, which clobber removes as well

`

1587

1578

`pycremoval:

`

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

`

1699

1690

`.PHONY: maninstall libinstall inclinstall libainstall sharedinstall

`

1700

1691

`.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure

`

1701

1692

`.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools

`

1702

``

`-

.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean

`

``

1693

`+

.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean

`

1703

1694

`.PHONY: smelly funny patchcheck touch altmaninstall commoninstall

`

1704

1695

`.PHONY: gdbhooks

`

1705

1696

``