#============================================================================ # Global module make rules for RevolutionNET build system # # 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: modulerules.rex,v $ # Revision 1.42 2007/06/15 05:45:52 hirose_kazuki # Added build support for NWC24 scripts # # Revision 1.41 2007/05/23 02:30:01 adachi_hiroaki # Revised the makeo path # # Revision 1.40 2007/05/14 11:38:58 hatamoto_minoru # Made "rex-install" dependent on "build" to support "make -j". # # Revision 1.39 2006/12/07 08:50:40 yasu # Dealt with issue wherein a build error would occur if the entries contained in MODULENAME and BINNAMES matched. # # Revision 1.38 2006/10/04 09:16:08 yasu # Error output handling in rm # # Revision 1.37 2006/10/04 08:33:25 yasu # Corrected the error with the ddf generation process when apploader does not exist # # Revision 1.36 2006/10/04 08:08:26 yasu # Revised the REX_TOOL build rules. # # Revision 1.35 2006/09/28 10:02:04 yasu # Revised so that apploader will be generated as well. # # Revision 1.34 2006/09/19 12:39:25 terui # Made changes so that -DREVOEX_PACKAGE switch will be added at REX_PACKAGE_BUILD. # # Revision 1.33 2006/09/19 06:29:56 yasu # Set noFW version # # Revision 1.32 2006/09/15 02:32:26 yasu # - Revised the DIP_INET6* flag process # # Revision 1.31 2006/09/15 02:22:09 yasu # - Added DIP_INET6* flag. # # Revision 1.30 2006/09/14 09:23:31 yasu # Added support for IP4 switch flag. # # Revision 1.29 2006/08/28 11:37:24 yasu # Made it so that an environment variable can be specified for REX_DVDROOT. # This allows pathname specifications such as ${REVOLUTION_SDK_ROOT}/dvddata. # # Revision 1.28 2006/08/28 11:23:03 yasu # Revised REX_DVDROOT setting. # # Revision 1.27 2006/08/25 14:49:53 yasu # Made additions related to REX_TOOL. # # Revision 1.26 2006/08/24 04:29:43 adachi_hiroaki # Added settings for building tools using NW4R. # # Revision 1.25 2006/08/22 10:00:12 yasu # Added display for checking error generating directories. # # Revision 1.24 2006/08/15 04:37:08 yasu # Hide the sed command that edits depend # # Revision 1.23 2006/08/11 10:39:05 yasu # Made it possible to compile files in different directories # # Revision 1.22 2006/08/11 08:41:26 yasu # Adjusted warning level # # Revision 1.21 2006/08/09 13:31:06 yasu # Support for REX_DVDROOT # # Revision 1.20 2006/08/08 02:48:34 seiki_masashi # Support for binary data linking # # Revision 1.19 2006/07/31 07:53:36 yasu # ddf file not installed if TITLEID is 0 # # Revision 1.18 2006/07/31 06:12:00 yasu # Moved overwrite of do-setup command to commondefs. # # Revision 1.17 2006/07/31 04:24:56 yasu # Added ddf for switching firmware. # # Revision 1.16 2006/07/26 00:13:44 yasu # Handled the fact that an ls-related warning is output if there is no # lib/ARCH directory when executing make install defined by RVL_SDK. # # Revision 1.15 2006/07/24 05:18:27 terui # Corrected a problem where "@" was applied to the wrong place within the operating details of do-setup. # # Revision 1.14 2006/07/24 05:14:27 terui # Changed operating details of do-setup. # # Revision 1.13 2006/07/22 14:50:10 yasu # Stop echo back during setup. # # Revision 1.12 2006/07/22 13:09:42 yasu # Revised the method of creating a directory during setup. # This allows the use of make -B # # Revision 1.11 2006/07/21 06:32:46 yasu # Embed installer creation feature # # Revision 1.10 2006/07/20 06:20:47 yasu # Adjusted clean/clobber processing. # # Revision 1.9 2006/07/18 12:50:38 yasu # Set delete files when executing make clean. # # Revision 1.8 2006/07/18 11:45:54 yasu # Added MYCCFLAGS. # # Revision 1.7 2006/07/10 04:08:02 yasu # Added distclean. # # Revision 1.6 2006/07/09 13:10:10 yasu # PPC-side make tree connection complete # # Revision 1.5 2006/07/09 11:26:02 yasu # moving process intermediate save 2 # # Revision 1.4 2006/07/09 08:16:10 yasu # moving process intermediate save 1 # # Revision 1.3 2006/06/22 02:35:31 terui # Changed the make directory command from $(MKDIR) to mkdir -p # # Revision 1.2 2006/06/17 07:19:53 seiki_masashi # Changed so that C code in $(SRCDIR) can be built # # Revision 1.1 2006/05/30 07:09:57 terui # Initial upload. # # # $NoKeywords: $ # #============================================================================ ifeq (TRUE,$(LIB)) $(FULLBIN_ROOT)/$(MODULENAME)$(BINSUFFIX): $(CSRCS:.c=.o) $(addsuffix .o,$(DATS)) $(REVOLUTION_LIBS) $(REX_LIBS) endif OBJECTS += $(addprefix $(FULLBINOBJ_ROOT)/,$(addsuffix .o,$(DATS))) CCFLAGS_WARNING ?= $(WARNLV_SDKINC) CCFLAGS += $(CCFLAGS_WARNING) $(MYCCFLAGS) ifeq (TRUE,$(REX_IP_INET4_ONLY)) CCFLAGS += -DIP_INET4_ONLY else CCFLAGS += -DIP_INET6 endif ifeq (TRUE,$(REX_IP_INET6_IGNORED)) CCFLAGS += -DIP_INET6_IGNORED endif ifeq (TRUE,$(REX_PACKAGE_BUILD)) CCFLAGS += -DREVOEX_PACKAGE endif # # make *.o # define MAKEDIRS @if [ ! -d $(@D) ] ; then \ mkdir -p $(@D) ; \ fi @if [ ! -d $(dir $(FULLDEP_ROOT)/$*) ] ; then \ mkdir -p $(dir $(FULLDEP_ROOT)/$*) ; \ fi @echo "" endef define C_COMPILE @echo ">> $< --> $(BINOBJ_ROOT)/$(subst $(FULLBINOBJ_ROOT)/,,$@)" $(CC) $(CCFLAGS) $(INCLUDES) $(COMPILE) $< \ -o $(subst $(FULLBINOBJ_ROOT)/,$(BINOBJ_ROOT)/,$@) -gccdep -MD @sed -f "$(REVOLUTION_EXT_ROOT)/build/buildtools/eppccleandepend.sed" $(@:.o=.d) > $(DEP_ROOT)/$*.d && \ rm -f $(@:.o=.d) endef define DAT_COMPILE @echo ">> $< --> $(BINOBJ_ROOT)/$(subst $(FULLBINOBJ_ROOT)/,,$@)" $(ROOT)/X86/bin/$(MAKEO) $(MAKEO_FLAGS) -b $(subst .,_,$(notdir $<))_begin -e $(subst .,_,$(notdir $<))_end -o $@ $< endef # SRCDIR ?= src $(FULLBINOBJ_ROOT)/%.o: $(SRCDIR)/%.c $(MAKEDIRS) $(C_COMPILE) $(FULLBINOBJ_ROOT)/%.o: $(REX_LOCAL_DATDIR)/% $(MAKEDIRS) $(DAT_COMPILE) $(FULLBINOBJ_ROOT)/%.bkws: $(SRCDIR)/%.kws $(NWC24CC) $(<) -o $(@) # # directories # ifeq ($(REX_TOOL), TRUE) PROJ_ROOT = $(REX_DIR)/build/tools REX_INSTALL_SUBDIR = bin/tools endif ifeq ($(REX_DEMO), TRUE) PROJ_ROOT = $(REX_DIR)/build/demos REX_INSTALL_SUBDIR = bin/demos/$(MODULENAME) endif # # make setup # do-setup: @$(ECHO_CURDIR) @$(MKDIRP) $(REX_INSTALL_DIR)/$(ARCH_TARGET)/include \ $(REX_INSTALL_DIR)/$(ARCH_TARGET)/lib \ $(REX_INSTALL_DIR)/$(ARCH_TARGET)/bin \ $(MODULE_ROOT)/obj/$(ARCH_TARGET)/DEBUG \ $(MODULE_ROOT)/obj/$(ARCH_TARGET)/NDEBUG \ $(MODULE_ROOT)/depend/$(ARCH_TARGET)/DEBUG \ $(MODULE_ROOT)/depend/$(ARCH_TARGET)/NDEBUG \ $(MODULE_ROOT)/lib lib/$(ARCH_TARGET) \ $(if $(DEMO)$(TEST)$(REX_TOOL),$(MODULE_ROOT)/bin bin/$(ARCH_TARGET)) # # make dobuild (for DDF) # TARGET_DDFS = $(TARGET_BINS:.elf=.ddf) TARGET_APPLOADER_DDF = $(REX_BOOTDIR)/apploader.$(REX_TITLEID).ddf ifneq ($(REX_TITLEID)$(REX_DVDROOT),0) dobuild: $(TARGET_DDFS) endif $(FULLBIN_ROOT)/%.ddf: $(MAKEFILE) @$(INSTALL) -p -D $(REX_DDFTMPLTDIR)/NdevRun_$(REX_TITLEFW)_$(REX_TITLEID).ddf $@ @if [ -e $(TARGET_APPLOADER_DDF) ]; then \ cat $(TARGET_APPLOADER_DDF) >> $@; \ fi ifneq ($(REX_DVDROOT),) @echo "DvdRoot=\"`cygpath -w '$(REX_DVDROOT)'`\"" >> $@ endif # # make install # install: override INSTALL_ROOT = $(REX_INSTALL_DIR)/$(ARCH_TARGET)/$(REX_INSTALL_SUBDIR) install: rex-install rex-install: build ifdef REX_TOOL @$(MKDIRP) $(INSTALL_ROOT); \ rm -fr bin/$(ARCH_TARGET)/*.map; \ cp -uRp bin/$(ARCH_TARGET)/* $(INSTALL_ROOT) endif # # make clean # clean: my-clean my-clean:; rm -fr *.map ./bin ./depend ./lib ./obj clean: override CSRCS= # # make distclean/clobber # distclean clobber: override INSTALL_ROOT = $(REX_INSTALL_DIR)/$(ARCH_TARGET) ifdef LIB ifdef LIBNAME REX_DISTCLEAN += $(INSTALL_ROOT)/lib/$(LIBNAME).a $(INSTALL_ROOT)/lib/$(LIBNAME)D.a endif endif ifdef TEST REX_DISTCLEAN += $(INSTALL_ROOT)/bin/tests/$(MODULENAME) endif ifdef REX_TOOL REX_DISTCLEAN += $(addprefix $(INSTALL_ROOT)/$(REX_INSTALL_SUBDIR)/,$(addsuffix *.*,$(BINNAMES))) endif clobber: distclean distclean: clean rm -rf $(REX_DISTCLEAN) #======== End of modulerules.rex ========#