From 32239c3dfecdeba38eb6abfda33a9e1fae9003cd Mon Sep 17 00:00:00 2001 From: Lephe Date: Sun, 16 Jun 2019 11:58:30 -0400 Subject: [PATCH] fxsdk: basic script, project creation and build (#1) --- Makefile | 17 ++--- fxsdk/assets/Makefile | 129 +++++++++++++++++++++++++++++++++++ fxsdk/assets/icon-cg-sel.png | Bin 0 -> 8388 bytes fxsdk/assets/icon-cg-uns.png | Bin 0 -> 4629 bytes fxsdk/assets/icon-fx.png | Bin 0 -> 7429 bytes fxsdk/assets/main.c | 12 ++++ fxsdk/fxsdk.sh | 127 ++++++++++++++++++++++++++++++++++ fxsdk/main.c | 4 -- 8 files changed, 274 insertions(+), 15 deletions(-) create mode 100755 fxsdk/assets/Makefile create mode 100644 fxsdk/assets/icon-cg-sel.png create mode 100644 fxsdk/assets/icon-cg-uns.png create mode 100644 fxsdk/assets/icon-fx.png create mode 100644 fxsdk/assets/main.c create mode 100755 fxsdk/fxsdk.sh delete mode 100644 fxsdk/main.c diff --git a/Makefile b/Makefile index 7c09afb..89ba4f6 100755 --- a/Makefile +++ b/Makefile @@ -21,32 +21,27 @@ dflags = -MT $@ -MMD -MP -MF $(@:%.o=%.d) TARGETS := $(filter-out fxconv,$(TARGETS)) bin = $(TARGETS:%=bin/%) -# fxconv has no sources files because it's written in Python +# fxconv has no sources files because it's written in Python, and fxsdk has no +# source either because it's written in Bash. src = $(wildcard $1/*.c) -src-fxsdk := $(call src,fxsdk) src-fxg1a := $(call src,fxg1a) src-fxos := $(call src,fxos) lex-fxos := $(wildcard fxos/*.l) obj = $($1:%=build/%.o) lex = $($1:%.l=build/%.yy.c.o) -obj-fxsdk := $(call obj,src-fxsdk) obj-fxg1a := $(call obj,src-fxg1a) obj-fxos := $(call obj,src-fxos) $(call lex,lex-fxos) # Symbolic targets all: $(bin) - @echo $(lex-fxos) -all-fxsdk: bin/fxsdk all-fxg1a: bin/fxg1a all-fxos: bin/fxos # Explicit targets -bin/fxsdk: $(obj-fxsdk) | bin/ - gcc $^ -o $@ $(lflags) bin/fxg1a: $(obj-fxg1a) | bin/ gcc $^ -o $@ $(lflags) bin/fxos: $(obj-fxos) | bin/ @@ -93,6 +88,10 @@ install: $(bin) install -d $(PREFIX)/share/fxsdk install $(bin) -m 755 $(PREFIX)/bin install fxos/*.txt -m 644 $(PREFIX)/share/fxsdk + install -d $(PREFIX)/share/fxsdk/assets + install fxsdk/assets/* -m 644 $(PREFIX)/share/fxsdk/assets + install fxsdk/fxsdk.sh -m 755 $(PREFIX)/bin/fxsdk + sed -i '/^PREFIX=\\$$/ a $(PREFIX)' $(PREFIX)/bin/fxsdk install fxconv/fxconv-main.py -m 755 $(PREFIX)/bin/fxconv install fxconv/fxconv.py -m 644 $(PREFIX)/bin @@ -104,10 +103,6 @@ uninstall: # Cleaning # -clean-fxsdk: - @rm -rf build/fxsdk -clean-fxconv: - @rm -rf build/fxconv clean-fxg1a: @rm -rf build/fxg1a clean-fxos: diff --git a/fxsdk/assets/Makefile b/fxsdk/assets/Makefile new file mode 100755 index 0000000..1b48ec8 --- /dev/null +++ b/fxsdk/assets/Makefile @@ -0,0 +1,129 @@ +#! /usr/bin/make -f +# Default Makefile for fxSDK add-ins. This file was probably copied there by +# the [fxsdk] program. +#--- + +# +# Configuration +# + +include project.cfg + +# Compiler flags +cf := -mb -ffreestanding -nostdlib -Wall -Wextra \ + -fstrict-volatile-bitfields $(CFLAGS) +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 + +dflags = -MMD -MT $@ -MF $(@:.o=.d) -MP +cpflags := -R .bss -R .gint_bss + +g1af := -i "$(ICON_FX)" -n "$(NAME)" --internal="$(INTERNAL)" +g3af := -n basic:"$(NAME)" -i uns:"$(ICON_CG_UNS)" -i sel:"$(ICON_CG_SEL)" + +# +# File listings +# + +null := +filename := $(subst $(null) $(null),-,$(NAME)) + +elf = $(dir $<)$(filename).elf +bin = $(dir $<)$(filename).bin +target-fx := $(filename).g1a +target-cg := $(filename).g3a + +# Source files +src := $(wildcard src/*.c) +img-fx := $(wildcard assets-fx/img/**/*) +fonts-fx := $(wildcard assets-fx/fonts/**/*) +img-cg := $(wildcard assets-cg/img/**/*) +fonts-cg := $(wildcard assets-cg/fonts/**/*) + +# Object files +obj-fx := $(src:%.c=build-fx/%.o) $(res:assets-fx/%=build-fx/assets/%.o) +obj-cg := $(src:%.c=build-cg/%.o) $(res:assets-cg/%=build-cg/assets/%.o) + +# Additional dependencies +deps-fx := $(ICON_FX) +deps-cg := $(ICON_CG_UNS) $(ICON_CG_SEL) + +# +# Build rules +# + +all: all-fx all-cg + +all-fx: $(target-fx) +all-cg: $(target-cg) + +$(target-fx): $(obj-fx) $(deps-fx) + + sh3eb-elf-gcc -o $(elf) $(obj-fx) $(cf-fx) $(lf-fx) + sh3eb-elf-objcopy -O binary $(cpflags) $(elf) $(bin) + fxg1a $(bin) -o $@ $(g1af) + +$(target-cg): $(obj-cg) $(deps-cg) + + sh4eb-elf-gcc -o $(elf) $(obj-cg) $(cf-cg) $(lf-cg) + sh4eb-elf-objcopy -O binary $(cpflags) $(elf) $(bin) + mkg3a $(g3af) $(bin) $@ + +# C sources +build-fx/%.o: %.c + @ mkdir -p $(dir $@) + sh3eb-elf-gcc -c $< -o $@ $(cf-fx) $(dflags) +build-cg/%.o: %.c + @ mkdir -p $(dir $@) + sh4eb-elf-gcc -c $< -o $@ $(cf-cg) $(dflags) + +# Images +build-fx/assets/img/%.o: assets-fx/img/% + @ mkdir -p $(dir $@) + fxconv -i $< -o $@ name:$* + +build-cg/assets/img/%.o: assets-cg/img/% + @ echo -ne "\e[31;1mWARNING: image conversion for fxcg50 is not " + @ echo -ne "supported yet\e[0m" + @ mkdir -p $(dir $@) + fxconv -i $< -o $@ name:$* + +# Fonts +build-fx/assets/fonts/%.o: assets-fx/fonts/% + @ mkdir -p $(dir $@) + fxconv -f $< -o $@ name:$* + +build-cg/assets/fonts/%.o: assets-cg/fonts/% + @ mkdir -p $(dir $@) + fxconv -f $< -o $@ name:$* + +# +# Cleaning and utilities +# + +# Dependency information +-include $(shell find build* -name *.d 2> /dev/null) +build-fx/%.d: ; +build-cg/%.d: ; +.PRECIOUS: build-fx build-cg build-fx/%.d build-cg/%.d %/ + +clean: + @ rm -rf build* +distclean: clean + @ rm -f $(target-fx) $(target-cg) + +install-fx: $(target-fx) + p7 send -f $< +install-cg: $(target-cg) + @ while [[ ! -h /dev/Prizm1 ]]; do sleep 1; done + @ mount /dev/Prizm1 + @ rm -f /mnt/prizm/$< + @ cp $< /mnt/prizm + @ umount /dev/Prizm1 + @- eject /dev/Prizm1 + +.PHONY: all all-fx all-cg clean distclean install-fx install-cg diff --git a/fxsdk/assets/icon-cg-sel.png b/fxsdk/assets/icon-cg-sel.png new file mode 100644 index 0000000000000000000000000000000000000000..7137b504cfd44f62f3105ce7a203b9100a557d0f GIT binary patch literal 8388 zcmV;#AUofQP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3*tk|Vd0g#Y6da|G@v64l$yCcuJ9tgkoOi)8y<5h0 zcieW1_vt2UjDGvVyZ6(Fd##4zo1ei37ouM7_!3%Jp#~qO-ywu(g8!_=-Fe%cZ@S9N z%WnEW4;_4 z@L;-Tu57T|@eDDN`-!b^10Zl;;{EZlD@$JUH%cONCl=!ZF0k2!2klNHL|9 zQ%NZiciMTEU3c64 z5Nju#c+$zIoO;^nAFsW<`j^*#;5GO1n!ldXedXgdu9l*K?hsBmljJiz=A*;oMIIoa zy?kb?i_yz-@|kU(tVo_kCi!ML+l|Y(FmC75aUb9PcMI=#CHL1uG9-4B!X9bvapo>Qw^UmWW1KpM1rm2W zBb9L?J7WWrNkTtqr_|G2-nfu!&&}<2>WU8Itb8C9mf_>7qcUo4Vdmmi?~RDSIX&%i z*vshU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bmiwsb%FzVCZ|Or+6hAc#Lh0R#XApa2w!f!$j*LQX1YC=xk5EqlC^ z+7v68FQ`qu|B`LnilXp^ZQI_jH|tc7V!klzRPK}C7#xhC#0Sy)x6Wd(e_VUoD6877e~hlH*V^z|lUv5DcEmwS4= z(&xj`NvT>rsebn$!V!o>G^}}ma1+6*>H)${B(7_6q5L$>!_)F{rSk5}fsd!`mrAud zwLG=WpPvz7mmXr_&(DakOAoQ|=VwINWf)?iw*A8-?~jgrpp?H=2@RCJTp*lF5WR?8 zg6Ku$5{6#Pdc9ORlU9AWKtxaR)r-SZeD&h+lrZ!nxg-bll%_80p^>I8D_tXDK?&$7 zqF91>iYS&)Jw-m0rk>(06St>$%f#&|oerg`r+CZculkgxp3=Ecx}#5#45e%Ols0+F zx$9Hf;VICkbZwu4rSvI;5{4!_br&JDxVpv`jy2z*mgU$KV_|tk^pqzLA0UM0mR`0E zigR@EVr4C=X~AXU(97FG0U zJsO?Q=h$88bSNQDA3u@8*w3mD!nT$Bw8GMg$?m7uj4sBsw7~g(r>}W0?%Q#gd56Yev)Q-D1(5I|!lOVsSp7 zn_GJ6=xCY6h;&BACpsm4y!Fy5aojbiRVo=K`S@msbK!!L#X@rWwCYpbRYt5qj7ZZA z;tnEi#&vBpozCX+EKQ`d2rGRY8rj}>~PubkC>-!X}D8^Z3_-e`r%5W-`?Cm}N{OOY4&%*QGrzCW}e0Y%R@4t0@ z$Y*qb5ULTfyuMy26u-Jov$(^usj6Vh4th#2;3+@>y`^E5P)oW@h6a*%(wY1Bru+{A zLLfLt3s3+GKmjNK1)u;FfC5ke3P1rU00jb|02F`%Pyh-*`JeF%0p|(b4g|HY00000 LNkvXXu0mjfMjhGA literal 0 HcmV?d00001 diff --git a/fxsdk/assets/icon-fx.png b/fxsdk/assets/icon-fx.png new file mode 100644 index 0000000000000000000000000000000000000000..c92f12afab0af9f7b3d8e2bec76a1dc5cc9c08a1 GIT binary patch literal 7429 zcmV+g9s1&lP) zaB^>EX>4U6ba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VUNmU!B*#lN%hmav||RP_pDFojUIKTZWF$hazuSd4b4st zN%L8)>Bm97=J;2Of0?G7^BScH_W*FUG@f$&TMN8I&9_K;jE*~8$CUru1vqqXLlk z<>vH0SN1DyVE!Zyqz%S?wApvM)^r@dUuS2|hxb+fJ^t4@y8GtG|8MWBh<|yX%iw<< z8~WmXADL1u@6YPvkI=M-~ zpqw_W9s;;(H1x1_vW2m-4;K_e@IrE#((ERJmnQuRm^Di!E{`}dezq_0nfB8|WKV8oJjcfnra^~+N<@?K- ze;ateyPWyY;`pDJGvE5+A)@slsE)y*P}cJtZ{TfEM10PSVM$2vUxDC({W4 z91S=*5V^k$%2A$;HRt_vZg8O9mCP~la+~AVI8|uDub-HePtM zS09Or +#include + +int main(void) +{ + dclear(color_white); + dtext(4, 4, "Sample fxSDK add-in.", color_black, color_none); + dupdate(); + + getkey(); + return 1; +} diff --git a/fxsdk/fxsdk.sh b/fxsdk/fxsdk.sh new file mode 100755 index 0000000..3e7f896 --- /dev/null +++ b/fxsdk/fxsdk.sh @@ -0,0 +1,127 @@ +#! /usr/bin/env bash + +# Note: this line is edited at install time to insert the install folder +PREFIX=\ + +usage_string=$(cat << EOF +usage: fxsdk new [] [options...] + fxsdk build [fx|cg] + fxsdk send [fx|cg] + +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. + +Project creation: + fxsdk new [] [options...] + -@ , --internal= Internal project name + +EOF +) + +usage() { + echo "$usage_string" + exit ${1:-1} +} + +error() { + echo -n "error: " >&2 + echo "$@" >&2 + echo "Try 'fxsdk --help' for more information." >&2 +} + +# TODO: Finish this interface +fxsdk_new_project_cli() { + internal= + + while [[ "$@" ]]; do + case "$1" in + -h|--help|-\?) + usage 0;; + + -@|--internal) + [[ -z "$2" ]] && error "$1 requires an argument" && return 1 + internal="$2" + shift;; + + --internal=*) + internal="${1#*=}";; + esac + + shift + done + + echo "internal=$internal" +} + +fxsdk_new_project_interactive() { + [[ -z "$1" ]] && error "please specify the project folder" && return 1 + [[ -e "$1" ]] && error "'$1' exists, I don't dare touch it" && return 1 + + echo -e "Creating a new project in folder '$1'.\n" + + echo -ne "Full project name ? (at most 8 characters)\n> " + read NAME + + echo -ne "Internal name ? ('@' followed by at most 7 uppercase letters)\n> " + read INTERNAL + + mkdir -p "$1"/{,src,assets-fx,assets-cg} + fxsdk_create_config > "$1/project.cfg" + + echo -e "\nYour project '$NAME' has been created.\n" + echo "Type 'fxsdk build-fx' or 'fxsdk build-cg' to compile the program." + + assets="$PREFIX/share/fxsdk/assets" + cp "$assets"/Makefile "$1" + cp "$assets"/main.c "$1"/src + cp "$assets"/icon-fx.png "$1"/assets-fx + cp "$assets"/icon-cg-uns.png "$1"/assets-cg + cp "$assets"/icon-cg-sel.png "$1"/assets-cg +} + +fxsdk_load_config() { + sed -E 's/^([A-Z_]+)\s*=\s*(.*)/\1="\2"' project.cfg | source /dev/stdin +} + +fxsdk_create_config() { + cat << EOF +#--- +# fxSDK project configuration file for $NAME +#--- + +# Project name, should be at most 8 bytes long. +NAME = $NAME +# Internal name, should be '@' followed by at most 7 uppercase letters. +INTERNAL = $INTERNAL + +# fx-9860G icon location +ICON_FX = assets-fx/icon-fx.png +# fx-CG 50 icon locations +ICON_CG_UNS = assets-cg/icon-cg-uns.png +ICON_CG_SEL = assets-cg/icon-cg-sel.png + +# Additional compiler flags +CFLAGS = -std=c11 -Os +# Additional linker flags +LDFLAGS = +EOF +} + +fxsdk_build() { + true +} + +# Parse command name + +case $1 in + new) + shift + fxsdk_new_project_interactive "$@";; + -h|--help|-\?) + usage 0;; + ?*) + error "unknown command '$1'" + exit 1;; + *) + usage 0;; +esac diff --git a/fxsdk/main.c b/fxsdk/main.c deleted file mode 100644 index 31dbf45..0000000 --- a/fxsdk/main.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(void) -{ - return 0; -}