############################################################################### # Makefile for nwc24demo # # Copyright 2006,2007 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.37 2007/11/19 02:30:50 inaba_kimitaka # The path specification of ntcompress was wrong, so it was corrected # # Revision 1.36 2007/11/13 23:27:11 nishimoto_takashi # The path to darchD.exe was wrong, so it was corrected # # Revision 1.35 2007/11/13 01:20:56 nishimoto_takashi # The letter demo was changed to specify GX_REPEAT during creation of TPL files # Revised the stationary and envelope images to make them easier to see # # Revision 1.34 2007/07/31 10:59:53 hatamoto_minoru # Added ChannelJump.wad's dependency relationships. # Changed such that the dvddata and viewer directories for ChannelJump are created. # # Revision 1.33 2007/07/30 04:52:39 nishimoto_takashi # Revised import target descriptions. # # Revision 1.32 2007/07/30 04:27:41 nishimoto_takashi # Changed the location at which ChannelJump.wad is created. Added make import. # # Revision 1.31 2007/07/30 01:20:05 nishimoto_takashi # Added the ChannelJump demo. # # Revision 1.30 2007/07/13 02:10:18 hirose_kazuki # Moved some of the demos. # # Revision 1.29 2007/07/11 09:42:32 yasu # Registration of intermediate files. # Support for make -s. # # Revision 1.28 2007/07/06 06:54:03 nishimoto_takashi # Specified the TexConv path to somewhere within the SDK. # # Revision 1.27 2007/07/06 02:34:30 nishimoto_takashi # In the Letter demo, made it possible to generate ARC files directly from TGA files. # # Revision 1.26 2007/07/05 07:38:33 nishimoto_takashi # Added the Letter demo. # # Revision 1.25 2007/06/23 12:22:05 seiki_masashi # Separated the shared source from the script-related demos. # # Revision 1.24 2007/06/18 01:26:54 hirose_kazuki # Added simple script demos. # # Revision 1.23 2007/06/14 00:45:40 hirose_kazuki # Added 'WiiNumber' demo. # # Revision 1.22 2007/06/07 06:06:39 adachi_hiroaki # Added a demo of the download feature. # # Revision 1.21 2007/05/14 11:37:17 hatamoto_minoru # Made "all" only dependent on "install" to support "make -j". # # Revision 1.20 2006/10/23 04:13:43 hirose_kazuki # Added 'Check' demo. # # Revision 1.19 2006/09/27 09:04:47 torigoe_nobutaka # Rearranged directory structure. # # Revision 1.18 2006/09/26 09:25:27 hirose_kazuki # Deleted InitMsgBox. # # Revision 1.17 2006/09/13 10:07:50 torigoe_nobutaka # Added FLViewer. # # Revision 1.16 2006/09/10 09:26:51 hirose_kazuki # Renamed MsgView -> MsgPrint. # # Revision 1.15 2006/09/09 06:01:26 hirose_kazuki # Changed all demos to use REX_LIBS to link. # # Revision 1.14 2006/09/05 10:56:42 yosizaki # Changed to use demos/share. # # Revision 1.13 2006/08/30 13:39:06 terui # Supported REXDEMO library once again. # # Revision 1.12 2006/08/30 10:27:53 terui # Added support for REXDEMO library. # # Revision 1.11 2006/08/28 08:52:13 torigoe_nobutaka # Added MessageViewer. # # Revision 1.10 2006/08/25 06:16:16 torigoe_nobutaka # Added MsgSearch. # # Revision 1.9 2006/08/25 04:23:45 terui # Made revisions in line with change of how the Schedule demo is created. # # Revision 1.8 2006/08/24 12:36:18 terui # Made revisions in line with change of how the Schedule demo is created. # # Revision 1.7 2006/08/09 02:53:06 hirose_kazuki # Changed to link net library. # # Revision 1.6 2006/08/08 06:17:26 yasu # Deleted REX_TITLEID. # # Revision 1.5 2006/07/31 04:32:29 yasu # Added TitleID specification. # # Revision 1.4 2006/07/18 08:53:30 terui # Added schedule demo. # # Revision 1.3 2006/07/09 13:10:10 yasu # PPC make tree connection completed. # # Revision 1.2 2006/07/01 07:12:20 hirose_kazuki # Changed to match sdd-pseg1 build system. # # Revision 1.1 2006/06/29 12:45:59 hirose_kazuki # Moved from another repository. # # Revision 1.1 2006/06/12 07:36:52 hirose # Initial check in. # # # $NoKeywords: $ # ############################################################################### # 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: install # Add Suffix for WAD File ifdef NDEBUG WADSUFFIX=.wad else WADSUFFIX=D.wad endif # commondefs must be included near the top so that all common variables # will be defined before their use. include $(REVOLUTION_EXT_ROOT)/build/buildtools/commondefs include $(REVOLUTION_EXT_ROOT)/build/demos/share/commondefs.demoshare # 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 = nwc24demo DEMO = TRUE REX_NETDEMO = 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 = MsgList/MsgList.c \ \ MsgPost/MsgPost.c \ \ MsgPrint/MsgPrint.c \ \ Schedule/Schedule.c \ \ MsgSearch/MsgSearch.c \ MsgSearch/PostTestMsg.c \ \ MsgViewer/MsgViewer.c \ MsgViewer/MsgViewerRender.c \ MsgViewer/MsgViewerUpdate.c \ \ FLViewer/FLViewer.c \ FLViewer/FLViewerUpdate.c \ FLViewer/FLViewerRender.c \ \ Check/Check.c \ \ Download/Download.c \ \ WiiNumber/WiiNumber.c \ \ Letter/Letter.c \ \ ChannelJump/ChannelJump.c \ ChannelJump/Src.c DATS = Letter/my_letter.arc \ ChannelJump/Template.arc # 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 = MsgList \ MsgPost \ MsgPrint \ Schedule \ MsgSearch \ MsgViewer \ FLViewer \ Check \ Download \ WiiNumber \ Letter \ ChannelJump # 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_EXT_ROOT)/build/buildtools/modulerules include $(REVOLUTION_EXT_ROOT)/build/demos/share/modulerules.demoshare # 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. $(FULLBIN_ROOT)/MsgList$(BINSUFFIX): MsgList/MsgList.o \ $(REVOLUTION_LIBS) $(NWC24_LIB) $(REX_LIBS) $(FULLBIN_ROOT)/MsgPost$(BINSUFFIX): MsgPost/MsgPost.o \ $(REVOLUTION_LIBS) $(NWC24_LIB) $(REX_LIBS) $(FULLBIN_ROOT)/MsgPrint$(BINSUFFIX): MsgPrint/MsgPrint.o \ $(REVOLUTION_LIBS) $(NWC24_LIB) $(REX_LIBS) $(FULLBIN_ROOT)/MsgSearch$(BINSUFFIX): MsgSearch/MsgSearch.o \ MsgSearch/PostTestMsg.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/Schedule$(BINSUFFIX): Schedule/Schedule.o \ $(REX_DEMOSHARE_OBJS) $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/MsgViewer$(BINSUFFIX): MsgViewer/MsgViewer.o \ MsgViewer/MsgViewerRender.o \ MsgViewer/MsgViewerUpdate.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/FLViewer$(BINSUFFIX): FLViewer/FLViewer.o \ FLViewer/FLViewerUpdate.o \ FLViewer/FLViewerRender.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/Check$(BINSUFFIX): Check/Check.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/Download$(BINSUFFIX): Download/Download.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/WiiNumber$(BINSUFFIX): WiiNumber/WiiNumber.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/Letter$(BINSUFFIX): Letter/Letter.o \ $(FULLBINOBJ_ROOT)/Letter/my_letter.arc.o \ $(REVOLUTION_LIBS) $(REX_LIBS) $(FULLBIN_ROOT)/ChannelJump$(BINSUFFIX): ChannelJump/ChannelJump.o \ ChannelJump/Src.o \ $(FULLBINOBJ_ROOT)/ChannelJump/Template.arc.o \ $(REVOLUTION_LIBS) $(REX_LIBS) ifeq ($(wildcard $(ROOT)/X86/bin/makeWad.exe),$(ROOT)/X86/bin/makeWad.exe) dobuild: $(FULLBIN_ROOT)/ChannelJump$(WADSUFFIX) endif $(FULLBIN_ROOT)/ChannelJump$(WADSUFFIX): $(FULLBIN_ROOT)/ChannelJump$(BINSUFFIX) makedol -f $(FULLBIN_ROOT)/ChannelJump$(BINSUFFIX) -d $(FULLBIN_ROOT)/ChannelJump$(DOLSUFFIX) makeWad -n ChannelJump -l $(FULLBIN_ROOT)/ChannelJump$(DOLSUFFIX) -m data/ChannelJump/title.met -g 01 -gc 0001 install -d ./dvddata/viewer mv ChannelJump.wad ./dvddata/viewer # Start Nmenu.elf and register ChannelJump.wad. import: $(FULLBIN_ROOT)/ChannelJump$(WADSUFFIX) setndenv DvdRoot "$(REVOLUTION_EXT_ROOT)\build\demos\nwc24demo\dvddata" ndrun $(REVOLUTION_SDK_ROOT)\RVL\bin\tools\Nmenu.elf -a -i ChannelJump.wad setndenv DvdRoot "$(REVOLUTION_SDK_ROOT)\dvddata" ############################################################ ## For the Letter and ChannelJump demos ############################################################ CHJUMP_PATH = data/ChannelJump LETTER_PATH = data/Letter define CD_ARCPATH $(if $(SILENT),,@echo "change dir... ") cd $(LETTER_PATH)/ endef LETTER_FILES = $(filter-out my_LetterS_b.tga,\ $(notdir $(wildcard $(LETTER_PATH)/img/*.tga))) LETTER_FILES_PATH = $(subst .tga,.tpl,\ $(addprefix img/,$(LETTER_FILES))) LETTER_FILES_FULLPATH = $(subst .tga,.tpl,\ $(addprefix $(LETTER_PATH)/img/,$(LETTER_FILES))) # # Register intermediate files # make will automatically delete these files for us # Also, this will no longer involve examining make's dependencies. # INTERMEDIATES = $(LETTER_PATH)/thumbnail_LZ.bin \ $(LETTER_PATH)/letter_LZ.bin \ $(LETTER_PATH)/thumbnail.arc \ $(LETTER_PATH)/letter.arc \ $(LETTER_FILES_FULLPATH) \ $(LETTER_FILES_FULLPATH:.tpl=.tcs) \ $(LETTER_PATH)/img/my_LetterS_b.tpl \ $(LETTER_PATH)/img/my_LetterS_b.tcs \ $(CHJUMP_PATH)/chjump.bin \ $(CHJUMP_PATH)/Template.arc .INTERMEDIATE: $(INTERMEDIATES) # Default target # Generate archive -> Delete unnecessary files $(CHJUMP_PATH)/Template.arc: $(CHJUMP_PATH)/chjump.bin cd $(CHJUMP_PATH); $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/darchD \ -c chjump.bin Template.arc $(CHJUMP_PATH)/chjump.bin: cd $(CHJUMP_PATH); $(subst \,/,$(REVOLUTION_EXT_ROOT))/X86/bin/makeChjp \ -gc 0001 -d DMY_ $(LETTER_PATH)/my_letter.arc: $(LETTER_PATH)/thumbnail_LZ.bin $(LETTER_PATH)/letter_LZ.bin $(CD_ARCPATH) ; $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/darchD -c \ thumbnail_LZ.bin letter_LZ.bin my_letter.arc clean: rm -f $(LETTER_PATH)/my_letter.arc rm -f $(CHJUMP_PATH)/Template.arc # Generate TPL files (delete TCS files) # Suppress unreported messages for "make -s" ifdef SILENT _SILENT_MODE_TEXCONV = | sed -u -e '/^$$/d;/^total /d' endif $(LETTER_PATH)/img/%.tpl: $(LETTER_PATH)/img/%.tcs $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/TexConv $< $@ $(_SILENT_MODE_TEXCONV) # Generate TCS files # Specify GX_CLAMP in order to prevent wrapping in the textures. # (The reason for this is that GX_REPEAT is applied by default with TexConv.exe) $(LETTER_PATH)/img/%.tcs: $(LETTER_PATH)/img/%.tga touch $@ echo path= data/Letter/img/ >> $@ echo file 0 = $(notdir $<) >> $@ echo image 0=0,0,RGB5A3, GX_CLAMP, GX_CLAMP >> $@ echo texture 0=0,x >> $@ # Generate archive (delete TPL files) $(LETTER_PATH)/thumbnail.arc: $(LETTER_PATH)/img/my_LetterS_b.tpl $(CD_ARCPATH) ; $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/darchD -c \ img/my_LetterS_b.tpl thumbnail.arc $(LETTER_PATH)/letter.arc: $(LETTER_FILES_FULLPATH) $(CD_ARCPATH) ; $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/darchD -c \ $(LETTER_FILES_PATH) letter.arc # LZ77 compression $(LETTER_PATH)/thumbnail_LZ.bin: $(LETTER_PATH)/thumbnail.arc $(CD_ARCPATH) ; $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/ntcompress \ -l -A4 -o thumbnail_LZ.bin thumbnail.arc $(LETTER_PATH)/letter_LZ.bin: $(LETTER_PATH)/letter.arc $(CD_ARCPATH) ; $(subst \,/,$(REVOLUTION_SDK_ROOT))/X86/bin/ntcompress \ -l -A4 -o letter_LZ.bin letter.arc #======== End of makefile ========#