-
Notifications
You must be signed in to change notification settings - Fork 345
/
Copy pathcomponent.mk
340 lines (292 loc) · 9.45 KB
/
component.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
#
# "main" pseudo-component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
COMPONENT_ADD_INCLUDEDIRS := . genhdr py esp32 lib lib/utils lib/mp-readline extmod extmod/crypto-algorithms lib/netutils drivers/dht \
lib/timeutils lib/berkeley-db-1.xx/include lib/berkeley-db-1.xx/btree \
lib/berkeley-db-1.xx/db lib/berkeley-db-1.xx/hash lib/berkeley-db-1.xx/man lib/berkeley-db-1.xx/mpool lib/berkeley-db-1.xx/recno \
../curl/include ../curl/lib ../zlib ../libssh2/include ../espmqtt/include ../espmqtt/lib/include ../littlefs
COMPONENT_PRIV_INCLUDEDIRS := . genhdr py esp32 lib
BUILD = $(BUILD_DIR_BASE)
COMPONENT_OWNCLEANTARGET := clean
CFLAGS_MOD =
OBJ_ESPIDF =
SRC_MOD =
DRIVERS_SRC_C =
QSTR_AUTOGEN_DISABLE =
FROZEN_EXTRA_DEPS =
include $(COMPONENT_PATH)/py/mkenv.mk
# qstr definitions (must come before including py.mk)
QSTR_DEFS = $(COMPONENT_PATH)/esp32/qstrdefsport.h
MICROPY_PY_USSL = 0
MICROPY_SSL_AXTLS = 0
ifdef CONFIG_MICROPY_PY_USE_BTREE
MICROPY_PY_BTREE = 1
else
MICROPY_PY_BTREE = 0
endif
MICROPY_FATFS = 0
FROZEN_DIR = $(COMPONENT_PATH)/esp32/scripts
FROZEN_MPY_DIR = $(COMPONENT_PATH)/esp32/modules
# Includes for Qstr&Frozen modules
#---------------------------------
ESPCOMP = $(IDF_PATH)/components
MP_EXTRA_INC += -I.
MP_EXTRA_INC += -I$(COMPONENT_PATH)
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/curl/include
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/libssh2/include
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/zlib
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/espmqtt/include
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/espmqtt/lib/include
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/littlefs
MP_EXTRA_INC += -I$(COMPONENT_PATH)/py
MP_EXTRA_INC += -I$(COMPONENT_PATH)/lib/mp-readline
MP_EXTRA_INC += -I$(COMPONENT_PATH)/lib/netutils
MP_EXTRA_INC += -I$(COMPONENT_PATH)/lib/timeutils
MP_EXTRA_INC += -I$(COMPONENT_PATH)/esp32
MP_EXTRA_INC += -I$(COMPONENT_PATH)/build
MP_EXTRA_INC += -I$(COMPONENT_PATH)/esp32/libs
MP_EXTRA_INC += -I$(BUILD_DIR_BASE)
MP_EXTRA_INC += -I$(BUILD_DIR_BASE)/include
MP_EXTRA_INC += -I$(ESPCOMP)/spiffs/include
MP_EXTRA_INC += -I$(ESPCOMP)/bootloader_support/include
MP_EXTRA_INC += -I$(ESPCOMP)/driver/include
MP_EXTRA_INC += -I$(ESPCOMP)/driver/include/driver
MP_EXTRA_INC += -I$(ESPCOMP)/esp_adc_cal/include
MP_EXTRA_INC += -I$(ESPCOMP)/nghttp/port/include
MP_EXTRA_INC += -I$(ESPCOMP)/nghttp/nghttp2/lib/includes
MP_EXTRA_INC += -I$(ESPCOMP)/esp32/include
MP_EXTRA_INC += -I$(ESPCOMP)/soc/esp32/include
MP_EXTRA_INC += -I$(ESPCOMP)/soc/include
MP_EXTRA_INC += -I$(ESPCOMP)/ethernet/include
MP_EXTRA_INC += -I$(ESPCOMP)/expat/include/expat
MP_EXTRA_INC += -I$(ESPCOMP)/expat/port/include
MP_EXTRA_INC += -I$(ESPCOMP)/json/include
MP_EXTRA_INC += -I$(ESPCOMP)/json/port/include
MP_EXTRA_INC += -I$(ESPCOMP)/log/include
MP_EXTRA_INC += -I$(ESPCOMP)/newlib/include
MP_EXTRA_INC += -I$(ESPCOMP)/nvs_flash/include
MP_EXTRA_INC += -I$(ESPCOMP)/freertos/include
MP_EXTRA_INC += -I$(ESPCOMP)/tcpip_adapter/include
MP_EXTRA_INC += -I$(ESPCOMP)/lwip/include/lwip
MP_EXTRA_INC += -I$(ESPCOMP)/lwip/include/lwip/port
MP_EXTRA_INC += -I$(ESPCOMP)/lwip/include/lwip/posix
MP_EXTRA_INC += -I$(ESPCOMP)/mbedtls/mbedtls/include
MP_EXTRA_INC += -I$(ESPCOMP)/mbedtls/port/include
MP_EXTRA_INC += -I$(ESPCOMP)/spi_flash/include
MP_EXTRA_INC += -I$(ESPCOMP)/wear_levelling/include
MP_EXTRA_INC += -I$(ESPCOMP)/wear_levelling/private_include
MP_EXTRA_INC += -I$(ESPCOMP)/vfs/include
MP_EXTRA_INC += -I$(ESPCOMP)/newlib/platform_include
MP_EXTRA_INC += -I$(ESPCOMP)/xtensa-debug-module/include
MP_EXTRA_INC += -I$(ESPCOMP)/wpa_supplicant/include
MP_EXTRA_INC += -I$(ESPCOMP)/wpa_supplicant/port/include
MP_EXTRA_INC += -I$(ESPCOMP)/ethernet/include
MP_EXTRA_INC += -I$(ESPCOMP)/app_trace/include
MP_EXTRA_INC += -I$(ESPCOMP)/sdmmc/include
MP_EXTRA_INC += -I$(ESPCOMP)/fatfs/src
MP_EXTRA_INC += -I$(ESPCOMP)/heap/include
MP_EXTRA_INC += -I$(ESPCOMP)/openssl/include
MP_EXTRA_INC += -I$(ESPCOMP)/app_update/include
MP_EXTRA_INC += -I$(ESPCOMP)/mdns/include
MP_EXTRA_INC += -I$(ESPCOMP)/esp_https_ota/include
ifdef CONFIG_MICROPY_USE_BLUETOOTH
MP_EXTRA_INC += -I$(ESPCOMP)/bt/include
MP_EXTRA_INC += -I$(ESPCOMP)/bt/bluedroid/api/include
else
ifdef CONFIG_MICROPY_USE_RFCOMM
MP_EXTRA_INC += -I$(ESPCOMP)/bt/include
MP_EXTRA_INC += -I$(ESPCOMP)/bt/bluedroid/api/include
endif
endif
ifdef CONFIG_MICROPY_USE_GPS
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/libnmea/src/nmea
MP_EXTRA_INC += -I$(PROJECT_PATH)/components/libnmea/src/parsers
endif
ifdef CONFIG_MICROPY_USE_REQUESTS
MP_EXTRA_INC += -I$(ESPCOMP)/esp_http_client/include/
endif
ifdef CONFIG_MICROPY_USE_SGP30_SENSOR
MP_EXTRA_INC += -I$(COMPONENT_PATH)/esp32/libs/sgp/sgp30
MP_EXTRA_INC += -I$(COMPONENT_PATH)/esp32/libs/sgp/embedded-common
MP_EXTRA_INC += -I$(COMPONENT_PATH)/esp32/libs/sgp/sgp-common
endif
# CPP macro
# ------------
CPP = $(CC) -E
# ------------
# Clean MicroPython directories/files
# -----------------------------------
MP_CLEAN_EXTRA = $(BUILD_DIR_BASE)/drivers
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/esp32
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/extmod
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/frozen_mpy
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/genhdr
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/home
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/lib
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/micropython/*
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/py
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/frozen_mpy.c
MP_CLEAN_EXTRA += $(BUILD_DIR_BASE)/frozen.c
MP_CLEAN_EXTRA += $(COMPONENT_PATH)/genhdr/qstrdefs.generated.h
# include py core make definitions
# --------------------------------
include $(COMPONENT_PATH)/py/py.mk
#CFLAGS += -DESP_PLATFORM
CFLAGS += $(CFLAGS_MOD)
# List of MicroPython source and object files
# for Qstr generation
# -------------------------------------------
SRC_C = $(addprefix esp32/,\
main.c \
uart.c \
gccollect.c \
mphalport.c \
help.c \
modutime.c \
moduos.c \
machine_timer.c \
machine_pin.c \
machine_touchpad.c \
machine_adc.c \
machine_dac.c \
machine_pwm.c \
machine_uart.c \
modmachine.c \
modnetwork.c \
modsocket.c \
moduhashlib.c \
machine_hw_spi.c \
mpthreadport.c \
mpsleep.c \
machine_rtc.c \
modymodem.c \
machine_hw_i2c.c \
machine_neopixel.c \
machine_dht.c \
machine_ow.c \
)
ifdef CONFIG_MICROPY_USE_DISPLAY
SRC_C += esp32/moddisplay.c
endif
ifdef CONFIG_MICROPY_USE_SGP30_SENSOR
SRC_C += esp32/modsgp30.c
endif
ifdef CONFIG_MICROPY_USE_CURL
SRC_C += esp32/modcurl.c
endif
ifdef CONFIG_MICROPY_USE_REQUESTS
SRC_C += esp32/modrequests.c
endif
ifdef CONFIG_MICROPY_USE_GPS
SRC_C += esp32/machine_gps.c
endif
ifdef CONFIG_MICROPY_USE_SSH
SRC_C += esp32/modssh.c
endif
ifdef CONFIG_MICROPY_USE_MQTT
SRC_C += esp32/modmqtt.c
endif
ifdef CONFIG_MICROPY_USE_GSM
SRC_C += esp32/modgsm.c
endif
ifdef CONFIG_MICROPY_USE_OTA
SRC_C += esp32/modota.c
endif
ifdef CONFIG_MICROPY_USE_MDNS
SRC_C += esp32/network_mdns.c
endif
ifdef CONFIG_MICROPY_USE_ETHERNET
SRC_C += esp32/network_lan.c
endif
ifdef CONFIG_MICROPY_USE_BLUETOOTH
SRC_C += esp32/bluetooth_le.c
SRC_C += esp32/modbluetooth.c
endif
ifdef CONFIG_MICROPY_USE_RFCOMM
SRC_C += esp32/machine_rfcomm.c
endif
EXTMOD_SRC_C = $(addprefix extmod/,\
modbtree.c \
)
LIB_SRC_C = $(addprefix lib/,\
mp-readline/readline.c \
netutils/netutils.c \
timeutils/timeutils.c \
utils/pyexec.c \
utils/interrupt_char.c \
utils/sys_stdio_mphal.c \
)
LIBS_SRC_C = $(addprefix esp32/libs/,\
espcurl.c \
neopixel.c \
esp_rmt.c \
telnet.c \
ftp.c \
websrv.c \
libGSM.c \
curl_mail.c \
ow/owb_rmt.c \
ow/owb.c \
ow/ds18b20.c \
littleflash.c \
)
ifdef CONFIG_MICROPY_USE_TFT
LIBS_SRC_C += \
esp32/moddisplay_tft.c \
esp32/libs/tft/tftspi.c \
esp32/libs/tft/tft.c \
esp32/libs/tft/comic24.c \
esp32/libs/tft/DefaultFont.c \
esp32/libs/tft/DejaVuSans18.c \
esp32/libs/tft/DejaVuSans24.c \
esp32/libs/tft/minya24.c \
esp32/libs/tft/SmallFont.c \
esp32/libs/tft/tooney32.c \
esp32/libs/tft/Ubuntu16.c \
esp32/libs/tft/def_small.c
endif
ifdef CONFIG_MICROPY_USE_SGP30_SENSOR
LIBS_SRC_C += \
esp32/libs/sgp/sgp30/sgp30.c \
esp32/libs/sgp/sgp30/sgp30_featureset.c \
esp32/libs/sgp/embedded-common/sensirion_common.c
endif
ifdef CONFIG_MICROPY_USE_EVE
LIBS_SRC_C += \
esp32/libs/eve/FT8_commands.c \
esp32/moddisplay_eve.c
endif
ifeq ($(MICROPY_PY_BTREE),1)
LIB_SRC_C += \
lib/berkeley-db-1.xx/btree/bt_open.c \
lib/berkeley-db-1.xx/btree/bt_seq.c \
lib/berkeley-db-1.xx/btree/bt_close.c \
lib/berkeley-db-1.xx/btree/bt_debug.c \
lib/berkeley-db-1.xx/btree/bt_get.c \
lib/berkeley-db-1.xx/btree/bt_overflow.c \
lib/berkeley-db-1.xx/btree/bt_put.c \
lib/berkeley-db-1.xx/btree/bt_utils.c \
lib/berkeley-db-1.xx/btree/bt_conv.c \
lib/berkeley-db-1.xx/btree/bt_delete.c \
lib/berkeley-db-1.xx/btree/bt_page.c \
lib/berkeley-db-1.xx/btree/bt_search.c \
lib/berkeley-db-1.xx/btree/bt_split.c \
lib/berkeley-db-1.xx/mpool/mpool.c
endif
OBJ_MP =
OBJ_MP += $(PY_O)
OBJ_MP += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
OBJ_MP += $(addprefix $(BUILD)/, $(LIBS_SRC_C:.c=.o))
# List of sources for qstr extraction
# ------------------------------------------------------------------------------
SRC_QSTR += $(SRC_C) $(EXTMOD_SRC_C) $(LIB_SRC_C) $(DRIVERS_SRC_C) $(LIBS_SRC_C)
# Append any auto-generated sources that are needed by sources listed in SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
# Needed to generate Qstr
OBJ = $(OBJ_MP) $(OBJ_ESPIDF)
# Include mkrules make
#--------------------------------------
include $(COMPONENT_PATH)/py/mkrules.mk