diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..be34b04 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +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 <esp-idf path>/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 |