Skip to content

Commit e5c125d

Browse files
committed
update espressif makefile formatting
1 parent 7ba5513 commit e5c125d

File tree

1 file changed

+95
-95
lines changed

1 file changed

+95
-95
lines changed

ports/espressif/Makefile

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -71,67 +71,69 @@ endif
7171
# CFLAGS
7272
#######################################
7373

74-
INC += -I.\
75-
-I./boards \
76-
-I./boards/$(BOARD) \
77-
-I./peripherals \
78-
-I../.. \
79-
-I../../lib/mp-readline \
80-
-I../../lib/tinyusb/src \
81-
-I../../supervisor/shared/usb \
82-
-I$(BUILD) \
83-
-I$(BUILD)/genhdr \
84-
-I$(BUILD)/esp-idf/config \
85-
-isystem esp-idf \
86-
-isystem esp-idf/components/app_update/include \
87-
-isystem esp-idf/components/bootloader_support/include \
88-
-isystem esp-idf/components/driver/include \
89-
-isystem esp-idf/components/driver/$(IDF_TARGET)/include \
90-
-isystem esp-idf/components/$(IDF_TARGET)/include \
91-
-isystem esp-idf/components/esp_adc_cal/include \
92-
-isystem esp-idf/components/esp_common/include \
93-
-isystem esp-idf/components/esp_event/include \
94-
-isystem esp-idf/components/esp_hw_support/include \
95-
-isystem esp-idf/components/esp_hw_support/include/soc \
96-
-isystem esp-idf/components/esp_netif/include \
97-
-isystem esp-idf/components/esp_pm/include \
98-
-isystem esp-idf/components/esp_ringbuf/include \
99-
-isystem esp-idf/components/esp_rom/include \
100-
-isystem esp-idf/components/esp_system/include \
101-
-isystem esp-idf/components/esp_timer/include \
102-
-isystem esp-idf/components/esp_wifi/include \
103-
-isystem esp-idf/components/freertos/include \
104-
-isystem esp-idf/components/freertos/include/freertos \
105-
-isystem esp-idf/components/freertos/include/esp_additions \
106-
-isystem esp-idf/components/freertos/include/esp_additions/freertos \
107-
-isystem esp-idf/components/freertos/port/$(IDF_TARGET_ARCH)/include \
108-
-isystem esp-idf/components/hal/include \
109-
-isystem esp-idf/components/hal/$(IDF_TARGET)/include \
110-
-isystem esp-idf/components/hal/platform_port/include \
111-
-isystem esp-idf/components/heap/include \
112-
-isystem esp-idf/components/log/include \
113-
-isystem esp-idf/components/lwip/include \
114-
-isystem esp-idf/components/lwip/lwip/src/include \
115-
-isystem esp-idf/components/lwip/port/esp32/include \
116-
-isystem esp-idf/components/mbedtls/esp_crt_bundle/include \
117-
-isystem esp-idf/components/mbedtls/mbedtls/include \
118-
-isystem esp-idf/components/mbedtls/port/include \
119-
-isystem esp-idf/components/newlib/platform_include \
120-
-isystem esp-idf/components/nvs_flash/include \
121-
-isystem esp-idf/components/soc/include \
122-
-isystem esp-idf/components/soc/$(IDF_TARGET)/include \
123-
-isystem esp-idf/components/spi_flash/include \
124-
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/include \
125-
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/$(IDF_TARGET)/include
74+
INC += \
75+
-I.\
76+
-I./boards \
77+
-I./boards/$(BOARD) \
78+
-I./peripherals \
79+
-I../.. \
80+
-I../../lib/mp-readline \
81+
-I../../lib/tinyusb/src \
82+
-I../../supervisor/shared/usb \
83+
-I$(BUILD) \
84+
-I$(BUILD)/genhdr \
85+
-I$(BUILD)/esp-idf/config \
86+
-isystem esp-idf \
87+
-isystem esp-idf/components/app_update/include \
88+
-isystem esp-idf/components/bootloader_support/include \
89+
-isystem esp-idf/components/driver/include \
90+
-isystem esp-idf/components/driver/$(IDF_TARGET)/include \
91+
-isystem esp-idf/components/$(IDF_TARGET)/include \
92+
-isystem esp-idf/components/esp_adc_cal/include \
93+
-isystem esp-idf/components/esp_common/include \
94+
-isystem esp-idf/components/esp_event/include \
95+
-isystem esp-idf/components/esp_hw_support/include \
96+
-isystem esp-idf/components/esp_hw_support/include/soc \
97+
-isystem esp-idf/components/esp_netif/include \
98+
-isystem esp-idf/components/esp_pm/include \
99+
-isystem esp-idf/components/esp_ringbuf/include \
100+
-isystem esp-idf/components/esp_rom/include \
101+
-isystem esp-idf/components/esp_system/include \
102+
-isystem esp-idf/components/esp_timer/include \
103+
-isystem esp-idf/components/esp_wifi/include \
104+
-isystem esp-idf/components/freertos/include \
105+
-isystem esp-idf/components/freertos/include/freertos \
106+
-isystem esp-idf/components/freertos/include/esp_additions \
107+
-isystem esp-idf/components/freertos/include/esp_additions/freertos \
108+
-isystem esp-idf/components/freertos/port/$(IDF_TARGET_ARCH)/include \
109+
-isystem esp-idf/components/hal/include \
110+
-isystem esp-idf/components/hal/$(IDF_TARGET)/include \
111+
-isystem esp-idf/components/hal/platform_port/include \
112+
-isystem esp-idf/components/heap/include \
113+
-isystem esp-idf/components/log/include \
114+
-isystem esp-idf/components/lwip/include \
115+
-isystem esp-idf/components/lwip/lwip/src/include \
116+
-isystem esp-idf/components/lwip/port/esp32/include \
117+
-isystem esp-idf/components/mbedtls/esp_crt_bundle/include \
118+
-isystem esp-idf/components/mbedtls/mbedtls/include \
119+
-isystem esp-idf/components/mbedtls/port/include \
120+
-isystem esp-idf/components/newlib/platform_include \
121+
-isystem esp-idf/components/nvs_flash/include \
122+
-isystem esp-idf/components/soc/include \
123+
-isystem esp-idf/components/soc/$(IDF_TARGET)/include \
124+
-isystem esp-idf/components/spi_flash/include \
125+
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/include \
126+
-isystem esp-idf/components/$(IDF_TARGET_ARCH)/$(IDF_TARGET)/include
126127

