#---------------------------------------------------------------------------- # Project: Horizon # File: commondefs.om # # Copyright (C)2009-2011 Nintendo Co., Ltd. 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. # # $Rev: 45144 $ #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- # omake settings #---------------------------------------------------------------------------- # Load the OMake default library once only open build/Common SCANNER_MODE=disabled #---------------------------------------------------------------------------- # Root specification #---------------------------------------------------------------------------- # Defined constants # # CTRSDK_ROOT # HORIZON_ROOT # CTRSDK_TARGETS # HORIZON_TARGETS # HORIZON_ADDINS_ROOT # # Get directory root/environmental variable (can build even if not defined) HORIZON_ROOT = if $(defined-env HORIZON_ROOT) value $(absname $(string $(getenv HORIZON_ROOT))) if $(defined-env CTRSDK_ROOT) CTRSDK_ROOT = $(absname $(string $(getenv CTRSDK_ROOT))) if $(and $(defined-env HORIZON_ROOT), $(not $(equal $(HORIZON_ROOT), $(CTRSDK_ROOT)))) eprintln(HORIZON_ROOT と CTRSDK_ROOT が一致しません。同じパスを設定するか、どちらか一方だけを定義して下さい。) exit(1) HORIZON_ROOT = $(CTRSDK_ROOT) export HORIZON_ROOT CTRSDK_ROOT if $(defined-env CTRSDK_TARGETS) private.targets = $(absname $(string $(getenv CTRSDK_TARGETS))) if $(defined-env HORIZON_TARGETS) eprintln(HORIZON_TARGETS と CTRSDK_TARGETS は同時に使用できませんので、どちらか一方だけを定義して下さい。) exit(1) global.HORIZON_TARGETS = $(targets) export HORIZON_TARGETS if $(not $(HORIZON_ROOT)) eprintln($"$$CTRSDK_ROOT is not defined") HORIZON_ROOT = $(absname $(ROOT)) export HORIZON_ROOT global.HORIZON_ADDINS_ROOT = if $(defined-env HORIZON_ADDINS_ROOT) value $(absname $(string $(getenv HORIZON_ADDINS_ROOT))) else private.path = $(absname $(HORIZON_ROOT)/../CTR/Addins) value $(if $(file-exists $(path)),$(path),$(EMPTY)) #---------------------------------------------------------------------------- # Global constant definition #---------------------------------------------------------------------------- # Define directory global.SUBDIR_IMAGES = images global.SUBDIR_OBJECTS = objects global.SUBDIR_LIBRARIES = libraries global.SUBDIR_INCLUDE = include global.SCANNER_PREFIX = scan global.AROOT = $(absname $(ROOT)) global.ROOT_IMAGES = $(absname $(ROOT)$(DIRSEP)$(SUBDIR_IMAGES)) global.ROOT_OBJECTS = $(absname $(ROOT)$(DIRSEP)$(SUBDIR_OBJECTS)) global.ROOT_LIBRARIES = $(absname $(HORIZON_ROOT)$(DIRSEP)$(SUBDIR_LIBRARIES)) global.ROOT_BUILD = $(absname $(HORIZON_ROOT)$(DIRSEP)build) global.ROOT_OMAKE = $(absname $(ROOT_BUILD)$(DIRSEP)omake) global.ROOT_OMAKE_PUBLIC = $(absname $(ROOT_BUILD)$(DIRSEP)omake) global.ROOT_INCLUDE = $(absname $(ROOT)$(DIRSEP)$(SUBDIR_INCLUDE)) global.ROOT_SOURCES = $(absname $(ROOT)$(DIRSEP)sources) global.ROOT_TOOLS = $(absname $(HORIZON_ROOT)$(DIRSEP)tools) global.ROOT_TARGETTOOLS = $(absname $(HORIZON_ROOT)$(DIRSEP)tools$(DIRSEP)TargetTools) global.ROOT_COMMANDS = $(absname $(ROOT_TOOLS)$(DIRSEP)CommandLineTools) global.ROOT_RESOURCES = $(absname $(HORIZON_ROOT)$(DIRSEP)resources) global.HORIZON_ROOT_INCLUDE = $(HORIZON_ROOT)$(DIRSEP)$(SUBDIR_INCLUDE) global.HORIZON_ROOT_IMAGES = $(HORIZON_ROOT)$(DIRSEP)$(SUBDIR_IMAGES) global.HORIZON_ROOT_LIBRARIES = $(HORIZON_ROOT)$(DIRSEP)$(SUBDIR_LIBRARIES) # Extension settings global.EXT_OBJ = .o global.EXT_LIB = .a global.EXT_ASM = .s global.EXT_C = .c global.EXT_EXE = $(EXE) global.EXT_ELF = .axf global.EXT_PLF = .plf global.EXT_MAP = .map global.EXT_DASM = .dasm global.EXT_LDS = .autogen.ldscript # Tool path setting global.BIN2OBJ = $(file $(ROOT_COMMANDS)/ctr_bin2obj32$(EXE)) global.BIN2OBJ_FLAGS = global.RUNNER = $(file $(ROOT_BUILD)/runner/run.sh) global.RUNNER_LOCK = $(file $(ROOT_BUILD)/runner/.lock) # Defined constants # # INSTALL_ROOT # INSTALL_IMAGES_DIR # INSTALL_ROOT_IMAGES # INSTALL_ROOT_LIBRARIES # declare global.INSTALL_ROOT # Installation destination settings (prioritized as follows) # 1. Environmental variable HORIZON_INSTALL_ROOT # 2. Variable INSTALL_ROOT # 3. Variable HORIZON_ROOT if $(defined-env HORIZON_INSTALL_ROOT) INSTALL_ROOT = $(dir $(string $(getenv HORIZON_INSTALL_ROOT))) export INSTALL_ROOT else if $(defined INSTALL_ROOT) INSTALL_ROOT = $(dir $(INSTALL_ROOT)) export elseif $(equal $(AROOT), $(HORIZON_ROOT)) INSTALL_ROOT = $(ROOT) export export if $(not $(defined INSTALL_IMAGES_DIR)) INSTALL_IMAGES_DIR = $(SUBDIR_IMAGES) export if $(defined INSTALL_ROOT) INSTALL_ROOT_IMAGES = $(dir $(INSTALL_ROOT)$(DIRSEP)$(INSTALL_IMAGES_DIR)) INSTALL_ROOT_LIBRARIES = $(dir $(INSTALL_ROOT)$(DIRSEP)$(SUBDIR_LIBRARIES)) export #---------------------------------------------------------------------------- # Global variable declaration and initialization #---------------------------------------------------------------------------- global.HORIZON_ADDITIONAL_RULES = $(EMPTY) global.HORIZON_POST_ADDITIONAL_RULES = $(EMPTY) global.SOURCES = global.OBJECTS = # Variable to have the user specify a directory matching the build target and build type global.BUILD_TARGET_DIR = $`(TARGET.getFullnameWithSystem Process) global.BUILD_TYPE_DIR = $`(TARGET.buildtype) global.DEFAULT_TARGETS = $(EMPTY) global.DEFAULT_FILTER = CTR-TS*MPCore* global.ENABLE_CPP_EXCEPTION = false # Defined variables # # SKIP_BUILD # DEBUG_PRINT # DEBUG_PRINT_SDK # ASSERT_WARNING # ASSERT_WARNING_SDK # HOST_IO # TRACE_PRODUCTCODE # if $(not $(defined SKIP_BUILD)) global.SKIP_BUILD = false export if $(not $(defined DEBUG_PRINT)) global.DEBUG_PRINT = $`(DEBUG_PRINT_DEFAULT) export if $(not $(defined DEBUG_PRINT_SDK)) global.DEBUG_PRINT_SDK = $`(DEBUG_PRINT_SDK_DEFAULT) export if $(not $(defined ASSERT_WARNING)) global.ASSERT_WARNING = $`(ASSERT_WARNING_DEFAULT) export if $(not $(defined ASSERT_WARNING_SDK)) global.ASSERT_WARNING_SDK = $`(ASSERT_WARNING_SDK_DEFAULT) export if $(not $(defined HOST_IO)) global.HOST_IO = $`(HOST_IO_DEFAULT) export global.TARGET_FILTER = if $(defined FILTER) value $(FILTER) elseif $(defined targets) eprintln($"Warning: Use 'FILTER' instead of 'targets.'") value $(targets) else if $(defined-env HORIZON_TARGETS) value $(getenv HORIZON_TARGETS) elseif $(defined-env CTRSDK_TARGETS) value $(getenv CTRSDK_TARGETS) else value $`(DEFAULT_FILTER) if $(grep q, $",", $(open-in-string $(TARGET_FILTER))) TARGET_FILTER = $(split $",", $(TARGET_FILTER)) export BUILDTYPES = if $(defined BUILD) value $(BUILD) else value Development section RS=$'[ \t,]+' TARGET_BUILDTYPES = export TARGET_BUILDTYPES awk($(open-in-string $(lowercase $(BUILDTYPES)))) case $'(debug)|(dbg)' TARGET_BUILDTYPES += Debug case $'dev(elop)?' TARGET_BUILDTYPES += Development case $'rel(ease)?' TARGET_BUILDTYPES += Release case $'full' TARGET_BUILDTYPES += Debug Development Release TARGET_BUILDTYPES = $(set $(TARGET_BUILDTYPES)) .PHONY: CGeneratedFilesTarget .PHONY: build .PHONY: build-romfs .PHONY: show-config .PHONY: build-setup .PHONY: tests .PHONY: all build clean clean-autogen clobber install #---------------------------------------------------------------------------- # Platform branching #---------------------------------------------------------------------------- include $(ROOT_OMAKE)/platformdefs global.TARGET_PLATFORM = $(NN_PLATFORM_MANAGER.Select $(TARGET_FILTER)) #---------------------------------------------------------------------------- # Load sub-rules #---------------------------------------------------------------------------- # Library for Horizon include $(ROOT_OMAKE)/utildefs include $(ROOT_OMAKE)/commondefs.funcs include $(ROOT_OMAKE)/commondefs.cctype include $(makePlatformDefsPath commondefs) include $(ROOT_OMAKE)/targetdefs include $(ROOT_OMAKE)/packagedefs include $(ROOT_OMAKE)/debuggerdefs # Incorporate individual settings if $(test -f $(ROOT_OMAKE)/localdefs.om) include $(ROOT_OMAKE)/localdefs export #---------------------------------------------------------------------------- # Common rule definitions #---------------------------------------------------------------------------- %.c: %.y $(YACC) $< %.c: %.l $(LEX) $< show-config: $(ShowConfig)