fxsdk: add update command and fix LD flag order

This commit is contained in:
Lephe 2019-09-03 23:23:24 +02:00
parent e1ddf0f452
commit 627fe14290
Signed by untrusted user who does not match committer: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 26 additions and 3 deletions

View File

@ -16,8 +16,8 @@ cf-fx := $(cf) -m3 -DFX9860G
cf-cg := $(cf) -m4-nofpu -DFXCG50
# Linker flags
lf-fx := $(LDFLAGS) -Tfx9860g.ld -lgint-fx -lgcc -Wl,-Map=build-fx/map
lf-cg := $(LDFLAGS) -Tfxcg50.ld -lgint-cg -lgcc -Wl,-Map=build-cg/map
lf-fx := -Tfx9860g.ld -lgint-fx $(LDFLAGS) -lgcc -Wl,-Map=build-fx/map
lf-cg := -Tfxcg50.ld -lgint-cg $(LDFLAGS) -lgcc -Wl,-Map=build-cg/map
dflags = -MMD -MT $@ -MF $(@:.o=.d) -MP
cpflags := -R .bss -R .gint_bss

View File

@ -39,6 +39,13 @@ Installation:
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).
Project update:
fxsdk update
Copies the latest version of the Makefile to your project. *This will
discard any changes made to your Makefile.* If you have edited your
Makefile, make a backup and merge the changes after updating.
EOF
)
@ -138,7 +145,8 @@ ICON_CG_SEL = assets-cg/icon-cg-sel.png
# Additional compiler flags
CFLAGS = -std=c11 -Os
# Additional linker flags
# Additional linker flags. This is followed by -lgcc. When using fxlib, add
# libfx.a to the projet directory and set LDFLAGS to "-L . -lfx".
LDFLAGS =
EOF
}
@ -222,6 +230,17 @@ fxsdk_send_cg() {
echo "error: this is tricky and not implemented yet, sorry x_x"
}
fxsdk_update() {
if [[ ! -e "project.cfg" ]]; then
echo "No file 'project.cfg' was found. This does not look like an fxSDK"
echo "project folder. (Nothing done.)"
fi
assets="$PREFIX/share/fxsdk/assets"
cp "$assets"/Makefile .
echo "Succesfully copied $assets/Makefile to the current directory."
}
# Parse command name
case $1 in
@ -250,6 +269,10 @@ case $1 in
"send-cg"|"sc"|"scg")
fxsdk_send_cg;;
# Project update
"update")
fxsdk_update;;
# Misc
-h|--help|-\?)
usage 0;;