nshell/makefile

46 lines
1.0 KiB
Makefile
Raw Permalink Normal View History

FXSDK_PREFIX = ${HOME}/.local
2021-10-04 19:36:59 +02:00
FXSDK_INSTALL_PATH = ${FXSDK_PREFIX}/lib/cmake/fxsdk
2021-10-05 23:29:03 +02:00
.DEFAULT_GOAL: build
2021-10-05 21:37:21 +02:00
# generate project with cmake
2021-10-05 22:04:17 +02:00
CMAKE_GENERATOR ?= Ninja
2021-10-05 21:37:21 +02:00
.PHONY: generate
generate: build/
build/:
rm -rf build
cmake \
2021-10-05 21:37:21 +02:00
-B build/ \
2021-10-05 22:04:17 +02:00
-G $(CMAKE_GENERATOR) \
2021-10-04 19:36:59 +02:00
-DCMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH} \
-DCMAKE_TOOLCHAIN_FILE=${FXSDK_INSTALL_PATH}/FXCG50.cmake \
-DFXSDK_CMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH}
2021-10-05 21:37:21 +02:00
# 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 $*
2021-10-05 21:37:21 +02:00
# send addin to calc
.PHONY: send
send:
2021-08-31 15:52:53 +02:00
fxlink -s -w60 -f 'mass_storage;series_cg' *.g3a
2021-10-05 21:37:21 +02:00
# project clean (remove build system cache)
.PHONY: clean
2021-08-31 15:52:53 +02:00
clean:
2021-10-05 21:37:21 +02:00
cmake --build build --target clean
# remove all build products
.PHONY: reset
reset:
2021-08-31 15:52:53 +02:00
rm -rf *.g1a *.g3a build/ build-fx/ build-cg/
2021-10-05 21:37:21 +02:00
# enforce formatting rules
.PHONY: format
2021-08-31 15:52:53 +02:00
format:
find src/ -name *.[c,h] -exec clang-format --verbose -i {} \;