127128
# See https://github.com/espressif/esp-idf/issues/6906
128129
ifeq ($(IDF_TARGET),esp32c3)
129130
CFLAGS += -include "esp32c3_fix.h"
130131
endif
131132

132-
CFLAGS += -DHAVE_CONFIG_H \
133-
-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" \
134-
-DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX
133+
CFLAGS += \
134+
-DHAVE_CONFIG_H \
135+
-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" \
136+
-DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX
135137

136138
# Make our canary value match FreeRTOS's
137139
# This define is in FreeRTOS as tskSTACK_FILL_BYTE 0xa5U which we expand out to a full word.
@@ -161,35 +163,38 @@ endif
161163

162164
LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-Map=$@.map -Wl,-cref -Wl,--undefined=uxTopUsedPriority
163165

164-
LDFLAGS += -L$(BUILD)/esp-idf/esp-idf/esp_system/ld \
165-
-Lesp-idf/components/esp_rom/$(IDF_TARGET)/ld \
166-
-Lesp-idf/components/soc/$(IDF_TARGET)/ld \
167-
-Tmemory.ld \
168-
-Tsections.ld \
169-
-T$(IDF_TARGET).peripherals.ld \
170-
-T$(IDF_TARGET).rom.ld \
171-
-T$(IDF_TARGET).rom.api.ld \
172-
-T$(IDF_TARGET).rom.libgcc.ld \
173-
-T$(IDF_TARGET).rom.newlib-nano.ld
166+
LDFLAGS += \
167+
-L$(BUILD)/esp-idf/esp-idf/esp_system/ld \
168+
-Lesp-idf/components/esp_rom/$(IDF_TARGET)/ld \
169+
-Lesp-idf/components/soc/$(IDF_TARGET)/ld \
170+
-Tmemory.ld \
171+
-Tsections.ld \
172+
-T$(IDF_TARGET).peripherals.ld \
173+
-T$(IDF_TARGET).rom.ld \
174+
-T$(IDF_TARGET).rom.api.ld \
175+
-T$(IDF_TARGET).rom.libgcc.ld \
176+
-T$(IDF_TARGET).rom.newlib-nano.ld \
177+
-Wl,-Bstatic \
178+
-Wl,--no-warn-mismatch \
179+
-Wl,--build-id=none \
180+
-fno-rtti
174181

