Compare commits

...

4 Commits

4 changed files with 110 additions and 5 deletions

4
bld Executable file
View File

@ -0,0 +1,4 @@
PREFIX=$HOME/.local make -f giteapc.make configure
sudo make -C build install

View File

@ -30,6 +30,7 @@ fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)
target_link_options(myaddin PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage)
target_link_libraries(myaddin Gint::Gint)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
@ -38,4 +39,7 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a"
NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G_AS_CG)
generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a"
NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()

View File

@ -0,0 +1,58 @@
# fxSDK toolchain file for Casio graphing calculators
# Models: Prizm fx-CG 10, fx-CG 20, fx-CG 50, fx-CG 50 emulator
# Target triplet: sh-elf (custom sh3eb-elf supporting sh3 and sh4-nofpu)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR sh)
# Base plateform is fx to pick the assets for the fx9860G
set(FXSDK_PLATFORM fx)
# the long name is change to be able to separate in CMakeLists.txt the different targets
set(FXSDK_PLATFORM_LONG fx9860G_AS_CG)
set(FXSDK_TOOLCHAIN sh-elf-)
set(CMAKE_C_COMPILER sh-elf-gcc)
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 -DFXCG50)
add_link_options(-nostdlib -Wl,--no-warn-rwx-segments)
link_libraries(-lgcc)
add_compile_definitions(TARGET_FXCG50)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(FXSDK_CMAKE_MODULE_PATH "${FXSDK_CMAKE_MODULE_PATH}")
# Add the fxSDK prefix path to the search
set(FXSDK_PREFIX "$ENV{FXSDK_PREFIX}")
foreach(DIR IN LISTS FXSDK_PREFIX)
include_directories("${DIR}/include")
link_directories("${DIR}/lib")
endforeach()
# Determine compiler install path
execute_process(
COMMAND ${CMAKE_C_COMPILER} --print-file-name=.
OUTPUT_VARIABLE FXSDK_COMPILER_INSTALL
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Provide fxSDK sysroot and standard install folders
execute_process(
COMMAND fxsdk path sysroot
OUTPUT_VARIABLE FXSDK_SYSROOT
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND fxsdk path include
OUTPUT_VARIABLE FXSDK_INCLUDE
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND fxsdk path lib
OUTPUT_VARIABLE FXSDK_LIB
OUTPUT_STRIP_TRAILING_WHITESPACE)

View File

@ -41,6 +41,14 @@ ${R}fxsdk${n} ${R}build-cg-push${n} [${R}-c${n}] [${R}-s${n}] [${R}--${n}] \
are identical to other build commands. Typical workflows will always set -s
(which requires libusb support in fxlink).
${R}fxsdk${n} ${R}build-fxascg${n} [${R}-c${n}] [${R}-s${n}] [${R}--${n}] \
[${g}<ARGS>${n}...]
Builds the current project for fx-CG 50 from a code source initially
targetting the fx-9860G(II). It will generate a .g3a add-in in lieu of a .g1a
add-in. Upscaling of the screen will be performed to accomodate the higher
resolution of the screen of the fx-CG 50 (396x224px) instead of one of the
fx-9860G (128x64px).
${R}fxsdk${n} (${R}send${n}|${R}send-fx${n}|${R}send-cg${n})
Sends the target file to the calculator. Uses p7 (which must be installed
externally) for the fx-9860G, and fxlink for the fx-CG. For the G-III series,
@ -127,7 +135,10 @@ fxsdk_new_project() {
cp "$assets"/icon-cg-sel.png "$1"/assets-cg/icon-sel.png
echo "Created a new project $NAME (build system: $generator)."
echo "Type 'fxsdk build-fx' or 'fxsdk build-cg' to compile the program."
echo "Type 'fxsdk build-fx' or 'fxsdk build-cg' or 'fxsdk build-fxascg'"
echo "to compile the program."
echo "Type 'fxsdk build-cg-push' to compile a bin to be send to"
echo "Add-In Push by circuit10"
}
fxsdk_load_config() {
@ -138,7 +149,7 @@ fxsdk_load_config() {
fxsdk_build() {
[[ ! -e build-fx && ! -e build-cg ]]
[[ ! -e build-fx && ! -e build-cg && ! -e build-fxascg ]]
none_exists=$?
if [[ -e build-fx || $none_exists == 0 ]]; then
@ -150,6 +161,11 @@ fxsdk_build() {
echo "$TAG Making into build-cg"
fxsdk_build_cg "$@"
fi
if [[ -e build-fxascg || $none_exists == 0 ]]; then
echo "$TAG Making into build-fxascg"
fxsdk_build_fxascg "$@"
fi
}
fxsdk_build_fx() {
@ -161,6 +177,9 @@ fxsdk_build_cg() {
fxsdk_build_cg_push() {
fxsdk_build_in "cg-push" "FXCG50" "$@"
}
fxsdk_build_fxascg() {
fxsdk_build_in "fxascg" "FX9860G_AS_CG" "$@"
}
fxsdk_build_in() {
platform="$1"
@ -222,16 +241,20 @@ fxsdk_build_in() {
}
fxsdk_send() {
if [[ -e "build-fx" && ! -e "build-cg" ]]; then
if [[ -e "build-fx" && ! -e "build-cg" && ! -e "build-fxascg" ]]; then
fxsdk_send_fx
fi
if [[ -e "build-cg" && ! -e "build-fx" ]]; then
if [[ -e "build-cg" && ! -e "build-fx" && ! -e "build-fxascg" ]]; then
fxsdk_send_cg
fi
if [[ -e "build-fxascg" && ! -e "build-fx" && ! -e "build-cg" ]]; then
fxsdk_send_fxascg
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-fxascg' to specify which calculator to send to."
}
fxsdk_send_fx() {
@ -267,6 +290,18 @@ fxsdk_send_cg-push() {
fxlink -pw ${bin_files}
}
fxsdk_send_fxascg() {
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_path() {
case "$1" in
"sysroot")
@ -300,6 +335,8 @@ case "$1" in
fxsdk_build_cg "${@:2}";;
"build-cg-push"|"bcgp")
fxsdk_build_cg_push "${@:2}";;
"build-fxascg"|"bfxcg"|"bfcg")
fxsdk_build_fxascg "${@:2}";;
# Install
"send"|"s")
@ -308,6 +345,8 @@ case "$1" in
fxsdk_send_fx;;
"send-cg"|"sc"|"scg")
fxsdk_send_cg;;
"send-fxascg"|"sfxcg"|"sfcg")
fxsdk_send_fxascg;;
# Utilities
"path")