# HG changeset patch # Parent 4833ae6869097a09339ca61d543b7ed1e8823171 Issue #23404: Add make BOOT="#" option to disable regenerating existing files diff -r 4833ae686909 Makefile.pre.in --- a/Makefile.pre.in Tue Sep 13 10:08:10 2016 +0200 +++ b/Makefile.pre.in Tue Sep 13 10:55:22 2016 +0000 @@ -246,6 +246,10 @@ COVERAGE_REPORT=$(abs_builddir)/lcov-report COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report" +# Run to avoid regenerating existing files, as an +# alternative to the "make touch" rule. +BOOT= + # === Definitions added by makesetup === @@ -718,7 +722,7 @@ $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h Python/importlib.h: @GENERATED_COMMENT@ $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib Python/marshal.c - ./Programs/_freeze_importlib \ + $(BOOT)./Programs/_freeze_importlib \ $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h @@ -780,10 +784,10 @@ $(IO_OBJS): $(IO_H) $(GRAMMAR_H): @GENERATED_COMMENT@ $(GRAMMAR_INPUT) $(PGEN) - @$(MKDIR_P) Include - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + @$(BOOT)$(MKDIR_P) Include + $(BOOT)$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) $(GRAMMAR_C): @GENERATED_COMMENT@ $(GRAMMAR_H) - touch $(GRAMMAR_C) + $(BOOT)touch $(GRAMMAR_C) $(PGEN): $(PGENOBJS) $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) @@ -800,15 +804,15 @@ Parser/pgenmain.o: $(srcdir)/Include/parsetok.h $(AST_H): $(AST_ASDL) $(ASDLGEN_FILES) - $(MKDIR_P) $(AST_H_DIR) - $(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL) + $(BOOT)$(MKDIR_P) $(AST_H_DIR) + $(BOOT)$(ASDLGEN) -h $(AST_H_DIR) $(AST_ASDL) $(AST_C): $(AST_H) $(AST_ASDL) $(ASDLGEN_FILES) - $(MKDIR_P) $(AST_C_DIR) - $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) + $(BOOT)$(MKDIR_P) $(AST_C_DIR) + $(BOOT)$(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) $(OPCODE_H): $(srcdir)/Lib/opcode.py $(OPCODE_H_SCRIPT) - $(OPCODE_H_GEN) + $(BOOT)$(OPCODE_H_GEN) Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) @@ -861,7 +865,7 @@ Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) - $(PYTHON_FOR_GEN) $(OPCODETARGETGEN) $(OPCODETARGETS_H) + $(BOOT)$(PYTHON_FOR_GEN) $(OPCODETARGETGEN) $(OPCODETARGETS_H) Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h @@ -881,7 +885,7 @@ Objects/typeobject.o: Objects/typeslots.inc Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py - $(PYTHON_FOR_GEN) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h Objects/typeslots.inc + $(BOOT)$(PYTHON_FOR_GEN) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h Objects/typeslots.inc ############################################################################ # Header files @@ -1560,8 +1564,8 @@ # This fixes up the mtimes of checked-in generated files, assuming that they # only *appear* to be outdated because of checkout order. -# This is run while preparing a source release tarball, and can be run manually -# to avoid bootstrap issues. +# This is run while preparing a source release tarball. It can also be run +# manually to avoid bootstrap issues, as an alternative to setting BOOT="#". touch: cd $(srcdir); \ hg --config extensions.touch=Tools/hg/hgtouch.py touch -v