nshell/makefile

46 lines
1.0 KiB
Makefile

FXSDK_PREFIX = ${HOME}/.local
FXSDK_INSTALL_PATH = ${FXSDK_PREFIX}/lib/cmake/fxsdk
.DEFAULT_GOAL: build
# generate project with cmake
CMAKE_GENERATOR ?= Ninja
.PHONY: generate
generate: build/
build/:
rm -rf build
cmake \
-B build/ \
-G $(CMAKE_GENERATOR) \
-DCMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH} \
-DCMAKE_TOOLCHAIN_FILE=${FXSDK_INSTALL_PATH}/FXCG50.cmake \
-DFXSDK_CMAKE_MODULE_PATH=${FXSDK_INSTALL_PATH}
# 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 {} \;