# sample Makefile
#
# sample1.asm sample2.asm sample3.asm ̂R{̃\[Xt@CA
# R{Ƃ equ.h Ƃt@CCN[hĂꍇ Makefile łB
#
# NAME  REL  RELOCATE ̒`ƁACN[ht@C̃[̕
# ւ΁Apł܂B
#

# link ڏo͂̂́Amap t@C No̓t@Cilink.out) ŁA
# sym file  hex file  link o̓t@C ꂼ insp vO
# load vOɓ͂邱Ƃɂ܂B


# hex sym map ̃t@Cw肵܂B
NAME = mn_hp_smmain

# gp郂W[̃P[^ut@C񋓂܂B
REL = mn_mario_main.rel\
mn_mario_init.rel\
mn_hp_smmain.rel\
mn_hp_sminit.rel\
mn_hp_smplay.rel\
mn_hp_smenmy.rel\
mn_hp_smcros.rel\
mn_hp_smcset.rel\
mn_hp_smfrdt.rel\
mn_hp_smsub0.rel\
mn_hp_smsub1.rel\
mn_hp_smsub2.rel\
mn_hp_smend1.rel\
mn_hp_smsnd.rel

# Ñ[P[VLq܂B
RELOCATE = PROG=0000,DATA=0000


##### ʕ

.SUFFIXES: .rel .asm

.asm.rel:
	as65c $< -w

HEX = $(NAME).hex

SYM = $(NAME).sym

MAP = $(NAME).map

# P̃fBNgɂPvOȂ link.out ̂܂܂ł悢B
LNK = $(NAME).lnk

all:  $(HEX) $(SYM) $(MAP)

$(HEX): $(LNK)
	load -o $(HEX) $(LNK)

$(SYM): $(LNK)
	insp -f -s $(SYM) $(LNK)

$(LNK) $(MAP):	$(REL)
	link $(REL) -o $(LNK) -r$(RELOCATE) -lsv $(MAP)

##### CN[ht@C̃[

mn_hp_smmain	: mn_hp_smram.asm
mn_hp_sminit	: mn_hp_smram.asm
mn_hp_smcros	: mn_hp_smram.asm
mn_hp_smcset	: mn_hp_smram.asm
mn_hp_smenmy	: mn_hp_smram.asm
mn_hp_smfrdt	: mn_hp_smram.asm
mn_hp_smplay	: mn_hp_smram.asm
mn_hp_smsub0	: mn_hp_smram.asm
mn_hp_smsub1	: mn_hp_smram.asm
mn_hp_smsub2	: mn_hp_smram.asm
mn_hp_smend1	: mn_hp_smram.asm
mn_hp_smsnd	: mn_hp_smram.asm
