@@ -49,45 +49,47 @@ INC += -I../lib/mp-readline
49
49
INC += -I../lib/netutils
50
50
INC += -I../lib/timeutils
51
51
INC += -I$(BUILD )
52
- INC += -I$(ESPCOMP ) /bootloader_support/include
53
- INC += -I$(ESPCOMP ) /driver/include
54
- INC += -I$(ESPCOMP ) /driver/include/driver
55
- INC += -I$(ESPCOMP ) /nghttp/port/include
56
- INC += -I$(ESPCOMP ) /nghttp/nghttp2/lib/includes
57
- INC += -I$(ESPCOMP ) /esp32/include
58
- INC += -I$(ESPCOMP ) /soc/include
59
- INC += -I$(ESPCOMP ) /soc/esp32/include
60
- INC += -I$(ESPCOMP ) /ethernet/include
61
- INC += -I$(ESPCOMP ) /expat/include/expat
62
- INC += -I$(ESPCOMP ) /expat/port/include
63
- INC += -I$(ESPCOMP ) /heap/include
64
- INC += -I$(ESPCOMP ) /json/include
65
- INC += -I$(ESPCOMP ) /json/port/include
66
- INC += -I$(ESPCOMP ) /log/include
67
- INC += -I$(ESPCOMP ) /newlib/include
68
- INC += -I$(ESPCOMP ) /nvs_flash/include
69
- INC += -I$(ESPCOMP ) /freertos/include
70
- INC += -I$(ESPCOMP ) /tcpip_adapter/include
71
- INC += -I$(ESPCOMP ) /lwip/include/lwip
72
- INC += -I$(ESPCOMP ) /lwip/include/lwip/port
73
- INC += -I$(ESPCOMP ) /lwip/include/lwip/posix
74
- INC += -I$(ESPCOMP ) /mbedtls/include
75
- INC += -I$(ESPCOMP ) /mbedtls/port/include
76
- INC += -I$(ESPCOMP ) /spi_flash/include
77
- INC += -I$(ESPCOMP ) /vfs/include
78
- INC += -I$(ESPCOMP ) /newlib/platform_include
79
- INC += -I$(ESPCOMP ) /xtensa-debug-module/include
80
- INC += -I$(ESPCOMP ) /wpa_supplicant/include
81
- INC += -I$(ESPCOMP ) /wpa_supplicant/port/include
82
- INC += -I$(ESPCOMP ) /ethernet/include
83
- INC += -I$(ESPCOMP ) /app_trace/include
84
-
85
- CFLAGS = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM $(INC )
52
+
53
+ INC_ESPCOMP += -I$(ESPCOMP ) /bootloader_support/include
54
+ INC_ESPCOMP += -I$(ESPCOMP ) /driver/include
55
+ INC_ESPCOMP += -I$(ESPCOMP ) /driver/include/driver
56
+ INC_ESPCOMP += -I$(ESPCOMP ) /nghttp/port/include
57
+ INC_ESPCOMP += -I$(ESPCOMP ) /nghttp/nghttp2/lib/includes
58
+ INC_ESPCOMP += -I$(ESPCOMP ) /esp32/include
59
+ INC_ESPCOMP += -I$(ESPCOMP ) /soc/include
60
+ INC_ESPCOMP += -I$(ESPCOMP ) /soc/esp32/include
61
+ INC_ESPCOMP += -I$(ESPCOMP ) /ethernet/include
62
+ INC_ESPCOMP += -I$(ESPCOMP ) /expat/include/expat
63
+ INC_ESPCOMP += -I$(ESPCOMP ) /expat/port/include
64
+ INC_ESPCOMP += -I$(ESPCOMP ) /heap/include
65
+ INC_ESPCOMP += -I$(ESPCOMP ) /json/include
66
+ INC_ESPCOMP += -I$(ESPCOMP ) /json/port/include
67
+ INC_ESPCOMP += -I$(ESPCOMP ) /log/include
68
+ INC_ESPCOMP += -I$(ESPCOMP ) /newlib/include
69
+ INC_ESPCOMP += -I$(ESPCOMP ) /nvs_flash/include
70
+ INC_ESPCOMP += -I$(ESPCOMP ) /freertos/include
71
+ INC_ESPCOMP += -I$(ESPCOMP ) /tcpip_adapter/include
72
+ INC_ESPCOMP += -I$(ESPCOMP ) /lwip/include/lwip
73
+ INC_ESPCOMP += -I$(ESPCOMP ) /lwip/include/lwip/port
74
+ INC_ESPCOMP += -I$(ESPCOMP ) /lwip/include/lwip/posix
75
+ INC_ESPCOMP += -I$(ESPCOMP ) /mbedtls/include
76
+ INC_ESPCOMP += -I$(ESPCOMP ) /mbedtls/port/include
77
+ INC_ESPCOMP += -I$(ESPCOMP ) /spi_flash/include
78
+ INC_ESPCOMP += -I$(ESPCOMP ) /vfs/include
79
+ INC_ESPCOMP += -I$(ESPCOMP ) /newlib/platform_include
80
+ INC_ESPCOMP += -I$(ESPCOMP ) /xtensa-debug-module/include
81
+ INC_ESPCOMP += -I$(ESPCOMP ) /wpa_supplicant/include
82
+ INC_ESPCOMP += -I$(ESPCOMP ) /wpa_supplicant/port/include
83
+ INC_ESPCOMP += -I$(ESPCOMP ) /ethernet/include
84
+ INC_ESPCOMP += -I$(ESPCOMP ) /app_trace/include
85
+
86
+ CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM
87
+ CFLAGS = $(CFLAGS_BASE ) $(INC ) $(INC_ESPCOMP )
86
88
CFLAGS += -DIDF_VER=\"$(IDF_VER ) \"
87
89
CFLAGS += $(CFLAGS_MOD )
88
90
89
91
# this is what ESPIDF uses for c++ compilation
90
- CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC )
92
+ CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC ) $( INC_ESPCOMP )
91
93
92
94
LDFLAGS = -nostdlib -Map=$(@:.elf=.map ) --cref
93
95
LDFLAGS += --gc-sections -static -EL
@@ -274,12 +276,14 @@ ESPIDF_EXPAT_O = $(addprefix $(ESPCOMP)/expat/,\
274
276
275
277
# Assembler .S files need only basic flags, and in particular should not have
276
278
# -Os because that generates subtly different code.
279
+ # We also need custom CFLAGS for .c files because FreeRTOS has headers with
280
+ # generic names (eg queue.h) which can clash with other files in the port.
277
281
CFLAGS_ASM = -I$(ESPCOMP ) /esp32/include -I$(ESPCOMP ) /soc/esp32/include -I$(ESPCOMP ) /freertos/include/freertos -I.
278
282
$(BUILD ) /$(ESPCOMP ) /freertos/portasm.o : CFLAGS = $(CFLAGS_ASM )
279
283
$(BUILD ) /$(ESPCOMP ) /freertos/xtensa_context.o : CFLAGS = $(CFLAGS_ASM )
280
284
$(BUILD ) /$(ESPCOMP ) /freertos/xtensa_intr_asm.o : CFLAGS = $(CFLAGS_ASM )
281
285
$(BUILD ) /$(ESPCOMP ) /freertos/xtensa_vectors.o : CFLAGS = $(CFLAGS_ASM )
282
- $(BUILD ) /$(ESPCOMP ) /freertos/% .o : CFLAGS += -I$(ESPCOMP ) /freertos/include/freertos
286
+ $(BUILD ) /$(ESPCOMP ) /freertos/% .o : CFLAGS = $( CFLAGS_BASE ) -I. $( INC_ESPCOMP ) -I$(ESPCOMP ) /freertos/include/freertos
283
287
ESPIDF_FREERTOS_O = $(addprefix $(ESPCOMP ) /freertos/,\
284
288
croutine.o \
285
289
event_groups.o \
0 commit comments