#! make -f
#----------------------------------------------------------------------------
# Project:  p[\if[^
# File:     Makefile
#
# Copyright 2005 GameFreak.inc  All rights reserved.
#
#----------------------------------------------------------------------------

SUBDIRS		=

PERFILES:=$(wildcard per_*.s)
WOTFILES:=$(wildcard wot_*.s)
EVOFILES:=$(wildcard evo_*.s)
PMSFILES:=$(wildcard pms_*.bin)

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

#MakeŐ*.bin/*.narcmake clean̍폜Ώۂɂ
LDIRT_CLEAN	= $(PERFILES:.s=.bin) $(WOTFILES:.s=.bin) $(EVOFILES:.s=.bin) $(PMSFILES) growtbl.narc personal.narc wotbl.narc evo.narc pms.narc

#----------------------------------------------------------------------------

include	$(NITROSYSTEM_ROOT)/build/buildtools/modulerules

.SUFFIXES: .s .bin

#Ȑe[u
do-build: growtbl.narc
growtbl.narc: grow_*.bin
	nnsarc -c -l -n growtbl.narc grow_*.bin

#p[\if[^
do-build: personal.narc
personal.narc: $(PERFILES:.s=.bin)
	nnsarc -c -l -n personal.narc per_*.bin

#Zoe[uf[^
do-build: wotbl.narc
wotbl.narc: $(WOTFILES:.s=.bin)
	nnsarc -c -l -n wotbl.narc wot_*.bin

#ie[uf[^
do-build: evo.narc
evo.narc: $(EVOFILES:.s=.bin)
	nnsarc -c -l -n evo.narc evo_*.bin
	pmseed

do-build: $(PERFILES:.s=.bin)
%.bin:%.s
	$(MWAS) $< -o $*.o
	$(MWLD) -dis -o $*.elf $*.o
	elf2bin $*.elf
	rm $*.o
	rm $*.elf

do-build: $(WOTFILES:.s=.bin)
%.bin:%.s
	$(MWAS) $< -o $*.o
	$(MWLD) -dis -o $*.elf $*.o
	elf2bin $*.elf
	rm $*.o
	rm $*.elf

do-build: $(EVOFILES:.s=.bin)
%.bin:%.s
	$(MWAS) $< -o $*.o
	$(MWLD) -dis -o $*.elf $*.o
	elf2bin $*.elf
	rm $*.o
	rm $*.elf

