#------------------------------------------------------------------------------
# The Katana bootable-disc payload, for the GD-DA disc. Run SetPaths.bat from
# the SDK, then `gmake` here. See `../../README.md`.
#------------------------------------------------------------------------------

PROJECT		= katana_cdda

# Where tests/e2e/test_bootable_disc.cpp looks for it: the root of this
# environment's folder, beside gd_root rather than inside it. mkdcdisc writes
# the executable into the filesystem itself, under the name its IP.BIN header
# declares, so a copy in the -D tree as well would hand it the same file twice.
PAYLOAD		= ..\katana.bin

# First target in the file, so plain `gmake` runs it. dc.inc's own ALL -- which
# is CLEAN followed by DEFAULT, and so always a full rebuild -- does the work;
# this only puts the result where it belongs. Defined above the include because
# what makes a goal the default is being seen first, not being defined last.
payload: ALL
	copy /y "$(OUTDIR)\$(PROJECT).bin" "$(PAYLOAD)"
	@echo Done: $(PAYLOAD)

PROJECT_SRC	= \
		main.c\
		init.c\

# Nothing beyond the core libraries and the graphics one below. In particular
# not sg_sd: the sound driver is only needed for the CD-DA volume and pan
# controls, which this payload does without so that MANATEE.DRV stays out of
# the repository. gdFsDaPlay() belongs to the GD filesystem library, which is
# linked either way.
SYSTEM_LIBS	=

OPTIMIZE	= 1

GFXLIB		= NINJA

# A raw binary rather than an ELF: dc.inc runs elf2bin on the result, loaded at
# 0x8C010000, which is what mkdcdisc's -b/--main-binary-unscrambled expects. The
# KallistiOS payload covers the -e/ELF route, so this one covers -b.
OUTPUT		= BIN

DEBUG		= FALSE
LIST		= FALSE

include $(KATANA_ROOT)\Sample\dc.inc
