diff --git a/Makefile b/Makefile index 103d3070..4615aad5 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,9 @@ endif make: ${ENV_RUN} make -j -C build HOST_ENV=${HOST_ENV} build_rom: + ${ENV_RUN} make -j -C build ARGS="install" HOST_ENV=${HOST_ENV} ${ENV_RUN} make -j -C build HOST_ENV=${HOST_ENV} - ${ENV_RUN} ./build_rom.sh + ${ENV_RUN} ./scripts/build_rom.sh preinstall: ${ENV_RUN} make -j -C build ARGS="preinstall" HOST_ENV=${HOST_ENV} install: @@ -20,7 +21,7 @@ install: clean: ${ENV_RUN} make -j -C build ARGS="clean" HOST_ENV=${HOST_ENV} purge: - ${ENV_RUN} rm -rf $$(find build -mindepth 1 -maxdepth 1 -type d) + ${ENV_RUN} rm -rf $$(find build -mindepth 1 -maxdepth 1 -type d) dist test: ${ENV_RUN} make -j -C build ARGS="test" HOST_ENV=${HOST_ENV} @@ -55,34 +56,28 @@ release: ${ENV_RUN} rm -rf build/${HOST_ENV}-release ${ENV_RUN} ./scripts/setup_build ${HOST_ENV} release ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s ${HOST_ENV}-release build/current debug: ${ENV_RUN} rm -rf build/${HOST_ENV}-debug ${ENV_RUN} ./scripts/setup_build ${HOST_ENV} debug ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s ${HOST_ENV}-debug build/current windows: ${ENV_RUN} rm -rf build/windows ${ENV_RUN} ./scripts/setup_build windows ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s windows build/current windows-debug: ${ENV_RUN} rm -rf build/windows ${ENV_RUN} ./scripts/setup_build windows debug ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s windows build/current gba: ${ENV_RUN} rm -rf build/gba-release - ${ENV_RUN} ./scripts/setup_build gba + ${ENV_RUN} ./scripts/setup_build gba release ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s gba-release build/current gba-debug: ${ENV_RUN} rm -rf build/gba-debug ${ENV_RUN} ./scripts/setup_build gba debug ${ENV_RUN} rm -f build/current - ${ENV_RUN} ln -s gba-debug build/current diff --git a/build_rom.sh b/build_rom.sh deleted file mode 100755 index 38557b6f..00000000 --- a/build_rom.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env bash - -set -e - -echo NOSTALGIA_MEDIA_HEADER_________ > media_header.txt - -./build/current/deps/ox/src/ox/fs/oxfs format 32 1k nostalgia_media.oxfs -./build/current/src/tools/nost-pack -fs nostalgia_media.oxfs -img charset.png -inode 101 -tiles 40 -bpp 4 -c - -${DEVKITARM}/bin/padbin 32 build/gba-release/src/player/nostalgia.bin -cat build/gba-release/src/player/nostalgia.bin media_header.txt nostalgia_media.oxfs > nostalgia.gba -${DEVKITARM}/bin/gbafix nostalgia.gba diff --git a/scripts/build_rom.sh b/scripts/build_rom.sh new file mode 100755 index 00000000..fe9c065e --- /dev/null +++ b/scripts/build_rom.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env bash + +set -e + +echo NOSTALGIA_MEDIA_HEADER_________ > media_header.txt + +./dist/current/bin/oxfs format 32 1k nostalgia_media.oxfs +./dist/current/bin/nost-pack -fs nostalgia_media.oxfs -img charset.png -inode 101 -tiles 40 -bpp 4 -c + +${DEVKITARM}/bin/padbin 32 build/gba-release/src/nostalgia/player/nostalgia.bin +cat build/gba-release/src/nostalgia/player/nostalgia.bin media_header.txt nostalgia_media.oxfs > nostalgia.gba +${DEVKITARM}/bin/gbafix nostalgia.gba diff --git a/scripts/setup_build b/scripts/setup_build index 09bf9ef4..4214694d 100755 --- a/scripts/setup_build +++ b/scripts/setup_build @@ -10,7 +10,7 @@ BUILD_TYPE=$2 if [[ $TARGET == windows ]]; then toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/Mingw.cmake" elif [[ $TARGET == gba ]]; then - toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DWOMBAT_BUILD_TYPE=GBA -DOX_USE_STDLIB=OFF -DCMAKE_INSTALL_PREFIX=$DEVKITARM" + toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DWOMBAT_BUILD_TYPE=GBA -DOX_USE_STDLIB=OFF" fi if [[ $BUILD_TYPE == debug ]]; then @@ -30,3 +30,8 @@ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ $toolchain \ $project popd + +rm -f build/current dist/current +mkdir -p dist +ln -s ${TARGET}-${BUILD_TYPE} build/current +ln -s ${TARGET}-${BUILD_TYPE} dist/current diff --git a/src/nostalgia/player/CMakeLists.txt b/src/nostalgia/player/CMakeLists.txt index 2002182d..6ef86335 100644 --- a/src/nostalgia/player/CMakeLists.txt +++ b/src/nostalgia/player/CMakeLists.txt @@ -24,3 +24,12 @@ target_link_libraries( OxStd OxFS ) + +add_custom_target("nostalgia.bin") +install( + TARGETS + nostalgia + DESTINATION + bin +) +