From 45b207b1503fb3e00ca22320518847356c62608c Mon Sep 17 00:00:00 2001 From: Slyvtt Date: Sun, 12 Mar 2023 16:20:44 +0100 Subject: [PATCH] 'fxsdk build-fx-as-cg' working and added send command line option --- bld | 4 ++++ fxsdk/cmake/FX9860G_AS_CG.cmake | 2 +- fxsdk/fxsdk.sh | 26 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 bld diff --git a/bld b/bld new file mode 100755 index 0000000..091127a --- /dev/null +++ b/bld @@ -0,0 +1,4 @@ + PREFIX=$HOME/.local make -f giteapc.make configure + make -C build install + + diff --git a/fxsdk/cmake/FX9860G_AS_CG.cmake b/fxsdk/cmake/FX9860G_AS_CG.cmake index c44f437..777a9b6 100644 --- a/fxsdk/cmake/FX9860G_AS_CG.cmake +++ b/fxsdk/cmake/FX9860G_AS_CG.cmake @@ -18,7 +18,7 @@ set(CMAKE_CXX_COMPILER sh-elf-g++) set(CMAKE_C_FLAGS_INIT "") set(CMAKE_CXX_FLAGS_INIT "") -add_compile_options(-m4-nofpu -mb -ffreestanding -nostdlib -Wa,--dsp) +add_compile_options(-m4-nofpu -mb -ffreestanding -nostdlib -Wa,--dsp -DFXCG50) add_link_options(-nostdlib -Wl,--no-warn-rwx-segments) link_libraries(-lgcc) add_compile_definitions(TARGET_FXCG50) diff --git a/fxsdk/fxsdk.sh b/fxsdk/fxsdk.sh index ca674bf..6eccdcd 100755 --- a/fxsdk/fxsdk.sh +++ b/fxsdk/fxsdk.sh @@ -161,6 +161,11 @@ fxsdk_build() { echo "$TAG Making into build-cg" fxsdk_build_cg "$@" fi + + if [[ -e build-fx-as-cg || $none_exists == 0 ]]; then + echo "$TAG Making into build-fx-as-cg" + fxsdk_build_fx_as_cg "$@" + fi } fxsdk_build_fx() { @@ -247,8 +252,12 @@ fxsdk_send() { fxsdk_send_cg fi + if [[ -e "build-fx-as-cg" && ! -e "build-fxascg" ]]; then + fxsdk_send_fx_as_cg + fi + echo "either no or several platforms are targeted, use 'fxsdk send-fx' or" - echo "fxsdk 'send-cg' to specify which calculator to send to." + echo "'fxsdk send-cg' or 'fxsdk send-fx-as-cg' to specify which calculator to send to." } fxsdk_send_fx() { @@ -284,6 +293,21 @@ fxsdk_send_cg-push() { fxlink -pw ${bin_files} } +fxsdk_send_fx-as-cg() { + echo "$TAG Installing for fx-CG using fxlink" + if ! command -v fxlink >/dev/null 2>&1; then + echo "error: fxlink is not installed or not available" + return 1 + fi + g3a_files=$(find -maxdepth 1 -name '*.g3a') + echo "$TAG Running: fxlink -sw ${g3a_files}" + fxlink -sw ${g3a_files} +} + +fxsdk_send_fx-as-cg-push() { + fxsdk_send_cg-push +} + fxsdk_path() { case "$1" in "sysroot")