1###############################################################################
2# Makefile for darch demo
3#
4# Copyright 2008 Nintendo.  All rights reserved.
5#
6# These coded instructions, statements, and computer programs contain
7# proprietary information of Nintendo of America Inc. and/or Nintendo
8# Company Ltd., and are protected by Federal copyright law.  They may
9# not be disclosed to third parties or copied or duplicated in any form,
10# in whole or in part, without the prior written consent of Nintendo.
11#
12# $Log: makefile,v $
13# Revision 1.2  2008/09/05 09:40:35  nrs_buildsystem
14# Changed all command to adopt "make -j option(parallel processing)" (by yasuh-to).
15#
16# Revision 1.1  2008/05/12 07:41:30  nakano_yoshinobu
17# Initial version.
18#
19#
20# $NoKeywords: $
21#
22###############################################################################
23# All modules have "setup" and "build" as targets.  System libraries
24# and demo programs also have an "install" target that copies the compiled
25# binaries to the binary tree (/$(ARCH_TARGET)).
26
27all:
28	$(MAKE) setup
29	$(MAKE) build
30	$(MAKE) install
31
32
33# commondefs must be included near the top so that all common variables
34# will be defined before their use.
35
36include $(REVOLUTION_SDK_ROOT)/build/buildtools/commondefs
37
38
39# module name should be set to the name of this subdirectory
40# DEMO = TRUE indicates that this module resides under the "demos" subtree.
41# The list of selectable paths can be found in modulerules.
42
43MODULENAME	= darchdemo
44DEMO		= TRUE
45
46
47# CSRCS lists all C files that should be built
48# The makefile determines which objects are linked into which binaries
49# based on the dependencies you fill in at the bottom of this file
50
51CSRCS		= darchdemo.c
52
53
54# BINNAMES lists all binaries that will be linked.  Note that no suffix is
55# required, as that will depend on whether this is a DEBUG build or not.
56# The final name of the binaries will be $(BINNAME)$(BINSUFFIX)
57
58BINNAMES 	= darchdemo
59
60
61# defining a linker command file will have the build system generate it
62# automatically and include it on the linker invocation line
63
64LCF_FILE	= $(INC_ROOT)/revolution/eppc.$(ARCH_TARGET).lcf
65
66
67# modulerules contains the rules that will use the above variables
68# and dependencies below to construct the binaries specified.
69
70include $(REVOLUTION_SDK_ROOT)/build/buildtools/modulerules
71
72
73# Dependencies for the binaries listed in BINNAMES should come here
74# They are your typical makefile rule, with extra variables to ensure
75# that the names and paths match up.
76# $(FULLBIN_ROOT) is the location of the local bin directory
77# $(BINSUFFIX) depends on whether this is a debug build or not
78# $(REVOLUTION_LIBS) includes all the Dolphin libraries.
79
80$(FULLBIN_ROOT)/darchdemo$(BINSUFFIX):	darchdemo.o \
81					$(INSTALL_ROOT)/lib/darch$(LIBSUFFIX) \
82					$(REVOLUTION_LIBS)
83
84dvdroot:
85	rm -rf dvddata
86	mkdir dvddata
87	cp -R $(REVOLUTION_SDK_ROOT)/dvddata/nanddemo dvddata/
88	cp -R $(REVOLUTION_SDK_ROOT)/dvddata/pictures dvddata/
89	rm -rf dvddata/*/CVS dvddata/*/Thumbs.db
90	cd dvddata;darchD -c nanddemo pictures darchtest.arc
91
92run:
93	make $(FULLBIN_ROOT)/darchdemo$(BINSUFFIX)
94	make dvdroot
95	cp darchdemo.ddf $(FULLBIN_ROOT)/$(subst elf,ddf,darchdemo$(BINSUFFIX))
96	ndrun $(FULLBIN_ROOT)/darchdemo$(BINSUFFIX)
97
98#======== End of makefile ========#
99