CMAKE = cmake # use user cmake
cmake_generator = "Unix Makefiles"
RM = $(CMAKE) -E remove_directory
MAKEFLAGS += --no-print-directory

TOOLCHAIN ?= arm-none-eabi-

#cmake definition config
cmake_definition+= -DTOOLCHAIN=${TOOLCHAIN}

build:Makefile
	$(CMAKE) -S . -B build -G $(cmake_generator) $(cmake_definition)
	$(MAKE) -C build -j

clean::
	$(RM) build

.PHONY:build clean
