mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2025-04-27 13:39:22 +02:00
fxsdk: add shortcuts and update help message (#1)
This commit is contained in:
parent
eb6644b00b
commit
abcc5f07c9
2 changed files with 56 additions and 26 deletions
4
Makefile
4
Makefile
|
@ -18,7 +18,7 @@ dflags = -MT $@ -MMD -MP -MF $(@:%.o=%.d)
|
||||||
# $TARGETS is provided by Makefile.cfg.
|
# $TARGETS is provided by Makefile.cfg.
|
||||||
#
|
#
|
||||||
|
|
||||||
TARGETS := $(filter-out fxconv,$(TARGETS))
|
TARGETS := $(filter-out fxconv fxsdk,$(TARGETS))
|
||||||
bin = $(TARGETS:%=bin/%)
|
bin = $(TARGETS:%=bin/%)
|
||||||
|
|
||||||
# fxconv has no sources files because it's written in Python, and fxsdk has no
|
# fxconv has no sources files because it's written in Python, and fxsdk has no
|
||||||
|
@ -79,6 +79,8 @@ Makefile.cfg:
|
||||||
|
|
||||||
.PHONY: all clean distclean
|
.PHONY: all clean distclean
|
||||||
|
|
||||||
|
.PRECIOUS: build/fxos/lexer-%.yy.c
|
||||||
|
|
||||||
#
|
#
|
||||||
# Installing
|
# Installing
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,23 +1,51 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# Note: this line is edited at install time to insert the install folder
|
# Note: this line is edited at install time to insert the install folder
|
||||||
PREFIX=\
|
PREFIX=\
|
||||||
|
|
||||||
usage_string=$(cat << EOF
|
usage_string=$(cat << EOF
|
||||||
usage: fxsdk new [<folder name>] [options...]
|
usage: fxsdk new <folder>
|
||||||
fxsdk build [fx|cg]
|
fxsdk (build|build-fx|build-cg) [-s]
|
||||||
fxsdk send [fx|cg]
|
fxsdk (send|send-fx|send-cg)
|
||||||
|
|
||||||
This program is a command-line helper for the fxSDK, a set of tools used in
|
This program is a command-line helper for the fxSDK, a set of tools used in
|
||||||
conjunction with gint to develop add-ins for CASIO fx-9860G and fx-CG 50.
|
conjunction with gint to develop add-ins for CASIO fx-9860G and fx-CG 50.
|
||||||
|
|
||||||
Project creation:
|
Project creation:
|
||||||
fxsdk new [<folder name>] [options...]
|
fxsdk new <folder>
|
||||||
-@ <name>, --internal=<name> Internal project name
|
|
||||||
|
|
||||||
|
Creates a new project in the specified folder. Project info is input
|
||||||
|
interactively. Creates <folder name> and populates it with default project
|
||||||
|
data.
|
||||||
|
|
||||||
|
Compilation:
|
||||||
|
fxsdk build [-s]
|
||||||
|
fxsdk build-fx [-s]
|
||||||
|
fxsdk build-cg [-s]
|
||||||
|
|
||||||
|
Compiles the current project for fx-9860G (.g1a target) or fx-CG 50 (.g3a
|
||||||
|
target). With 'fxsdk build', compiles every existing build folder, and ask
|
||||||
|
interactively if none is found.
|
||||||
|
|
||||||
|
With '-s', also sends the resulting program to the calculator.
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
fxsdk send
|
||||||
|
fxsdk send-fx
|
||||||
|
fxsdk send-cg
|
||||||
|
|
||||||
|
Sends the target file to the calculator. Uses p7 (which must be installed
|
||||||
|
externally) for fx-9860G. Currently not implemented for fx-CG 50, as it
|
||||||
|
requires detecting and mounting the calculator (same of the Graph 35+E II).
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Project creation flags
|
||||||
|
# -n <name>, --name=<name> Project name
|
||||||
|
# -@ <name>, --internal=<name> Internal project name
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "$usage_string"
|
echo "$usage_string"
|
||||||
exit ${1:-1}
|
exit ${1:-1}
|
||||||
|
@ -155,7 +183,7 @@ fxsdk_build() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e 'Unknown platform (valid names are "fx" and "cg")\n'
|
echo -e 'Unknown platform (valid names are "fx" and "cg")!'
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,25 +197,25 @@ fxsdk_build_cg() {
|
||||||
make all-cg
|
make all-cg
|
||||||
}
|
}
|
||||||
|
|
||||||
fxsdk_install() {
|
fxsdk_send() {
|
||||||
if [[ -e "build-fx" && ! -e "build-cg" ]]; then
|
if [[ -e "build-fx" && ! -e "build-cg" ]]; then
|
||||||
fxsdk_install_fx
|
fxsdk_send_fx
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e "build-cg" && ! -e "build-fx" ]]; then
|
if [[ -e "build-cg" && ! -e "build-fx" ]]; then
|
||||||
fxsdk_install_cg
|
fxsdk_send_cg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "either no or several platforms are targeted, use 'fxsdk install-fx' or"
|
echo "either no or several platforms are targeted, use 'fxsdk send-fx' or"
|
||||||
echo "fxsdk 'install-cg' to specify which calculator to install to."
|
echo "fxsdk 'send-cg' to specify which calculator to send to."
|
||||||
}
|
}
|
||||||
|
|
||||||
fxsdk_install_fx() {
|
fxsdk_send_fx() {
|
||||||
status "Installing for fx9860g using p7"
|
status "Installing for fx9860g using p7"
|
||||||
make install-fx
|
make install-fx
|
||||||
}
|
}
|
||||||
|
|
||||||
fxsdk_install_cg() {
|
fxsdk_send_cg() {
|
||||||
# TODO
|
# TODO
|
||||||
echo "error: this is tricky and not implemented yet, sorry x_x"
|
echo "error: this is tricky and not implemented yet, sorry x_x"
|
||||||
}
|
}
|
||||||
|
@ -202,23 +230,23 @@ case $1 in
|
||||||
fxsdk_new_project_interactive "$@";;
|
fxsdk_new_project_interactive "$@";;
|
||||||
|
|
||||||
# Project compilation
|
# Project compilation
|
||||||
"build")
|
"build"|"b")
|
||||||
fxsdk_build
|
fxsdk_build
|
||||||
[[ $1 == "-s" ]] && fxsdk_install;;
|
[[ $1 == "-s" ]] && fxsdk_send;;
|
||||||
"build-fx")
|
"build-fx"|"bf"|"bfx")
|
||||||
fxsdk_build_fx
|
fxsdk_build_fx
|
||||||
[[ $1 == "-s" ]] && fxsdk_install;;
|
[[ $1 == "-s" ]] && fxsdk_send_fx;;
|
||||||
"build-cg")
|
"build-cg"|"bc"|"bcg")
|
||||||
fxsdk_build_cg
|
fxsdk_build_cg
|
||||||
[[ $1 == "-s" ]] && fxsdk_install;;
|
[[ $1 == "-s" ]] && fxsdk_send_cg;;
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
"install")
|
"send"|"s")
|
||||||
fxsdk_install;;
|
fxsdk_send;;
|
||||||
"install-fx")
|
"send-fx"|"sf"|"sfx")
|
||||||
fxsdk_install_fx;;
|
fxsdk_send_fx;;
|
||||||
"install-cg")
|
"send-cg"|"sc"|"scg")
|
||||||
fxsdk_install_cg;;
|
fxsdk_send_cg;;
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
-h|--help|-\?)
|
-h|--help|-\?)
|
||||||
|
|
Loading…
Add table
Reference in a new issue