mirror of
https://git.planet-casio.com/Lephenixnoir/fxsdk.git
synced 2024-12-29 13:03:37 +01:00
fxsdk: update Makefile-based build system for fxconv
* Use [find] for sources since it's used for dependency files... * Get fxconv parameters from fxconv-metadata.txt * Approximate dependencies: every asset depends on every metadata file * Update location of example image
This commit is contained in:
parent
e8bbf63d95
commit
ad5d9bdb4c
3 changed files with 24 additions and 46 deletions
|
@ -68,18 +68,15 @@ ELF_CG := build-cg/$(shell basename "$(TARGET_CG)" .g3a).elf
|
||||||
BIN_CG := $(ELF_CG:.elf=.bin)
|
BIN_CG := $(ELF_CG:.elf=.bin)
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
src := $(wildcard src/*.[csS] \
|
src := $(shell find src/ -name '*.[csS]')
|
||||||
src/*/*.[csS] \
|
assets-fx := $(shell find assets-fx/*/ -type f -not -name 'fxconv-metadata.txt')
|
||||||
src/*/*/*.[csS] \
|
assets-cg := $(shell find assets-cg/*/ -type f -not -name 'fxconv-metadata.txt')
|
||||||
src/*/*/*/*.[csS])
|
meta-fx := $(shell find assets-fx -name 'fxconv-metadata.txt')
|
||||||
assets-fx := $(wildcard assets-fx/*/*)
|
meta-cg := $(shell find assets-cg -name 'fxconv-metadata.txt')
|
||||||
assets-cg := $(wildcard assets-cg/*/*)
|
|
||||||
|
|
||||||
# Object files
|
# Object files
|
||||||
obj-fx := $(src:%=build-fx/%.o) \
|
obj-fx := $(src:%=build-fx/%.o) $(assets-fx:assets-fx/%=build-fx/assets/%.o)
|
||||||
$(assets-fx:assets-fx/%=build-fx/assets/%.o)
|
obj-cg := $(src:%=build-cg/%.o) $(assets-cg:assets-cg/%=build-cg/assets/%.o)
|
||||||
obj-cg := $(src:%=build-cg/%.o) \
|
|
||||||
$(assets-cg:assets-cg/%=build-cg/assets/%.o)
|
|
||||||
|
|
||||||
# Additional dependencies
|
# Additional dependencies
|
||||||
deps-fx := $(ICON_FX)
|
deps-fx := $(ICON_FX)
|
||||||
|
@ -139,37 +136,13 @@ build-cg/%.S.o: %.S
|
||||||
@ mkdir -p $(dir $@)
|
@ mkdir -p $(dir $@)
|
||||||
$(TOOLCHAIN_CG)-gcc -c $< -o $@ $(INCLUDE_CG)
|
$(TOOLCHAIN_CG)-gcc -c $< -o $@ $(INCLUDE_CG)
|
||||||
|
|
||||||
# Images
|
# Assets
|
||||||
build-fx/assets/img/%.o: assets-fx/img/%
|
build-fx/assets/%.o: assets-fx/% $(meta-fx)
|
||||||
@ mkdir -p $(dir $@)
|
@ mkdir -p $(dir $@)
|
||||||
fxconv --bopti-image $< -o $@ $(FXCONVFX) name:img_$(basename $*) $(IMG.$*)
|
fxconv $< -o $@ $(FXCONVFX)
|
||||||
build-cg/assets/img/%.o: assets-cg/img/%
|
build-cg/assets/%.o: assets-cg/% $(meta-cg)
|
||||||
@ mkdir -p $(dir $@)
|
@ mkdir -p $(dir $@)
|
||||||
fxconv --bopti-image $< -o $@ $(FXCONVCG) name:img_$(basename $*) $(IMG.$*)
|
fxconv $< -o $@ $(FXCONVCG)
|
||||||
|
|
||||||
# Fonts
|
|
||||||
build-fx/assets/fonts/%.o: assets-fx/fonts/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv -f $< -o $@ $(FXCONVFX) name:font_$(basename $*) $(FONT.$*)
|
|
||||||
build-cg/assets/fonts/%.o: assets-cg/fonts/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv -f $< -o $@ $(FXCONVCG) name:font_$(basename $*) $(FONT.$*)
|
|
||||||
|
|
||||||
# Binaries
|
|
||||||
build-fx/assets/bin/%.o: assets-fx/bin/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv -b $< -o $@ $(FXCONVFX) name:bin_$(basename $*) $(BIN.$*)
|
|
||||||
build-cg/assets/bin/%.o: assets-cg/bin/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv -b $< -o $@ $(FXCONVCG) name:bin_$(basename $*) $(BIN.$*)
|
|
||||||
|
|
||||||
# Custom conversions
|
|
||||||
build-fx/assets/%.o: assets-fx/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv --custom $< -o $@ $(FXCONVFX) type:$(subst /,,$(dir $*)) name:$(subst /,_,$(basename $*))
|
|
||||||
build-cg/assets/%.o: assets-cg/%
|
|
||||||
@ mkdir -p $(dir $@)
|
|
||||||
fxconv --custom $< -o $@ $(FXCONVCG) type:$(subst /,,$(dir $*)) name:$(subst /,_,$(basename $*))
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cleaning and utilities
|
# Cleaning and utilities
|
||||||
|
|
|
@ -17,10 +17,10 @@ TARGET_FX :=
|
||||||
TARGET_CG :=
|
TARGET_CG :=
|
||||||
|
|
||||||
# fx-9860G icon location
|
# fx-9860G icon location
|
||||||
ICON_FX = assets-fx/icon-fx.png
|
ICON_FX = assets-fx/icon.png
|
||||||
# fx-CG 50 icon locations
|
# fx-CG 50 icon locations
|
||||||
ICON_CG_UNS = assets-cg/icon-cg-uns.png
|
ICON_CG_UNS = assets-cg/icon-uns.png
|
||||||
ICON_CG_SEL = assets-cg/icon-cg-sel.png
|
ICON_CG_SEL = assets-cg/icon-sel.png
|
||||||
|
|
||||||
#---
|
#---
|
||||||
# Toolchain selection
|
# Toolchain selection
|
||||||
|
|
|
@ -90,9 +90,16 @@ fxsdk_new_project() {
|
||||||
"Makefile")
|
"Makefile")
|
||||||
sed -e "s/@NAME@/$NAME/g" -e "s/@INTERNAL@/$INTERNAL/g" \
|
sed -e "s/@NAME@/$NAME/g" -e "s/@INTERNAL@/$INTERNAL/g" \
|
||||||
"$assets/project.cfg" > "$1/project.cfg"
|
"$assets/project.cfg" > "$1/project.cfg"
|
||||||
cp "$assets/Makefile" "$1";;
|
cp "$assets/Makefile" "$1"
|
||||||
|
|
||||||
|
mkdir -p "$1"/{assets-fx,assets-cg}/img
|
||||||
|
cp -r "$assets"/assets-fx/* "$1"/assets-fx/img/
|
||||||
|
cp -r "$assets"/assets-cg/* "$1"/assets-cg/img/;;
|
||||||
|
|
||||||
"CMake")
|
"CMake")
|
||||||
cp "$assets/CMakeLists.txt" "$1";;
|
cp "$assets/CMakeLists.txt" "$1"
|
||||||
|
cp -r "$assets"/assets-fx "$1"/
|
||||||
|
cp -r "$assets"/assets-cg "$1"/;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cp "$assets"/gitignore "$1"/.gitignore
|
cp "$assets"/gitignore "$1"/.gitignore
|
||||||
|
@ -100,8 +107,6 @@ fxsdk_new_project() {
|
||||||
cp "$assets"/icon-fx.png "$1"/assets-fx/icon.png
|
cp "$assets"/icon-fx.png "$1"/assets-fx/icon.png
|
||||||
cp "$assets"/icon-cg-uns.png "$1"/assets-cg/icon-uns.png
|
cp "$assets"/icon-cg-uns.png "$1"/assets-cg/icon-uns.png
|
||||||
cp "$assets"/icon-cg-sel.png "$1"/assets-cg/icon-sel.png
|
cp "$assets"/icon-cg-sel.png "$1"/assets-cg/icon-sel.png
|
||||||
cp -r "$assets"/assets-fx "$1"/
|
|
||||||
cp -r "$assets"/assets-cg "$1"/
|
|
||||||
|
|
||||||
echo "Created a new project $NAME (build system: $generator)."
|
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' to compile the program."
|
||||||
|
|
Loading…
Reference in a new issue