diff --git a/bare-arm/Makefile b/bare-arm/Makefile index ace508ebd8996bedfe9ee1f1def329e790b622db..f9c9fb9a3141854803a662d1b74f58b1e358cc72 100644 --- a/bare-arm/Makefile +++ b/bare-arm/Makefile @@ -10,7 +10,7 @@ CROSS_COMPILE = arm-none-eabi- INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 $(CFLAGS_CORTEX_M4) $(COPT) diff --git a/py/mkrules.mk b/py/mkrules.mk index 63a98a8ec6af520dcb6c7f29ff8d9d677fabd0f5..9592d6c590454d751e9af496b57ea5dc48d6563d 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -51,24 +51,21 @@ $(BUILD)/%.pp: %.c # The following rule uses | to create an order only prereuisite. Order only # prerequisites only get built if they don't exist. They don't cause timestamp -# checkng to be performed. +# checking to be performed. # # $(sort $(var)) removes duplicates # # The net effect of this, is it causes the objects to depend on the -# object directories (but only for existance), and the object directories +# object directories (but only for existence), and the object directories # will be created if they don't exist. OBJ_DIRS = $(sort $(dir $(OBJ))) -$(OBJ): $(HEADER_PY_BUILD)/qstrdefs.generated.h | $(OBJ_DIRS) +$(OBJ): $(HEADER_BUILD)/qstrdefs.generated.h | $(OBJ_DIRS) $(OBJ_DIRS): $(MKDIR) -p $@ $(HEADER_BUILD): $(MKDIR) -p $@ -$(HEADER_PY_BUILD): - $(MKDIR) -p $@ - ifneq ($(PROG),) # Build a standalone executable (unix and unix-cpy do this) diff --git a/py/py.mk b/py/py.mk index 01a5fd1c2bb0d850e551ea301051271ed5e9aed8..dd6ddd0b35cca7c3906a7536f8a7af5fb21b2358 100644 --- a/py/py.mk +++ b/py/py.mk @@ -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 diff --git a/py/qstr.c b/py/qstr.c index 2b14065fa6fa0d60c017080cd4fd9450dd0214dc..f9f63da3914094aeaa8a1fe26f2224ea2448fe72 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -60,7 +60,7 @@ const static qstr_pool_t const_pool = { (const byte*) "\0\0\0\0", // invalid/no qstr has empty data (const byte*) "\0\0\0\0", // empty qstr #define Q(id, str) str, -#include "build/py/qstrdefs.generated.h" +#include "genhdr/qstrdefs.generated.h" #undef Q }, }; diff --git a/py/qstr.h b/py/qstr.h index 6bcb1707fbdae89243c9db232995e8c820cf1203..7cb6ae2e98d2f78e19511229106e9d2ec410c6f7 100644 --- a/py/qstr.h +++ b/py/qstr.h @@ -8,7 +8,7 @@ enum { MP_QSTR_NULL = 0, // indicates invalid/no qstr MP_QSTR_ = 1, // the empty qstr #define Q(id, str) MP_QSTR_##id, -#include "build/py/qstrdefs.generated.h" +#include "genhdr/qstrdefs.generated.h" #undef Q MP_QSTR_number_of, }; diff --git a/stm/Makefile b/stm/Makefile index 384ecd6304ed31ff3ac7e7f83c2d1a04ba05f2e8..ab4d0ff3ff695cb6e14955aec776983749499be9 100644 --- a/stm/Makefile +++ b/stm/Makefile @@ -19,7 +19,7 @@ CROSS_COMPILE = arm-none-eabi- INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) INC += -I$(CMSIS_DIR) INC += -I$(STMPERIPH_DIR) INC += -I$(STMUSB_DIR) diff --git a/stmhal/Makefile b/stmhal/Makefile index 27caaca0166106255683cdb9c05c04e1f1379f44..5501c4b8d9aca33d2e3cfba52fbf49c407b7c59a 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -18,7 +18,7 @@ CROSS_COMPILE = arm-none-eabi- INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) INC += -I$(CMSIS_DIR)/inc INC += -I$(CMSIS_DIR)/devinc INC += -I$(HAL_DIR)/inc diff --git a/stmhal/adc.c b/stmhal/adc.c index dafa3f7bce4bd421cd5dc533b5df18457ee9b2e3..b0a7a0749add198a5da5f1afb1eb6bc25d62d19a 100644 --- a/stmhal/adc.c +++ b/stmhal/adc.c @@ -10,7 +10,7 @@ #include "runtime.h" #include "adc.h" #include "pin.h" -#include "build/pins.h" +#include "genhdr/pins.h" #include "timer.h" // Usage Model: diff --git a/stmhal/led.c b/stmhal/led.c index 5c2d2c60a4fe0be018a64783c91aac7264e0dab5..52a787eedee5f2e8a17d47eb990a11b6f41fa3a0 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -10,7 +10,7 @@ #include "timer.h" #include "led.h" #include "pin.h" -#include "build/pins.h" +#include "genhdr/pins.h" typedef struct _pyb_led_obj_t { mp_obj_base_t base; diff --git a/stmhal/main.c b/stmhal/main.c index 2d7e76172f0dc1c153378637098eae8f6650eebb..4fa5b2a436ff2ed30098174a8b86ac1d37145c71 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -134,7 +134,7 @@ static const char fresh_main_py[] = ; static const char fresh_pybcdc_inf[] = -#include "build/pybcdc_inf.h" +#include "genhdr/pybcdc_inf.h" ; static const char fresh_readme_txt[] = diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c index 9821e6a92934d19383082d4bd5dcc5249aee6cb0..3f9482ec589749f682fe1de0f73f38c4160ffb1e 100644 --- a/stmhal/pyexec.c +++ b/stmhal/pyexec.c @@ -22,7 +22,7 @@ #include "readline.h" #include "pyexec.h" #include "usb.h" -#include "build/py/py-version.h" +#include "genhdr/py-version.h" pyexec_mode_kind_t pyexec_mode_kind = PYEXEC_MODE_FRIENDLY_REPL; STATIC bool repl_display_debugging_info = 0; diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index 994eb26c2a306906745299a3107ef3b733064a2c..4c8e3d990bd27dbcb0a6d95bea1dbe9fb3b3895e 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -9,7 +9,7 @@ #include "runtime.h" #include "sdcard.h" #include "pin.h" -#include "build/pins.h" +#include "genhdr/pins.h" #if MICROPY_HW_HAS_SDCARD diff --git a/stmhal/usrsw.c b/stmhal/usrsw.c index 5133392ccd91ea3eb209010228f4fe5cced8ce29..0ab407cd96ff5256b4c77e780b7196821123d022 100644 --- a/stmhal/usrsw.c +++ b/stmhal/usrsw.c @@ -11,7 +11,7 @@ #include "exti.h" #include "gpio.h" #include "pin.h" -#include "build/pins.h" +#include "genhdr/pins.h" // Usage Model: // diff --git a/teensy/Makefile b/teensy/Makefile index bd01f7e2b1179fbb498d3059c6dc12915f2d8ccd..00f3514724c9269670b5a33128b85eeb4050fda5 100644 --- a/teensy/Makefile +++ b/teensy/Makefile @@ -20,7 +20,7 @@ CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -fsingle-precision-c INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) INC += -I$(CORE_PATH) CFLAGS = $(INC) -Wall -ansi -std=gnu99 $(CFLAGS_CORTEX_M4) diff --git a/unix-cpy/Makefile b/unix-cpy/Makefile index 8db8c2069ab006841a64009dde233e72456352f5..0376932d6a012e0d5323790a10ff54ce5ed76d2f 100644 --- a/unix-cpy/Makefile +++ b/unix-cpy/Makefile @@ -8,7 +8,7 @@ include ../py/py.mk INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) # compiler settings CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -DUNIX diff --git a/unix/Makefile b/unix/Makefile index 1a29363c91f2c5f85f48aa6d952192c8426fcb12..ec02ad5004cde74bf04cd7544bbc47ea24c3bf16 100644 --- a/unix/Makefile +++ b/unix/Makefile @@ -12,7 +12,7 @@ include ../py/py.mk INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) # compiler settings CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) diff --git a/unix/main.c b/unix/main.c index e582244b394e8a5173b8d8f1f03a7d72977e5148..b9b8fe0b9fe9445155d08e906ffbd52df7dc9c15 100644 --- a/unix/main.c +++ b/unix/main.c @@ -22,7 +22,7 @@ #include "runtime.h" #include "repl.h" #include "gc.h" -#include "build/py/py-version.h" +#include "genhdr/py-version.h" #if MICROPY_USE_READLINE #include diff --git a/windows/Makefile b/windows/Makefile index ad4c82c128e7a0ed0a3d2c426053d89c40b3f5a9..651de7c7f12c3898a7cf9f054ebe884d8a66c1b9 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -11,7 +11,7 @@ include ../py/py.mk INC = -I. INC += -I$(PY_SRC) -INC += -I$(BUILD)/includes +INC += -I$(BUILD) # compiler settings CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -DUNIX