2021-10-21 12:24:34 +00:00
|
|
|
PROJECT_ROOT := $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
|
2022-04-13 20:50:25 +00:00
|
|
|
|
|
|
|
include $(PROJECT_ROOT)/make/git.mk
|
|
|
|
|
2021-10-21 12:24:34 +00:00
|
|
|
COPRO_DIR := $(PROJECT_ROOT)/lib/STM32CubeWB/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x
|
|
|
|
|
2022-01-05 16:10:18 +00:00
|
|
|
PROJECT_SOURCE_DIRECTORIES := \
|
|
|
|
$(PROJECT_ROOT)/applications \
|
|
|
|
$(PROJECT_ROOT)/core \
|
|
|
|
$(PROJECT_ROOT)/firmware/targets \
|
|
|
|
$(PROJECT_ROOT)/lib/app-template \
|
|
|
|
$(PROJECT_ROOT)/lib/app-scened-template \
|
|
|
|
$(PROJECT_ROOT)/lib/common-api \
|
|
|
|
$(PROJECT_ROOT)/lib/drivers \
|
|
|
|
$(PROJECT_ROOT)/lib/flipper_file \
|
2022-02-25 15:22:58 +00:00
|
|
|
$(PROJECT_ROOT)/lib/infrared \
|
2022-01-05 16:10:18 +00:00
|
|
|
$(PROJECT_ROOT)/lib/nfc_protocols \
|
|
|
|
$(PROJECT_ROOT)/lib/ST25RFAL002 \
|
|
|
|
$(PROJECT_ROOT)/lib/onewire \
|
|
|
|
$(PROJECT_ROOT)/lib/qrcode \
|
|
|
|
$(PROJECT_ROOT)/lib/subghz \
|
|
|
|
$(PROJECT_ROOT)/lib/toolbox \
|
|
|
|
$(PROJECT_ROOT)/lib/u8g2
|
|
|
|
|
|
|
|
NPROCS := 3
|
2021-10-21 18:12:20 +00:00
|
|
|
OS := $(shell uname -s)
|
|
|
|
|
|
|
|
ifeq ($(OS), Linux)
|
|
|
|
NPROCS := $(shell grep -c ^processor /proc/cpuinfo)
|
|
|
|
else ifeq ($(OS), Darwin)
|
|
|
|
NPROCS := $(shell sysctl -n hw.ncpu)
|
|
|
|
endif
|
|
|
|
|
2021-11-18 08:46:47 +00:00
|
|
|
include $(PROJECT_ROOT)/make/defaults.mk
|
|
|
|
|
2021-10-21 12:24:34 +00:00
|
|
|
.PHONY: all
|
2022-04-13 20:50:25 +00:00
|
|
|
all: firmware_all
|
|
|
|
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware -s $(DIST_SUFFIX)
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: whole
|
2022-04-13 20:50:25 +00:00
|
|
|
whole: flash_radio firmware_flash
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
2022-04-13 20:50:25 +00:00
|
|
|
clean: firmware_clean updater_clean
|
2021-11-18 08:46:47 +00:00
|
|
|
@rm -rf $(PROJECT_ROOT)/dist/$(TARGET)
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: flash
|
2022-04-13 20:50:25 +00:00
|
|
|
flash: firmware_flash
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: debug
|
|
|
|
debug:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(MAKE) -C firmware -j$(NPROCS) debug
|
2021-10-21 12:24:34 +00:00
|
|
|
|
2022-04-18 23:09:11 +00:00
|
|
|
.PHONY: debug_other
|
|
|
|
debug_other:
|
|
|
|
@$(MAKE) -C firmware -j$(NPROCS) debug_other
|
|
|
|
|
2021-11-15 19:55:25 +00:00
|
|
|
.PHONY: blackmagic
|
|
|
|
blackmagic:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(MAKE) -C firmware -j$(NPROCS) blackmagic
|
2021-11-15 19:55:25 +00:00
|
|
|
|
2021-10-21 12:24:34 +00:00
|
|
|
.PHONY: wipe
|
|
|
|
wipe:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(PROJECT_ROOT)/scripts/flash.py wipe
|
|
|
|
@$(PROJECT_ROOT)/scripts/ob.py set
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: firmware_all
|
|
|
|
firmware_all:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) all
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: firmware_clean
|
|
|
|
firmware_clean:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) clean
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: firmware_flash
|
|
|
|
firmware_flash:
|
2021-11-11 12:49:19 +00:00
|
|
|
ifeq ($(FORCE), 1)
|
2022-04-13 20:50:25 +00:00
|
|
|
@rm $(PROJECT_ROOT)/firmware/.obj/f*-firmware/flash || true
|
2021-11-01 13:11:25 +00:00
|
|
|
endif
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) flash
|
2021-10-21 12:24:34 +00:00
|
|
|
|
2022-04-13 20:50:25 +00:00
|
|
|
|
|
|
|
.PHONY: updater
|
|
|
|
updater:
|
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 all
|
|
|
|
|
|
|
|
.PHONY: updater_clean
|
|
|
|
updater_clean:
|
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 clean
|
|
|
|
|
|
|
|
.PHONY: updater_debug
|
|
|
|
updater_debug:
|
|
|
|
@$(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) RAM_EXEC=1 debug
|
|
|
|
|
|
|
|
.PHONY: updater_package
|
|
|
|
updater_package: firmware_all updater
|
|
|
|
@$(PROJECT_ROOT)/scripts/dist.py copy -t $(TARGET) -p firmware updater -s $(DIST_SUFFIX) --bundlever "$(VERSION_STRING)"
|
|
|
|
|
2021-10-21 12:24:34 +00:00
|
|
|
.PHONY: flash_radio
|
|
|
|
flash_radio:
|
2021-12-23 16:24:09 +00:00
|
|
|
@$(PROJECT_ROOT)/scripts/flash.py core2radio 0x080D7000 $(COPRO_DIR)/stm32wb5x_BLE_Stack_light_fw.bin
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(PROJECT_ROOT)/scripts/ob.py set
|
2021-10-21 12:24:34 +00:00
|
|
|
|
|
|
|
.PHONY: flash_radio_fus
|
|
|
|
flash_radio_fus:
|
|
|
|
@echo
|
|
|
|
@echo "================ DON'T DO IT ================"
|
|
|
|
@echo "= Flashing FUS is going to erase secure enclave ="
|
2022-04-13 20:50:25 +00:00
|
|
|
@echo "= You will lose ability to use encrypted assets ="
|
2021-10-21 12:24:34 +00:00
|
|
|
@echo "= type 'find / -exec rm -rf {} \;' ="
|
|
|
|
@echo "= In case if you still want to continue ="
|
|
|
|
@echo "================ JUST DON'T ================"
|
|
|
|
@echo
|
|
|
|
|
2021-11-01 13:11:25 +00:00
|
|
|
.PHONY: flash_radio_fus_please_i_m_not_going_to_complain
|
2021-10-21 12:24:34 +00:00
|
|
|
flash_radio_fus_please_i_m_not_going_to_complain:
|
2021-11-18 08:46:47 +00:00
|
|
|
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw_for_fus_0_5_3.bin
|
|
|
|
@$(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw.bin
|
|
|
|
@$(PROJECT_ROOT)/scripts/ob.py set
|
2021-11-01 13:11:25 +00:00
|
|
|
|
2022-01-05 16:10:18 +00:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
@echo "Checking source code formatting"
|
|
|
|
@$(PROJECT_ROOT)/scripts/lint.py check $(PROJECT_SOURCE_DIRECTORIES)
|
2021-11-01 13:11:25 +00:00
|
|
|
|
|
|
|
.PHONY: format
|
|
|
|
format:
|
2022-01-05 16:10:18 +00:00
|
|
|
@echo "Reformating sources code"
|
|
|
|
@$(PROJECT_ROOT)/scripts/lint.py format $(PROJECT_SOURCE_DIRECTORIES)
|
2022-03-03 09:48:56 +00:00
|
|
|
|
|
|
|
.PHONY: guruguru
|
|
|
|
guruguru:
|
|
|
|
@echo "ぐるぐる回る"
|
|
|
|
@$(PROJECT_ROOT)/scripts/guruguru.py $(PROJECT_ROOT)
|