From 60d47c04828914eebac481a794ba6c9f19944fb7 Mon Sep 17 00:00:00 2001 From: Babz Date: Tue, 5 Oct 2021 21:37:21 +0200 Subject: [PATCH] improve frontend makefile --- makefile | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 83f31cf..cd45449 100644 --- a/makefile +++ b/makefile @@ -1,25 +1,45 @@ FXSDK_PREFIX = ${HOME}/.local FXSDK_INSTALL_PATH = ${FXSDK_PREFIX}/lib/cmake/fxsdk -all: configure build send -rebuild: clean build -tidy: format +.PHONY: all +all: build -configure: +# generate project with cmake +.PHONY: generate +generate: build/ +build/: + rm -rf build cmake \ - -B build \ + -B build/ \ -DCMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH} \ -DCMAKE_TOOLCHAIN_FILE=${FXSDK_INSTALL_PATH}/FXCG50.cmake \ -DFXSDK_CMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH} -build: configure - cmake --build build +# build:foobar builds foobar with cmake +# ie. cmake --build build/ --target foobar +# (defaults to build = build:all) +.PHONY: build +build: build\:all +.PHONY: build\:% +build\:%: build/ + cmake --build build/ --target $* +# send addin to calc +.PHONY: send send: fxlink -s -w60 -f 'mass_storage;series_cg' *.g3a +# project clean (remove build system cache) +.PHONY: clean clean: + cmake --build build --target clean + +# remove all build products +.PHONY: reset +reset: rm -rf *.g1a *.g3a build/ build-fx/ build-cg/ +# enforce formatting rules +.PHONY: format format: find src/ -name *.[c,h] -exec clang-format --verbose -i {} \; \ No newline at end of file