############################################################################### # Makefile for rsodemo # # Copyright (C) 2006-2008 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. # ############################################################################### # 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 # build any code modules and module name string table all: setup build install # Add Suffix for RSO Files ifdef NDEBUG SELSUFFIX = .sel RSOSUFFIX = .rso DDFSUFFIX = .ddf else SELSUFFIX = D.sel RSOSUFFIX = D.rso DDFSUFFIX = D.ddf endif HBM_LIB = $(INSTALL_ROOT)/lib/homebuttonLib$(LIBSUFFIX) TPL_LIB = $(INSTALL_ROOT)/lib/tpl$(LIBSUFFIX) # 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 = hbmdemo/rsodemo DEMO = TRUE # small data sections are not supported by relocatable modules CCFLAGS += -sdata 0 -sdata2 0 ifdef MAC else # EPPC # 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_D = rsomodule.c CSRCS_S = CSRCS = $(CSRCS_D) $(CSRCS_S) # CPPSRCS 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 CPPSRCS_D = CPPSRCS_S =rsodemo.cpp CPPSRCS = $(CPPSRCS_D) $(CPPSRCS_S) # BINNAMES specifies the static portion of the program. 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 $(STATIC)$(BINSUFFIX) BINNAMES = rsodemo RSO_DVDROOT = $(REVOLUTION_SDK_ROOT)/dvddata/hbmdemo # RELNAMES lists all relocatable modules 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 modules will be $(RELNAMES)$(RELSUFFIX) # #RELNAMES = $(basename $(CPPSRCS_D)) $(basename $(CSRCS_D)) TARGET_PLFS = $(addprefix $(FULLBIN_ROOT)/,$(addsuffix $(PLFSUFFIX), $(basename $(CSRCS_D)))) TARGET_PLFS += $(addprefix $(FULLBIN_ROOT)/,$(addsuffix $(PLFSUFFIX), $(basename $(CPPSRCS_D)))) #TARGET_RSOS = $(addprefix $(FULLBIN_ROOT)/,$(addsuffix $(RSOSUFFIX), $(RELNAMES))) TARGET_RSOS = $(addprefix $(FULLBIN_ROOT)/,$(addsuffix $(RSOSUFFIX), $(basename $(CSRCS_D)))) TARGET_RSOS += $(addprefix $(FULLBIN_ROOT)/,$(addsuffix $(RSOSUFFIX), $(basename $(CPPSRCS_D)))) # linker command file for building the static module LCF_FILE = $(FULLBIN_ROOT)/rsodemo$(LCFSUFFIX) # linker command file for building relocatable modules (for 1st step) PREREL_LCF_FILE = $(INC_ROOT)/dolphin/eppc.lcf # linker command file for building relocatable modules (for 2nd step) REL_LCF_FILE = $(FULLBIN_ROOT)/partial$(LCFSUFFIX) # linker command file for building static modules STATIC_LCF_FILE = $(INC_ROOT)/revolution/eppc.$(ARCH_TARGET).lcf # filename of the force active symbol name list #LST_FILE = $(FULLBIN_ROOT)/active$(LSTSUFFIX) # filename of the symbol name list SYMBOL_LST_FILE = $(FULLBIN_ROOT)/symbol$(LSTSUFFIX) endif # 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 INCLUDES += -I./include # all build targets that depend on 'setup' target must be listed as # prerequisites for 'dobuild'. dobuild: $(FULLBIN_ROOT)/$(BINNAMES)$(SELSUFFIX) $(FULLBIN_ROOT)/$(BINNAMES)$(DDFSUFFIX) $(FULLBIN_ROOT)/$(BINNAMES)$(DDFSUFFIX): $(TARGET_BINS) mkdir -p $(RSO_DVDROOT) cp $(FULLBIN_ROOT)/rsomodule$(RSOSUFFIX) $(RSO_DVDROOT)/rsomodule$(RSOSUFFIX) cp $(FULLBIN_ROOT)/rsodemo$(SELSUFFIX) $(RSO_DVDROOT)/rsodemo$(SELSUFFIX) #@echo "[Input]" >> $@ #@echo "DvdRoot=\"`cygpath -w '$(RSO_DVDROOT)'`\"" >> $@ # generate the module name string table. $(FULLBIN_ROOT)/$(BINNAMES)$(SELSUFFIX): $(TARGET_BINS) $(SYMBOL_LST_FILE) @echo @echo ">> $(notdir $+) --> $@" cd $(FULLBIN_ROOT); $(ROOT)/X86/bin/makerso.exe $(notdir $(TARGET_BINS)) -e $(notdir $(SYMBOL_LST_FILE)) -a # $(PREPLFSUFFIX) are for the 1st .plf file build without .lcf file # $(PLFSUFFIX) are for the 2nd .plf file build with .lcf file #$(TARGET_PREPLFS) : $(FULLBIN_ROOT)/%$(PREPLFSUFFIX): $(FULLBINOBJ_ROOT)/%.o $(BINOBJ_ROOT)/global_destructor_chain.o $(TARGET_BINS): $(CPPSRCS_S:.cpp=.o) $(CSRCS_S:.c=.o) $(LCF_FILE) $(INSTALL_ROOT)/lib/rso$(LIBSUFFIX) $(TARGET_BINS): $(REVOLUTION_LIBS) $(TPL_LIB) $(TARGET_PLFS) : $(FULLBIN_ROOT)/%$(PLFSUFFIX) : $(FULLBINOBJ_ROOT)/%.o $(BINOBJ_ROOT)/global_destructor_chain.o $(REL_LCF_FILE) $(TARGET_PLFS) : $(HBM_LIB) # generate force active symbol list. #$(LST_FILE): $(TARGET_PREPLFS) # @echo # @echo ">> $(notdir $+) --> $@" # cd $(FULLBIN_ROOT); "$(ROOT)/X86/bin/makerelD.exe" $(+F) # cat $(FULLBIN_ROOT)/import.lst > $(LST_FILE) # generate linker command file for the static module. $(LCF_FILE) $(SYMBOL_LST_FILE) : $(TARGET_RSOS) $(STATIC_LCF_FILE) $(ROOT)/X86/bin/makelcf.exe -o $(LCF_FILE) -s $(SYMBOL_LST_FILE) -t $(STATIC_LCF_FILE) $(TARGET_RSOS) # generate linker command file for relocatable modules. $(REL_LCF_FILE): #$(LST_FILE) @echo @echo ">> $+ --> $@" cat $(PREREL_LCF_FILE) > $@ echo "FORCEFILES { " >> $@ echo " rsomodule.o" >> $@ echo " }" >> $@ echo "FORCEACTIVE { " >> $@ echo " __global_destructor_chain" >> $@ echo "}" >> $@ %$(RSOSUFFIX): %$(PLFSUFFIX) cd $(FULLBIN_ROOT); $(ROOT)/X86/bin/makerso.exe $(notdir $(+)) -a clean: rm -f $(FULLBIN_ROOT)/*.lst rm -f $(FULLBIN_ROOT)/*.lcf $(BINOBJ_ROOT)/global_destructor_chain.o: $(CC) $(CCFLAGS) -pragma "warning off (10423)" $(INCLUDES) \ $(COMPILE) $(MWDIR)/PowerPC_EABI_Support/Runtime/Src/global_destructor_chain.c \ -o $@