############################################################################### # Makefile for sampledemo # # Copyright (C) 2005-2006 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.8.4.3 2008/07/30 02:36:08 wada_jumpei # Modified ACCESS_GAMECODE. # # Revision 1.8.4.2 2008/07/25 01:41:08 nakano_yoshinobu # Merged strapcntdemo with cntdemo. # # Revision 1.9 2008/07/23 00:32:21 wada_jumpei # Merged datatitledemo with cntdemo. # # Revision 1.8 2008/01/08 10:59:01 wada_jumpei # Added compressing a dol file to "makewad" target. # # Revision 1.7 2007/10/11 02:16:14 wada_jumpei # Added makewad_simple target. # # Revision 1.3 2007/08/07 05:18:11 wada_jumpei # Fixed makewad target. # # Revision 1.2 2007/08/06 02:33:13 wada_jumpei # Added detailed examples of making wad file with some settings. # # Revision 1.1 2006/09/08 13:48:30 wada_jumpei # Intial revision # ############################################################################### # All modules have "setup" and "build" as targets. System libraries # and demo programs also have an "install" target that copies the compiled # binaries to the binary tree (/$(ARCH_TARGET)). all: setup build install # commondefs must be included near the top so that all common variables # will be defined before their use. include $(REVOLUTION_SDK_ROOT)/build/buildtools/commondefs # module name should be set to the name of this subdirectory # DEMO = TRUE indicates that this module resides under the "demos" subtree. # The list of selectable paths can be found in modulerules. MODULENAME = cntdemo DEMO = TRUE # CSRCS lists all C files that should be built # The makefile determines which objects are linked into which binaries # based on the dependencies you fill in at the bottom of this file CSRCS = cntdemo.c datatitledemo.c strapcntdemo.c # BINNAMES lists all binaries that will be linked. Note that no suffix is # required, as that will depend on whether this is a DEBUG build or not. # The final name of the binaries will be $(BINNAME)$(BINSUFFIX) BINNAMES = cntdemo datatitledemo strapcntdemo # defining a linker command file will have the build system generate it # automatically and include it on the linker invocation line LCF_FILE = $(INC_ROOT)/revolution/eppc.$(ARCH_TARGET).lcf # modulerules contains the rules that will use the above variables # and dependencies below to construct the binaries specified. include $(REVOLUTION_SDK_ROOT)/build/buildtools/modulerules # additional libraries not defined as REVOLUTION_LIBS TPL_LIB = $(INSTALL_ROOT)/lib/tpl$(LIBSUFFIX) # Dependencies for the binaries listed in BINNAMES should come here # They are your typical makefile rule, with extra variables to ensure # that the names and paths match up. # $(FULLBIN_ROOT) is the location of the local bin directory # $(BINSUFFIX) depends on whether this is a debug build or not # $(REVOLUTION_LIBS) includes all the Revolution libraries. REVOLUTION_LIBS += $(INSTALL_ROOT)/lib/cnt$(LIBSUFFIX) $(FULLBIN_ROOT)/cntdemo$(BINSUFFIX): cntdemo.o $(REVOLUTION_LIBS) $(FULLBIN_ROOT)/datatitledemo$(BINSUFFIX): datatitledemo.o $(REVOLUTION_LIBS) $(FULLBIN_ROOT)/strapcntdemo$(BINSUFFIX): strapcntdemo.o $(REVOLUTION_LIBS) $(TPL_LIB) ############################################################################### # common settings for demos ############################################################################### DVDROOT_DIR = $(subst \,/,$(REVOLUTION_SDK_ROOT))/dvddata ARCFILE_DIR = $(DVDROOT_DIR)/archives ############################################################################### # "makewad" target will show how to make a WAD file in detailed steps. # "makewad_simple" target shows how to make a WAD file using makefile rules. # # When switching between compiling as Disc or NAND application, # please make sure to "make clean" ############################################################################### makewad: @echo "------------------------------------------" @echo " 1. build program as a NAND application" @echo "------------------------------------------" make NANDAPP=TRUE NOEXPORT=TRUE @echo "" @echo "------------------------------------------" @echo " 2. convert elf file to dol file" @echo "------------------------------------------" makedol -f $(FULLBIN_ROOT)/cntdemo$(BINSUFFIX) -d $(FULLBIN_ROOT)/cntdemo$(DOLSUFFIX) @echo "" @echo "------------------------------------------" @echo " 3. compress the dol file" @echo "------------------------------------------" ntcompress -lex -A32 -o $(FULLBIN_ROOT)/cntdemo$(DOLSUFFIX)$(LZ77SUFFIX) $(FULLBIN_ROOT)/cntdemo$(DOLSUFFIX) @echo "" @echo "------------------------------------------" @echo " 4. archive content2 directory" @echo "------------------------------------------" @if [ ! -e $(ARCFILE_DIR) ] ; then \ echo "mkdir $(ARCFILE_DIR)"; \ mkdir $(ARCFILE_DIR); \ fi cd $(DVDROOT_DIR)/content2; \ darchD -c * $(DVDROOT_DIR)/archives/content2.arc darchD -tv $(DVDROOT_DIR)/archives/content2.arc @echo "" @echo "------------------------------------------" @echo " 5. make a wad file" @echo "------------------------------------------" makeWad -n cntdemo$(ASUFFIX) -l $(FULLBIN_ROOT)/cntdemo$(DOLSUFFIX)$(LZ77SUFFIX),$(DVDROOT_DIR)/archives/content2.arc mv cntdemo$(WADSUFFIX) $(FULLBIN_ROOT)/ makewad_simple: @echo "------------------------------------------" @echo " Same as make makewad, but simpler usage" @echo "------------------------------------------" make NANDAPP=TRUE CNT_IDX=2 ############################################################################### # "datatitle" target will show how to make a data title WAD file ############################################################################### DVDROOT_DIR = $(subst \,/,$(REVOLUTION_SDK_ROOT))/dvddata ARCFILE_DIR = $(DVDROOT_DIR)/archives # Data title's game code must start with lowercase 'a' through 'z' DATATITLE_GAMECODE = a000 ACCESS_GAMECODE = 0001 ACCESS_TITLEMASK = 0x000000ff datatitle: setup @echo "---------------------------------------------" @echo " 1. manually archive content index 1 of $(DATATITLE_GAMECODE) " @echo "---------------------------------------------" @if [ ! -e $(ARCFILE_DIR) ] ; then \ echo "mkdir $(ARCFILE_DIR)"; \ mkdir $(ARCFILE_DIR); \ fi cd $(DVDROOT_DIR)/datatitle/$(DATATITLE_GAMECODE)/content1; \ darchD -c * $(DVDROOT_DIR)/archives/content1_$(DATATITLE_GAMECODE).arc darchD -tv $(DVDROOT_DIR)/archives/content1_$(DATATITLE_GAMECODE).arc @echo "" @echo "------------------------------------------" @echo " 2. make a data title wad file" @echo "------------------------------------------" makeWad -f -n $(DATATITLE_GAMECODE) -l $(DVDROOT_DIR)/archives/content1_$(DATATITLE_GAMECODE).arc -gc $(DATATITLE_GAMECODE) -E $(ACCESS_GAMECODE) -e $(ACCESS_TITLEMASK) mv $(DATATITLE_GAMECODE).wad $(FULLBIN_ROOT)/ #======== End of makefile ========#