#! make -f
#----------------------------------------------------------------------------
# Project:  NitroSystem - build - demos - g2d - bg - ShareBG
# File:     Makefile
#
# Copyright 2004 Nintendo.  All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law.  They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Log: Makefile,v $
# Revision 1.6  12/03/2004 05:25:53  hatamoto_minoru
# Data files are also compliant during executable file make or clean
#
# Revision 1.5  12/03/2004 01:51:59  kitani_toshikazu
# Added resource reconvert process
#
# Revision 1.4  11/04/2004 01:45:23  hatamoto_minoru
# Revised comments
#
# Revision 1.3  09/06/2004 02:54:55  hatamoto_minoru
# Added loader.c
#
# Revision 1.2  09/06/2004 02:53:17  hatamoto_minoru
# Please do not use .rsf file
#
# Revision 1.1  09/02/2004 08:49:19  hatamoto_minoru
# Registered the initial version.
#
# $NoKeywords: $
#----------------------------------------------------------------------------

SRCS		=	main.c loader.c
TARGET_NEF	=	main.nef
TARGET_BIN	=	main.srl

MAKEROM_ROMROOT  = ./
MAKEROM_ROMFILES = data/*.*

G2D_TEST_RES_SRC = $(wildcard data/src/Screen/*.*)
G2D_TEST_CVTR_OUTDIR = data

G2D_TEST_RES_NSC = $(G2D_TEST_RES_SRC)
G2D_TEST_RES_NSCR = $(G2D_TEST_RES_NSC:.nsc=.NSCR)


G2D_TEST_RES_TARGET = $(subst data/src/Screen/,data/,$(G2D_TEST_RES_NSCR))

BINRES_FILES = $(G2D_TEST_CVTR_OUTDIR)/*.NCER 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NMCR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NCGR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NCBR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NCLR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NANR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NMAR 
BINRES_FILES := $(BINRES_FILES) $(G2D_TEST_CVTR_OUTDIR)/*.NSCR

LDIRT_CLEAN = $(BINRES_FILES)

#----------------------------------------------------------------------------
include	$(NITROSYSTEM_ROOT)/build/buildtools/commondefs

data/%.NSCR: data/src/Screen/%.nsc
	$(NITROSYSTEM_ROOT)/tools/win/bin/g2dcvtr.exe $< -o/$(G2D_TEST_CVTR_OUTDIR)

reconv: $(G2D_TEST_RES_TARGET)

do-build: reconv $(TARGETS)

include	$(NITROSYSTEM_ROOT)/build/buildtools/modulerules


#===== End of Makefile =====

