#!/usr/bin/env omake #---------------------------------------------------------------------------- # Project: Horizon # File: commondefs.cctype.GCC-i386.om # # Copyright 2007-2009 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. # # $Date:: 2010-11-23#$ # $Rev: 31762 $ # $Author: okubata_ryoma $ #---------------------------------------------------------------------------- Compiler. = class Compiler new() = return $(this) getCCFlagsDebug(config) = eff = switch($(config.effort)) case fast value -Otime case small value -Ospace eff += switch($(config.buildtype)) case $"Debug" value -O0 --retain=calls case $"Development" if $(BUILD_APPLICATION) value $(CCFLAGS_DEV_OPT) else value -O3 case $"Release" value -O3 return $(eff) getLDFlagsDebug(config) = return $(EMPTY) toSymbol(str) = stdout = $(open-out-string) fsubst($(open-in-string $(str))) case $'[-\.]' g value $'_' result = $(out-contents $(stdout)) close($(stdout)) return $(uppercase $(result)) getCCFlags(config) = return $(getCCFlagsDebug $(config)) $(getCCFlagsLtcg $(config)) $(getCCFlagsCPU $(config)) getLDFlags(config) = return $(getLDFlagsDebug $(config)) $(getLDFlagsLtcg $(config)) getASFlags(config) = return $(getASFlagsCPU $(config)) getMacroFlags(config) = export flags flags = switch($(config.effort)) case fast value -DNN_EFFORT_FAST case small value -DNN_EFFORT_SMALL flags += -DNN_PLATFORM_$(toSymbol $(config.platform)) flags += -DNN_HARDWARE_$(toSymbol $(config.hardware)) flags += -DNN_SYSTEM_$(toSymbol $(config.systemname)) # noopt verbose release Debug Dev. Release # DISABLE_DEBUG × × ○ × × ○ # DISABLE_DEBUG_SDK × × ○ × × ○ # DISABLE_ASSERT × × ○ × × ○ # DISABLE_ASSERT_SDK × × ○ × × ○ # ENABLE_HOST ○ ○ × ○ ○ × # # BUILD_NOOPT ○ × × ○ × × # BUILD_VERBOSE ○ ○ × ○ ○ × # BUILD_DEBUG × × × ○ × × # BUILD_DEVELOPMENT × × × × ○ × # BUILD_RELEASE × × × × × ○ # if $(equal $(config.buildtype),Release) DEBUG_PRINT_DEFAULT = false DEBUG_PRINT_SDK_DEFAULT = false ASSERT_WARNING_DEFAULT = false ASSERT_WARNING_SDK_DEFAULT = false export else DEBUG_PRINT_DEFAULT = true DEBUG_PRINT_SDK_DEFAULT = true ASSERT_WARNING_DEFAULT = true ASSERT_WARNING_SDK_DEFAULT = true export if $(not $(DEBUG_PRINT)) flags += -DNN_SWITCH_DISABLE_DEBUG_PRINT=1 if $(not $(DEBUG_PRINT_SDK)) flags += -DNN_SWITCH_DISABLE_DEBUG_PRINT_FOR_SDK=1 if $(not $(ASSERT_WARNING)) flags += -DNN_SWITCH_DISABLE_ASSERT_WARNING=1 if $(not $(ASSERT_WARNING_SDK)) flags += -DNN_SWITCH_DISABLE_ASSERT_WARNING_FOR_SDK=1 if $(config.isHostIoEnable) flags += -DNN_SWITCH_ENABLE_HOST_IO=1 if $(or $(BUILD_APPLICATION), $(BUILD_KERNEL)) flags += -DNN_BUILD_$(toSymbol $(config.buildtype)) if $(and $(defined CTR_BUILD_1ST_STAGE_UPDATER), $(CTR_BUILD_1ST_STAGE_UPDATER)) flags += -DCTR_BUILD_1ST_STAGE_UPDATER flags += switch($(config.buildtype)) case Debug # noopt value -DNN_BUILD_VERBOSE -DNN_BUILD_NOOPT case Development # verbose value -DNN_BUILD_VERBOSE case Release # release value $(EMPTY) return $(flags) include $(ROOT_OMAKE)/commondefs.cctype.RVCT include $(ROOT_OMAKE)/commondefs.cctype.GCC # ここで include しておかないとなぜか .STATIC で Fatal Error include $(ROOT_OMAKE)/tooldefs public.CC = $`(COMPILER.CC) public.CXX = $`(COMPILER.CXX) public.CPP = $`(COMPILER.CPP) public.AR = $`(COMPILER.AR) public.LD = $`(COMPILER.LD) public.AS = $`(COMPILER.AS) public.STRIP = $`(COMPILER.STRIP) public.DISAS = $`(COMPILER.DISAS) public.CCFLAGS_MACRO = $`(COMPILER.CCFLAGS_MACRO) public.CCFLAGS_WARNING = $`(COMPILER.CCFLAGS_WARNING) public.CCFLAGS_DEV_OPT = $`(COMPILER.CCFLAGS_DEV_OPT) public.CCFLAGS = $`(COMPILER.CCFLAGS) $`(CCFLAGS_MACRO) public.CCFLAGS_BUILD = public.CFLAGS = $`(COMPILER.CFLAGS) $`(CCFLAGS) public.CXXFLAGS = $`(COMPILER.CXXFLAGS) $`(CCFLAGS) public.CSCANFLAGS = $`(COMPILER.CSCANFLAGS) public.LDFLAGS_WARNING = $`(COMPILER.LDFLAGS_WARNING) public.LDFLAGS_INFO = $`(COMPILER.LDFLAGS_INFO) public.ARFLAGS = $`(COMPILER.ARFLAGS) public.RANLIB = $`(COMPILER.RANLIB) public.INCLUDES_OPT = $`(COMPILER.INCLUDES_OPT) public.YACC = $`(COMPILER.YACC) public.LEX = $`(COMPILER.LEX) public.LDFLAGS = $`(COMPILER.LDFLAGS) public.LDRESP = $`(COMPILER.LDRESP) public.CCOUT = $`(COMPILER.CCOUT) public.LDOUT = $`(COMPILER.LDOUT) public.ASOUT = $`(COMPILER.ASOUT) public.ASFLAGS = $`(COMPILER.ASFLAGS) public.ENTRYPOINT = __ctr_start public.INCLUDES[] = $(ROOT_INCLUDE) $(HORIZON_ROOT_INCLUDE) public.LIBS = $`(DEFAULT_LIBS) public.LIBFILES = public.MINIMUM_LIBS = public.DEFAULT_LIBS = public.LLIBS = public.USE_GNU_EXTENTIONS = true # # Add the -I option to the includes lazily. # Don't redefine this variable unless you know what you are doing. # public.PREFIXED_INCLUDES = $`(addprefix $(INCLUDES_OPT), $(set $(absname $(INCLUDES))))