2017-09-22 21:05:51 -04:00
|
|
|
SRC_SUPERVISOR = \
|
|
|
|
main.c \
|
|
|
|
supervisor/port.c \
|
2020-05-11 09:37:20 -04:00
|
|
|
supervisor/shared/background_callback.c \
|
2020-01-23 20:03:55 -05:00
|
|
|
supervisor/shared/board.c \
|
2021-04-08 16:33:14 -04:00
|
|
|
supervisor/shared/cpu.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
supervisor/shared/flash.c \
|
2021-06-14 20:54:43 -04:00
|
|
|
supervisor/shared/lock.c \
|
2021-06-15 11:39:40 -04:00
|
|
|
supervisor/shared/memory.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
supervisor/shared/micropython.c \
|
2022-03-11 13:29:20 -05:00
|
|
|
supervisor/shared/reload.c \
|
2018-12-06 17:24:20 -05:00
|
|
|
supervisor/shared/safe_mode.c \
|
2022-03-22 22:40:33 -04:00
|
|
|
supervisor/shared/serial.c \
|
2018-07-31 19:53:54 -04:00
|
|
|
supervisor/shared/stack.c \
|
2018-10-19 21:46:22 -04:00
|
|
|
supervisor/shared/status_leds.c \
|
2019-11-18 09:22:41 -05:00
|
|
|
supervisor/shared/tick.c \
|
2020-09-27 06:58:51 -04:00
|
|
|
supervisor/shared/traceback.c \
|
2022-05-27 15:59:54 -04:00
|
|
|
supervisor/shared/translate/translate.c \
|
2022-03-22 22:40:33 -04:00
|
|
|
supervisor/shared/workflow.c
|
2017-09-22 21:05:51 -04:00
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
NO_USB ?= $(wildcard supervisor/usb.c)
|
2018-10-19 21:46:22 -04:00
|
|
|
|
2022-06-17 19:41:42 -04:00
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB),1)
|
|
|
|
CIRCUITPY_CREATOR_ID ?= $(USB_VID)
|
|
|
|
CIRCUITPY_CREATION_ID ?= $(USB_PID)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CIRCUITPY_CREATOR_ID),)
|
|
|
|
CFLAGS += -DCIRCUITPY_CREATOR_ID=$(CIRCUITPY_CREATOR_ID)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CIRCUITPY_CREATION_ID),)
|
|
|
|
CFLAGS += -DCIRCUITPY_CREATION_ID=$(CIRCUITPY_CREATION_ID)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_BLEIO),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/bluetooth/bluetooth.c
|
|
|
|
ifeq ($(CIRCUITPY_BLE_FILE_SERVICE),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/bluetooth/file_transfer.c
|
|
|
|
endif
|
|
|
|
ifeq ($(CIRCUITPY_SERIAL_BLE),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/bluetooth/serial.c
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
INTERNAL_FLASH_FILESYSTEM ?= 0
|
2019-12-05 22:45:53 -05:00
|
|
|
CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM)
|
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
QSPI_FLASH_FILESYSTEM ?= 0
|
2019-12-10 17:57:17 -05:00
|
|
|
CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM)
|
2018-10-19 21:46:22 -04:00
|
|
|
|
2021-02-11 18:50:02 -05:00
|
|
|
SPI_FLASH_FILESYSTEM ?= 0
|
2019-12-10 17:57:17 -05:00
|
|
|
CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM)
|
2019-09-14 15:40:24 -04:00
|
|
|
|
2022-06-16 13:27:08 -04:00
|
|
|
DISABLE_FILESYSTEM ?= 0
|
|
|
|
CFLAGS += -DDISABLE_FILESYSTEM=$(DISABLE_FILESYSTEM)
|
|
|
|
|
2022-06-16 15:43:07 -04:00
|
|
|
ifeq ($(DISABLE_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/stub/filesystem.c
|
|
|
|
else
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/filesystem.c
|
|
|
|
endif
|
|
|
|
|
2018-10-19 21:46:22 -04:00
|
|
|
# Choose which flash filesystem impl to use.
|
2019-12-05 22:45:53 -05:00
|
|
|
# (Right now INTERNAL_FLASH_FILESYSTEM and (Q)SPI_FLASH_FILESYSTEM are mutually exclusive.
|
2018-10-19 21:46:22 -04:00
|
|
|
# But that might not be true in the future.)
|
2021-03-04 16:12:24 -05:00
|
|
|
ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
|
|
|
|
ifeq ($(DISABLE_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/stub/internal_flash.c
|
|
|
|
else
|
|
|
|
SRC_SUPERVISOR += supervisor/internal_flash.c
|
|
|
|
endif
|
|
|
|
else
|
2021-02-12 19:01:14 -05:00
|
|
|
CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \
|
|
|
|
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
|
2021-03-24 20:10:54 -04:00
|
|
|
ifeq ($(SPI_FLASH_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
|
|
|
|
endif
|
|
|
|
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(HEADER_BUILD)/devices.h : ../../supervisor/shared/external_flash/devices.h.jinja ../../tools/gen_nvm_devices.py | $(HEADER_BUILD)
|
|
|
|
$(STEPECHO) "GEN $@"
|
|
|
|
$(Q)install -d $(BUILD)/genhdr
|
2021-10-15 15:59:04 -04:00
|
|
|
$(Q)$(PYTHON) ../../tools/gen_nvm_devices.py $< $@
|
2021-03-24 20:10:54 -04:00
|
|
|
|
|
|
|
$(BUILD)/supervisor/shared/external_flash/external_flash.o: $(HEADER_BUILD)/devices.h
|
|
|
|
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
2022-03-22 22:40:33 -04:00
|
|
|
ifneq ($(wildcard supervisor/serial.c),)
|
|
|
|
SRC_SUPERVISOR += supervisor/serial.c
|
|
|
|
endif
|
2022-03-21 16:57:29 -04:00
|
|
|
|
2022-03-22 22:40:33 -04:00
|
|
|
ifeq ($(CIRCUITPY_USB),1)
|
2021-02-12 19:01:14 -05:00
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/cdc/cdc_device.c \
|
|
|
|
lib/tinyusb/src/common/tusb_fifo.c \
|
|
|
|
lib/tinyusb/src/device/usbd.c \
|
|
|
|
lib/tinyusb/src/device/usbd_control.c \
|
|
|
|
lib/tinyusb/src/tusb.c \
|
|
|
|
supervisor/usb.c \
|
|
|
|
supervisor/shared/usb/usb_desc.c \
|
|
|
|
supervisor/shared/usb/usb.c \
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_CDC), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
shared-bindings/usb_cdc/__init__.c \
|
|
|
|
shared-bindings/usb_cdc/Serial.c \
|
|
|
|
shared-module/usb_cdc/__init__.c \
|
|
|
|
shared-module/usb_cdc/Serial.c \
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_HID), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/hid/hid_device.c \
|
|
|
|
shared-bindings/usb_hid/__init__.c \
|
|
|
|
shared-bindings/usb_hid/Device.c \
|
|
|
|
shared-module/usb_hid/__init__.c \
|
|
|
|
shared-module/usb_hid/Device.c \
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_MIDI), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/midi/midi_device.c \
|
|
|
|
shared-bindings/usb_midi/__init__.c \
|
|
|
|
shared-bindings/usb_midi/PortIn.c \
|
|
|
|
shared-bindings/usb_midi/PortOut.c \
|
|
|
|
shared-module/usb_midi/__init__.c \
|
|
|
|
shared-module/usb_midi/PortIn.c \
|
|
|
|
shared-module/usb_midi/PortOut.c \
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_MSC), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/msc/msc_device.c \
|
|
|
|
supervisor/shared/usb/usb_msc_flash.c \
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_VENDOR), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/class/vendor/vendor_device.c \
|
|
|
|
|
|
|
|
endif
|
2022-02-18 20:57:54 -05:00
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_USB_HOST), 1)
|
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
lib/tinyusb/src/host/hub.c \
|
|
|
|
lib/tinyusb/src/host/usbh.c \
|
|
|
|
lib/tinyusb/src/host/usbh_control.c \
|
|
|
|
|
|
|
|
endif
|
2017-09-22 21:05:51 -04:00
|
|
|
endif
|
|
|
|
|
2022-06-23 19:32:42 -04:00
|
|
|
STATIC_RESOURCES = $(wildcard $(TOP)/supervisor/shared/web_workflow/static/*)
|
|
|
|
|
2022-06-27 17:40:38 -04:00
|
|
|
$(BUILD)/autogen_web_workflow_static.c: ../../tools/gen_web_workflow_static.py $(STATIC_RESOURCES) | $(HEADER_BUILD)
|
2022-06-23 19:32:42 -04:00
|
|
|
$(STEPECHO) "GEN $@"
|
|
|
|
$(Q)$(PYTHON) $< \
|
|
|
|
--output_c_file $@ \
|
|
|
|
$(STATIC_RESOURCES)
|
|
|
|
|
2022-06-06 19:54:02 -04:00
|
|
|
ifeq ($(CIRCUITPY_WEB_WORKFLOW),1)
|
|
|
|
SRC_SUPERVISOR += supervisor/shared/web_workflow/web_workflow.c
|
2022-06-23 19:32:42 -04:00
|
|
|
|
|
|
|
SRC_SUPERVISOR += $(BUILD)/autogen_web_workflow_static.c
|
2022-06-06 19:54:02 -04:00
|
|
|
endif
|
|
|
|
|
2021-11-10 13:22:07 -05:00
|
|
|
SRC_TINYUSB = $(filter lib/tinyusb/%.c, $(SRC_SUPERVISOR))
|
|
|
|
$(patsubst %.c,$(BUILD)/%.o,$(SRC_TINYUSB)): CFLAGS += -Wno-missing-prototypes
|
|
|
|
|
2020-04-17 19:23:28 -04:00
|
|
|
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o))
|
|
|
|
|
|
|
|
ifeq ($(CIRCUITPY_DISPLAYIO), 1)
|
2021-02-12 19:01:14 -05:00
|
|
|
SRC_SUPERVISOR += \
|
|
|
|
supervisor/shared/display.c
|
2020-04-17 19:23:28 -04:00
|
|
|
|
2021-02-12 19:01:14 -05:00
|
|
|
ifeq ($(CIRCUITPY_TERMINALIO), 1)
|
2022-06-02 15:26:42 -04:00
|
|
|
SUPERVISOR_O += $(BUILD)/autogen_display_resources-$(TRANSLATION).o
|
2021-02-12 19:01:14 -05:00
|
|
|
endif
|
2020-04-17 19:23:28 -04:00
|
|
|
endif
|
2021-02-04 19:23:40 -05:00
|
|
|
|
2021-04-27 14:37:36 -04:00
|
|
|
# Preserve double quotes in these values by single-quoting them.
|
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
USB_INTERFACE_NAME ?= "CircuitPython"
|
2021-04-27 14:37:36 -04:00
|
|
|
CFLAGS += -DUSB_INTERFACE_NAME='$(USB_INTERFACE_NAME)'
|
2021-02-04 19:23:40 -05:00
|
|
|
|
|
|
|
ifneq ($(USB_VID),)
|
|
|
|
CFLAGS += -DUSB_VID=$(USB_VID)
|
2021-04-27 14:37:36 -04:00
|
|
|
CFLAGS += -DUSB_PID=$(USB_PID)
|
|
|
|
CFLAGS += -DUSB_MANUFACTURER='$(USB_MANUFACTURER)'
|
2021-04-29 17:41:43 -04:00
|
|
|
USB_MANUFACTURER_8 := "$(shell echo $(USB_MANUFACTURER) | cut -c 1-8)"
|
|
|
|
# Length-limited versions of strings for MSC names.
|
|
|
|
CFLAGS += -DUSB_MANUFACTURER_8='$(USB_MANUFACTURER_8)'
|
|
|
|
USB_PRODUCT_16 := "$(shell echo $(USB_PRODUCT) | cut -c 1-16)"
|
|
|
|
CFLAGS += -DUSB_PRODUCT_16='$(USB_PRODUCT_16)'
|
2021-04-27 14:37:36 -04:00
|
|
|
CFLAGS += -DUSB_PRODUCT='$(USB_PRODUCT)'
|
2021-04-29 17:41:43 -04:00
|
|
|
|
2019-11-12 16:29:35 -05:00
|
|
|
endif
|
|
|
|
|
2021-02-04 17:31:18 -05:00
|
|
|
# In the following URL, don't include the https:// prefix.
|
|
|
|
# It gets added automatically.
|
2021-02-11 18:50:02 -05:00
|
|
|
USB_WEBUSB_URL ?= "circuitpython.org"
|
2021-01-25 21:37:58 -05:00
|
|
|
|
2021-02-12 19:01:14 -05:00
|
|
|
ifeq ($(CIRCUITPY_USB_CDC),1)
|
2021-04-27 14:37:36 -04:00
|
|
|
# Inform TinyUSB there will be up to two CDC devices.
|
2021-02-04 19:23:40 -05:00
|
|
|
CFLAGS += -DCFG_TUD_CDC=2
|
2019-10-01 04:00:32 -04:00
|
|
|
endif
|
|
|
|
|
2021-02-04 19:23:40 -05:00
|
|
|
USB_HIGHSPEED ?= 0
|
2021-04-29 17:41:43 -04:00
|
|
|
CFLAGS += -DUSB_HIGHSPEED=$(USB_HIGHSPEED)
|
2019-09-04 21:45:16 -04:00
|
|
|
|
2022-06-02 14:48:56 -04:00
|
|
|
$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h
|
2018-10-19 21:46:22 -04:00
|
|
|
|
2019-04-12 18:25:48 -04:00
|
|
|
CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf"
|
2019-01-24 20:25:08 -05:00
|
|
|
|
2022-06-02 15:26:42 -04:00
|
|
|
$(BUILD)/autogen_display_resources-$(TRANSLATION).c: ../../tools/gen_display_resources.py $(TOP)/locale/$(TRANSLATION).po Makefile | $(HEADER_BUILD)
|
2019-01-24 20:25:08 -05:00
|
|
|
$(STEPECHO) "GEN $@"
|
|
|
|
$(Q)install -d $(BUILD)/genhdr
|
2021-10-15 15:59:04 -04:00
|
|
|
$(Q)$(PYTHON) ../../tools/gen_display_resources.py \
|
2019-01-24 20:25:08 -05:00
|
|
|
--font $(CIRCUITPY_DISPLAY_FONT) \
|
2022-06-02 15:26:42 -04:00
|
|
|
--sample_file $(TOP)/locale/$(TRANSLATION).po \
|
2022-06-23 19:32:42 -04:00
|
|
|
--output_c_file $@
|