#! make -f
#----------------------------------------------------------------------------
# Project:  XNvg
# File:     Makefile
#
# Copyright 2005 GameFreak.inc  All rights reserved.
#
#----------------------------------------------------------------------------

SUBDIRS		=

DEPENDHEADERS	=	scr_seq_def.h	usescript.h
include	scrfile.lst
include msg_list

include	$(NITROSDK_ROOT)/build/buildtools/commondefs.cctype.CW
include	$(NITROSYSTEM_ROOT)/build/buildtools/commondefs

#MakeŐ*.bin/*.narcmake clean̍폜Ώۂɂ
LDIRT_CLEAN	= $(SCRSRCS:.ev=.bin) scr_seq.narc

IPATH	=	-I../eventdata
#----------------------------------------------------------------------------

include	$(NITROSYSTEM_ROOT)/build/buildtools/modulerules

do-build: $(SCRSRCS:.ev=.bin)

%.bin: %.ev $(DEPENDHEADERS)
	@echo $<
	@cp $< temp.s
	@$(MWAS) $(IPATH) temp.s -o $*.o
	@$(MWLD) -dis -o $*.elf $*.o
	@elf2bin $*.elf
	@rm $*.o
	@rm $*.elf

do-build: scr_seq.narc
scr_seq.narc: $(wildcard *.bin)
	nnsarc -i -c -l -n scr_seq.narc *.bin > arc_result.txt

mklst:
	ls -1 *.ev > temp
	listmk temp scrfile.lst SCRSRCS
	rm temp

mkmsglist:
	cat $(MSGLIST) > msglist.h
