circuitpython/supervisor/supervisor.mk

80 lines
2.7 KiB
Makefile
Raw Normal View History

SRC_SUPERVISOR = \
main.c \
supervisor/port.c \
supervisor/shared/autoreload.c \
supervisor/shared/filesystem.c \
supervisor/shared/flash.c \
supervisor/shared/micropython.c \
2018-07-25 08:06:30 -04:00
supervisor/shared/rgb_led_status.c \
2018-07-31 19:53:54 -04:00
supervisor/shared/stack.c \
supervisor/shared/status_leds.c \
2018-07-31 19:53:54 -04:00
supervisor/shared/translate.c
ifndef $(NO_USB)
NO_USB = $(wildcard supervisor/usb.c)
endif
# Choose which flash filesystem impl to use.
# (Right now INTERNAL_FLASH_FILESYSTEM and SPI_FLASH_FILESYSTEM are mutually exclusive.
# But that might not be true in the future.)
ifdef EXTERNAL_FLASH_DEVICES
CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \
-DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT)
SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
ifeq ($(SPI_FLASH_FILESYSTEM),1)
CFLAGS += -DSPI_FLASH_FILESYSTEM
SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
endif
ifeq ($(QSPI_FLASH_FILESYSTEM),1)
CFLAGS += -DQSPI_FLASH_FILESYSTEM
SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
endif
else
SRC_SUPERVISOR += supervisor/internal_flash.c
endif
ifeq ($(USB),FALSE)
ifeq ($(wildcard supervisor/serial.c),)
SRC_SUPERVISOR += supervisor/stub/serial.c
else
SRC_SUPERVISOR += supervisor/serial.c
endif
else
SRC_SUPERVISOR += lib/tinyusb/src/common/tusb_fifo.c \
lib/tinyusb/src/device/control.c \
lib/tinyusb/src/device/usbd.c \
lib/tinyusb/src/class/msc/msc_device.c \
lib/tinyusb/src/class/cdc/cdc_device.c \
lib/tinyusb/src/class/hid/hid_device.c \
lib/tinyusb/src/tusb.c \
supervisor/shared/serial.c \
supervisor/usb.c \
supervisor/shared/usb/usb_desc.c \
supervisor/shared/usb/usb.c \
supervisor/shared/usb/usb_msc_flash.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 \
$(BUILD)/autogen_usb_descriptor.c
CFLAGS += -DUSB_AVAILABLE
endif
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o))
2018-07-31 19:53:54 -04:00
$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h
$(BUILD)/autogen_usb_descriptor.c $(BUILD)/genhdr/autogen_usb_descriptor.h: ../../tools/gen_usb_descriptor.py Makefile | $(HEADER_BUILD)
$(STEPECHO) "GEN $@"
$(Q)install -d $(BUILD)/genhdr
$(PYTHON3) ../../tools/gen_usb_descriptor.py \
--manufacturer $(USB_MANUFACTURER)\
--product $(USB_PRODUCT)\
--vid $(USB_VID)\
--pid $(USB_PID)\
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h