@ -1,8 +1,13 @@
# where py object files go (they have a name prefix to prevent filename clashes)
PY_BUILD = $( BUILD) /py
# file containing qstr defs for the core Python bit
# where autogenerated header files go
HEADER_BUILD = $( BUILD) /includes/build
# where autogenerated py header files go
HEADER_PY_BUILD = $( HEADER_BUILD) /py
# file containing qstr defs for the core Python bit
PY_QSTR_DEFS = $( PY_SRC) /qstrdefs.h
# py object files
@ -98,26 +103,25 @@ PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
FORCE :
.PHONY : FORCE
$( PY_BUILD)/py-version.h: FORCE
$( HEADER_ PY_BUILD)/py-version.h: FORCE
$( Q) $( PY_SRC) /py-version.sh > $@ .tmp
$( Q) if [ -f " $@ " ] && cmp -s $@ $@ .tmp; then rm $@ .tmp; else echo " Generating $@ " ; mv $@ .tmp $@ ; fi
# qstr data
# Adding an order only dependency on $( PY_BUILD) causes $(PY_BUILD) to get
# Adding an order only dependency on $( HEADER_ PY_BUILD) causes $(HEADER_ PY_BUILD) to get
# created before we run the script to generate the .h
$(PY_BUILD)/qstrdefs.generated.h : | $( PY_BUILD ) /
$(PY_BUILD)/qstrdefs.generated.h : $( PY_QSTR_DEFS ) $( QSTR_DEFS ) $( PY_SRC ) /makeqstrdata .py mpconfigport .h $( PY_SRC ) /mpconfig .h
$(HEADER_PY_BUILD)/qstrdefs.generated.h : $( PY_QSTR_DEFS ) $( QSTR_DEFS ) $( PY_SRC ) /makeqstrdata .py mpconfigport .h $( PY_SRC ) /mpconfig .h | $( HEADER_PY_BUILD )
$( ECHO) " makeqstrdata $( PY_QSTR_DEFS) $( QSTR_DEFS) "
$( CPP) $( CFLAGS) $( PY_QSTR_DEFS) -o $( PY_BUILD) /qstrdefs.preprocessed.h
$( Q) $( PYTHON) $( PY_SRC) /makeqstrdata.py $( PY_BUILD) /qstrdefs.preprocessed.h $( QSTR_DEFS) > $@
$( CPP) $( CFLAGS) $( PY_QSTR_DEFS) -o $( HEADER_ PY_BUILD) /qstrdefs.preprocessed.h
$( Q) $( PYTHON) $( PY_SRC) /makeqstrdata.py $( HEADER_ PY_BUILD) /qstrdefs.preprocessed.h $( QSTR_DEFS) > $@
# We don't know which source files actually need the generated.h (since
# it is #included from str.h). The compiler generated dependencies will cause
# the right .o's to get recompiled if the generated.h file changes. Adding
# an order-only dependendency to all of the .o's will cause the generated .h
# to get built before we try to compile any of them.
$(PY_O) : | $( PY_BUILD) /qstrdefs .generated .h $( PY_BUILD) /py -version .h
$(PY_O) : | $( HEADER_ PY_BUILD) /qstrdefs .generated .h $( HEADER_ PY_BUILD) /py -version .h
# emitters