1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp8266/Makefile.include

70 lines
2.5 KiB
Makefile
Raw Normal View History

2018-09-05 02:39:50 +02:00
# check some environment variables first
ifndef ESP8266_RTOS_SDK_DIR
2019-12-12 13:46:20 +01:00
$(info ESP8266_RTOS_SDK_DIR should be defined as /path/to/sdk directory)
$(info ESP8266_RTOS_SDK_DIR is set by default to /opt/esp/ESP8266-RTOS-SDK)
export ESP8266_RTOS_SDK_DIR=/opt/esp/ESP8266-RTOS-SDK
endif
2019-12-12 13:46:20 +01:00
ESP_SDK_DIR = $(ESP8266_RTOS_SDK_DIR)
2019-12-12 13:46:20 +01:00
# With the '-Os' option, char arrays have not to be 32-bit word aligned. This
# leads to an alignment exception when the address of a char array is assigned
# to an 'uint32_t' pointer and the pointer is used for the access.
CFLAGS_OPT ?= -O2
2018-09-05 02:39:50 +02:00
2019-12-12 13:46:20 +01:00
# ESP8266 specific flashing options
FLASH_CHIP = esp8266
FLASH_OPTS = --version 3
FLASH_MODE = dout # DO NOT CHANGE, ESP8266/ESP8285 modules only work with dout
FLASH_FREQ = 26m # DO NOT CHANGE
FLASH_SIZE ?= 1
BOOTLOADER_POS = 0x0000
2019-09-05 13:35:58 +02:00
2019-12-12 13:46:20 +01:00
include $(RIOTCPU)/esp_common/Makefile.include
2018-09-05 02:39:50 +02:00
# regular Makefile
TARGET_ARCH_ESP8266 ?= xtensa-esp8266-elf
TARGET_ARCH ?= $(TARGET_ARCH_ESP8266)
2018-09-05 02:39:50 +02:00
PSEUDOMODULES += esp_sw_timer
INCLUDES += -I$(RIOTCPU)/$(CPU)
2019-09-05 13:35:58 +02:00
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
2018-09-05 02:39:50 +02:00
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor
2019-09-05 13:35:58 +02:00
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/bootloader_support/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/esp8266/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/esp8266/include/esp8266
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/heap/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/log/include
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/bootloader_support/include/
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/esp8266/include
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/esp8266/include/esp8266
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/heap/include
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/heap/port/esp8266/include
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/nvs_flash/include
INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/spi_flash/include
2019-09-05 13:35:58 +02:00
2019-12-12 13:46:20 +01:00
CFLAGS += -D__ESP_FILE__=__FILE__
2019-09-05 13:35:58 +02:00
2020-06-25 10:17:10 +02:00
ifneq (,$(filter esp_gdbstub,$(USEMODULE)))
GDBSTUB_DIR ?= $(RIOTCPU)/$(CPU)/vendor/esp-gdbstub
CFLAGS += -DGDBSTUB_BREAK_ON_INIT=1)
INCLUDES += -I$(GDBSTUB_DIR)
endif
ifneq (,$(filter esp_now,$(USEMODULE)))
ARCHIVES += -lespnow
2020-06-25 10:17:10 +02:00
endif
ARCHIVES += -lgcc -lwpa -lcore -lnet80211 -lphy -lpp -lstdc++
2019-09-05 13:35:58 +02:00
LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ld/esp8266.rom.ld
LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ld/esp8266.riot-os.ld
LINKFLAGS += -T$(RIOTCPU)/$(CPU)/ld/esp8266.peripherals.ld
LINKFLAGS += -Wl,-wrap=pp_attach
LINKFLAGS += -Wl,-wrap=pm_attach