diff --git a/cpu/esp_common/Makefile b/cpu/esp_common/Makefile index 98aa75ff8e..a22cd8e911 100644 --- a/cpu/esp_common/Makefile +++ b/cpu/esp_common/Makefile @@ -1,6 +1,9 @@ # add a list of subdirectories, that should also be build DIRS += periph -DIRS += vendor + +ifneq (,$(filter xtensa%,$(TARGET_ARCH))) + DIRS += vendor +endif ifneq (,$(filter esp_freertos_common,$(USEMODULE))) DIRS += freertos diff --git a/cpu/esp_common/Makefile.dep b/cpu/esp_common/Makefile.dep index 0c83ab724e..445124a84e 100644 --- a/cpu/esp_common/Makefile.dep +++ b/cpu/esp_common/Makefile.dep @@ -20,7 +20,9 @@ ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE))) USEMODULE += stdio_uart endif -USEMODULE += xtensa +ifneq (,$(filter esp8266 esp32 esp32s%,$(CPU))) + USEMODULE += xtensa +endif # Features used by ESP* diff --git a/cpu/esp_common/Makefile.include b/cpu/esp_common/Makefile.include index 33c466081e..df767a915d 100644 --- a/cpu/esp_common/Makefile.include +++ b/cpu/esp_common/Makefile.include @@ -27,9 +27,16 @@ INCLUDES += -I$(RIOTCPU)/esp_common/vendor/esp # Flags -CFLAGS += -Wno-unused-parameter -Wformat=0 -CFLAGS += -mlongcalls -mtext-section-literals -fstrict-volatile-bitfields -CFLAGS += -fdata-sections -ffunction-sections -fzero-initialized-in-bss +CFLAGS += -Wno-unused-parameter +CFLAGS += -Wformat=0 +CFLAGS += -fstrict-volatile-bitfields +CFLAGS += -fdata-sections +CFLAFS += -ffunction-sections +CFLAGS += -fzero-initialized-in-bss + +ifeq (,$(filter esp32c% esp32h%,$(CPU))) + CFLAGS += -mlongcalls -mtext-section-literals +endif OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation @@ -88,11 +95,6 @@ CFLAGS += $(if $(findstring dout,$(FLASH_MODE)),-DFLASH_MODE_DOUT=1) ARCHIVES += -lg -lc LINKFLAGS += $(CFLAGS_OPT) $(CFLAGS_DBG) -#ifneq ($(CPU),esp8266) -# esp8266 flags are added by the SDK pkg in pkg/esp8266_sdk -#LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU) -#LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU)/lib -#endif LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static # use the wrapper functions for calloc to add correct overflow detection missing