PORT ?= ttyUSB0 ifeq ($(origin IDF_PATH),undefined) IDF_ENV=0 else IDF_ENV=1 endif all: kociemba master slave kociemba slave: $(MAKE) -C $(shell pwd)/$@ all PROD=1 master: ifeq ($(IDF_ENV), 1) cd $(shell pwd)/$@ && PATH=$(PATH) idf.py build else @echo "FAILED: ESP-IDF export script is not sourced!" @echo -e "\t(use 'source /export.sh')" @exit 1 endif run: kociemba slave master ifeq ($(FLASH),1) ifeq ($(IDF_ENV),1) cd $(shell pwd)/master && idf.py flash -p $(PORT) else @echo "FAILED: FLASH is set to 1 but ESP-IDS export script is not sourced!" @exit 1 endif endif $(MAKE) -C $(shell pwd)/kociemba run .PHONY: all kociemba slave master run