diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-04-23 00:58:44 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-04-23 00:58:44 +0000 |
commit | e9ee31706280672e82a9716c4bf9bb72f1d78a1d (patch) | |
tree | f1af2190cecc123362ed2bcbbfe15bc11e649901 /Makefile.pre.in | |
parent | Fix python-gdb.py: get C types on demand (diff) | |
download | cpython-e9ee31706280672e82a9716c4bf9bb72f1d78a1d.tar.gz cpython-e9ee31706280672e82a9716c4bf9bb72f1d78a1d.tar.bz2 cpython-e9ee31706280672e82a9716c4bf9bb72f1d78a1d.zip |
Issue #22359: Avoid recursive $(MAKE); disable running cross-compiled pgen
Patches by Jonas Wagner and Xavier de Gaye.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index c4e8caa4259..f65422e2cfb 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -200,6 +200,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ PYTHON= python$(EXE) BUILDPYTHON= python$(BUILDEXE) +cross_compiling=@cross_compiling@ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ HOST_GNU_TYPE= @host@ @@ -677,13 +678,19 @@ Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h -$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) - @$(MKDIR_P) Include - $(MAKE) $(PGEN) - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) - $(MAKE) $(GRAMMAR_H) - touch $(GRAMMAR_C) +$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) + @$(MKDIR_P) Include + if test "$(cross_compiling)" != "yes"; then \ + $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \ + else \ + cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \ + fi +$(GRAMMAR_C): $(GRAMMAR_H) + if test "$(cross_compiling)" != "yes"; then \ + touch $(GRAMMAR_C); \ + else \ + cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \ + fi $(PGEN): $(PGENOBJS) $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) |