improve frontend makefile

This commit is contained in:
Babz 2021-10-05 21:37:21 +02:00
parent 8e67941f17
commit 60d47c0482
1 changed files with 27 additions and 7 deletions

View File

@ -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 {} \;