From 4b0fdca8673c76cb2305db301a3b36e9e3822e02 Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 25 Dec 2023 01:45:05 +0200 Subject: init --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 /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 -- cgit v1.2.3