|
|
@ -2,10 +2,7 @@ |
|
|
|
PY_BUILD = $(BUILD)/py |
|
|
|
|
|
|
|
# where autogenerated header files go
|
|
|
|
HEADER_BUILD = $(BUILD)/includes/build |
|
|
|
|
|
|
|
# where autogenerated py header files go
|
|
|
|
HEADER_PY_BUILD = $(HEADER_BUILD)/py |
|
|
|
HEADER_BUILD = $(BUILD)/genhdr |
|
|
|
|
|
|
|
# file containing qstr defs for the core Python bit
|
|
|
|
PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h |
|
|
@ -105,25 +102,26 @@ PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME)) |
|
|
|
FORCE: |
|
|
|
.PHONY: FORCE |
|
|
|
|
|
|
|
$(HEADER_PY_BUILD)/py-version.h: FORCE |
|
|
|
$(HEADER_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 $(HEADER_PY_BUILD) causes $(HEADER_PY_BUILD) to get
|
|
|
|
# Adding an order only dependency on $(HEADER_BUILD) causes $(HEADER_BUILD) to get
|
|
|
|
# created before we run the script to generate the .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) |
|
|
|
$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(PY_SRC)/makeqstrdata.py mpconfigport.h $(PY_SRC)/mpconfig.h | $(HEADER_BUILD) |
|
|
|
$(ECHO) "CPP $<" |
|
|
|
$(Q)$(CPP) $(CFLAGS) $(PY_QSTR_DEFS) -o $(HEADER_BUILD)/qstrdefs.preprocessed.h |
|
|
|
$(ECHO) "makeqstrdata $(PY_QSTR_DEFS) $(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) > $@ |
|
|
|
$(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_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): | $(HEADER_PY_BUILD)/qstrdefs.generated.h $(HEADER_PY_BUILD)/py-version.h |
|
|
|
$(PY_O): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/py-version.h |
|
|
|
|
|
|
|
# emitters
|
|
|
|
|
|
|
|