175182
ifeq ($(IDF_TARGET),esp32c3)
176-
LDFLAGS += -Tesp32c3.rom.newlib.ld \
177-
-Tesp32c3.rom.version.ld \
178-
-Tesp32c3.rom.eco3.ld
183+
LDFLAGS += \
184+
-Tesp32c3.rom.newlib.ld \
185+
-Tesp32c3.rom.version.ld \
186+
-Tesp32c3.rom.eco3.ld
179187
else ifeq ($(IDF_TARGET),esp32s2)
180-
LDFLAGS += -T$(IDF_TARGET).rom.newlib-data.ld \
181-
-T$(IDF_TARGET).rom.newlib-funcs.ld \
182-
-T$(IDF_TARGET).rom.spiflash.ld
188+
LDFLAGS += \
189+
-T$(IDF_TARGET).rom.newlib-data.ld \
190+
-T$(IDF_TARGET).rom.newlib-funcs.ld \
191+
-T$(IDF_TARGET).rom.spiflash.ld
183192
else ifeq ($(IDF_TARGET),esp32s3)
184-
LDFLAGS += -Tesp32s3.rom.newlib.ld \
185-
-Tesp32s3.rom.version.ld
193+
LDFLAGS += \
194+
-Tesp32s3.rom.newlib.ld \
195+
-Tesp32s3.rom.version.ld
186196
endif
187197

188-
LDFLAGS += -Wl,-Bstatic \
189-
-Wl,--no-warn-mismatch \
190-
-Wl,--build-id=none \
191-
-fno-rtti
192-
193198
LIBS := -lgcc -lc -lstdc++
194199

195200
# Use toolchain libm if we're not using our own.
@@ -229,16 +234,15 @@ SRC_C += \
229234
peripherals/timer.c \
230235
peripherals/$(IDF_TARGET)/pins.c
231236

237+
ifneq ($(IDF_TARGET),esp32c3)
238+
SRC_C += \
239+
peripherals/pcnt.c \
240+
peripherals/touch.c
232241
ifeq ($(IDF_TARGET),esp32s2)
233242
SRC_C += \
234243
cam.c \
235244
i2s_lcd_esp32s2_driver.c
236245
endif
237-
238-
ifneq ($(IDF_TARGET),esp32c3)
239-
SRC_C += \
240-
peripherals/pcnt.c \
241-
peripherals/touch.c
242246
endif
243247

244248
$(BUILD)/i2s_lcd_esp32s2_driver.o: CFLAGS += -Wno-sign-compare
@@ -247,16 +251,15 @@ ifneq ($(CIRCUITPY_USB),0)
247251
SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
248252
endif
249253

250-
SRC_S =
251-
252-
SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
253-
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
254-
$(addprefix common-hal/, $(SRC_COMMON_HAL))
255-
256-
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
257-
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
258-
$(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))
254+
SRC_COMMON_HAL_EXPANDED = \
255+
$(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \
256+
$(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \
257+
$(addprefix common-hal/, $(SRC_COMMON_HAL))
259258

259+
SRC_SHARED_MODULE_EXPANDED = \
260+
$(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
261+
$(addprefix shared-module/, $(SRC_SHARED_MODULE)) \
262+
$(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL))
260263

261264
ifneq ($(FROZEN_MPY_DIR),)
262265
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')
@@ -270,7 +273,6 @@ ifeq ($(INTERNAL_LIBM),1)
270273
OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o))
271274
endif
272275
OBJ += $(addprefix $(BUILD)/, $(SRC_CIRCUITPY_COMMON:.c=.o))
273-
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.S=.o))
274276
OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o))
275277

276278
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
@@ -280,8 +282,6 @@ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -DESP32
280282

281283
# List of sources for qstr extraction
282284
SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_MOD) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)
283-
# Sources that only hold QSTRs after pre-processing.
284-
SRC_QSTR_PREPROCESSOR +=
285285

286286
# IDF build commands
287287
IDF_PATH = $(realpath ./esp-idf)

0 commit comments

Comments
 (0)