#---------------------------------------------------------------------------- # Project: Horizon # File: targetdefs.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: 35731 $ #---------------------------------------------------------------------------- #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # getOutputBaseDirectory # # 概要 # ターゲットに依存しないディレクトリ取得関数 # # 参照しているグローバル変数 # | #------------------------------------------------------- getOutputBaseDirectory() = abs_cwd = $(absname $(CWD)) #println(abs_cwd: $(abs_cwd)) # プロジェクトのルートはHORIZON_ROOT?(SDK のビルド?) if $(equal $(AROOT), $(HORIZON_ROOT)) return $(dir $(HORIZON_ROOT)) # カレントディレクトリは HORIZON_ROOT の中? subdir = $(removeprefix $(HORIZON_ROOT), $(abs_cwd)) if $(not $(equal $(subdir), $(abs_cwd))) #println("UNDER HORIZON: "$(abs_cwd)) return $(dir $(HORIZON_ROOT)) # プロジェクトのルートには sources ディレクトリがある? subdir = $(removeprefix $(AROOT)\\sources\\, $(abs_cwd)) if $(not $(equal $(subdir), $(abs_cwd))) #println("SOURCES EXIST: "$(abs_cwd)) return $(ROOT) #println(subdir: $(subdir)) # カレントディレクトリに出力 return $(dir .) #------------------------------------------------------- # getModuleOutputSubDirectoryOf # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getModuleOutputSubDirectoryOf(module_dir, sub_dir) = if $(defined SOURCES_BASE_ROOT) module_dir = $(SOURCES_BASE_ROOT) export abs_dir = $(absname $(module_dir)) subpath = $(removeprefix $(AROOT)$(DIRSEP), $(abs_dir)) subpath = $(removeprefix sources$(DIRSEP), $(subpath)) # プロジェクトのルートはHORIZON_ROOT?(SDK のビルド?) if $(equal $(AROOT), $(HORIZON_ROOT)) return $(dir $(HORIZON_ROOT)/$(sub_dir)/$(subpath)) # カレントディレクトリは HORIZON_ROOT の中? subdir = $(removeprefix $(HORIZON_ROOT), $(abs_dir)) if $(not $(equal $(subdir), $(abs_dir))) return $(dir $(HORIZON_ROOT)/$(sub_dir)/$(subpath)) # プロジェクトのルートには sources ディレクトリがある? subdir = $(removeprefix $(AROOT)\\sources\\, $(abs_dir)) if $(not $(equal $(subdir), $(abs_dir))) return $(dir $(ROOT)/$(sub_dir)/$(subpath)) # 対象ディレクトリに出力 return $(dir $(module_dir)$(DIRSEP)$(sub_dir)) #------------------------------------------------------- # getModuleImageSubDirectoryOf # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getModuleImageSubDirectoryOf(module_dir) = return $(getModuleOutputSubDirectoryOf $(module_dir), $(SUBDIR_IMAGES)) #------------------------------------------------------- # getModuleObjectsSubDirectoryOf # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getModuleObjectsSubDirectoryOf(module_dir) = return $(getModuleOutputSubDirectoryOf $(module_dir), $(SUBDIR_OBJECTS)) #------------------------------------------------------- # getModuleSubDirectory # # 概要 # ソースのパス名から生成物を格納するサブディレクトリ名を得る # # 参照しているグローバル変数 # | #------------------------------------------------------- getModuleSubDirectory() = if $(defined SOURCES_BASE_ROOT) basedir = $(SOURCES_BASE_ROOT) export else basedir = $(CWD) export #println(basedir: $(basedir)) if $(equal $(ROOT), $(basedir)) return . basedir = $(absname $(basedir)) subpath = $(removeprefix $(AROOT)$(DIRSEP), $(basedir)) subpath = $(removeprefix sources$(DIRSEP), $(subpath)) return $(subpath) #------------------------------------------------------- # getObjectBaseDirectory # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getObjectBaseDirectory() = base_dir = $(getOutputBaseDirectory) if $(equal ., $(base_dir)) module_dir = export else module_dir = $(getModuleSubDirectory)$(DIRSEP) export return $(base_dir)$(DIRSEP)$(SUBDIR_OBJECTS)$(DIRSEP)$(module_dir) #---------------------------------------------------------------------------- # クラス定義 #---------------------------------------------------------------------------- TargetSpec. = class TargetSpec #---------------------------------------------------------------------------- # 変数定義 #---------------------------------------------------------------------------- this.processor = $(EMPTY) this.platform = $(EMPTY) this.hardware = $(EMPTY) this.name = $(EMPTY) #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # new # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- new(name) = this.name = $(name) return $(this) #------------------------------------------------------- # dump # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- dump() = println($"name: "$(name)) println($" platform: "$(platform)) println($" hardware: "$(hardware)) println($" processors: "$(processors)) println($' ') #------------------------------------------------------- # getMacroFlags # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getMacroFlags(systemname, processor) = return $(EMPTY) TargetConfig. = class TargetConfig #---------------------------------------------------------------------------- # 変数定義 #---------------------------------------------------------------------------- this.hardware = $(EMPTY) this.systemname = $(EMPTY) this.processor = $(EMPTY) this.effort = $(EMPTY) this.buildtype = $(EMPTY) this.matched = true #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # new # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- new() = return $(this) #------------------------------------------------------- # dump # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- dump() = println($"hardware: "$(hardware)) println($" processor: "$(processor)) println($' ') #------------------------------------------------------- # getFullname # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getFullname() = return $(hardware).$(systemname).$(processor).$(effort) #------------------------------------------------------- # getFullnameWithSystem # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getFullnameWithSystem(altsystemname) = return $(hardware).$(altsystemname).$(processor).$(effort) #------------------------------------------------------- # getFullnameWithSystemAndEffort # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getFullnameWithSystemAndEffort(altsystemname, alteffort) = return $(hardware).$(altsystemname).$(processor).$(alteffort) #------------------------------------------------------- # getScannerName # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getScannerName() = return $(getFullname)-$(buildtype) #------------------------------------------------------- # getObjectDirectory # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getObjectDirectory() = return $(makeDirectory $(getObjectBaseDirectory)$(DIRSEP)$(getTargetSubDirectory false)) #------------------------------------------------------- # getObjectDirectory # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getObjectDirectory() = return $(getObjectDirectoryFeedback false) #------------------------------------------------------- # getObjectDirectoryFeedback # # 概要 # | # # 参照しているグローバル変数 # | #------------------------------------------------------- getObjectDirectoryFeedback(isFeedback) = return $(makeDirectory $(getModuleObjectsSubDirectoryOf $(CWD))$(DIRSEP)$(getTargetSubDirectory false)) #------------------------------------------------------- # getLibraryDirectory # # 概要 # | # # 参照しているグローバル変数 # INSTALL_ROOT, INSTALL_ROOT_LIBRARIES, # HORIZON_ROOT_LIBRARIES #------------------------------------------------------- getLibraryDirectory(isInstall) = if $(and $(isInstall), $(defined INSTALL_ROOT)) return $(makeDirectory $(INSTALL_ROOT_LIBRARIES)$(DIRSEP)$(getTargetSubDirectory true)) else return $(makeDirectory $(HORIZON_ROOT_LIBRARIES)$(DIRSEP)$(getTargetSubDirectory true)) #------------------------------------------------------- # isTestBuild # # 概要 # | # # 参照しているグローバル変数 # BUILD_TESTS #------------------------------------------------------- isTestBuild() = if $(not $(defined BUILD_TESTS)) return false else return $(BUILD_TESTS) #------------------------------------------------------- # getOutputBaseDirectory # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getOutputBaseDirectory() = return $(getOutputBaseDirectory) #------------------------------------------------------- # getImageDirectory # # 概要 # | # # 参照しているグローバル変数 # INSTALL_ROOT_IMAGES, INSTALL_ROOT #------------------------------------------------------- getImageDirectory(isInstall) = private.module_dir = $(getModuleSubDirectory)$(DIRSEP) private.images_dir = $(EMPTY) if $(and $(isInstall), $(isSdkTool)) images_dir = $(ROOT_TARGETTOOLS) return $(makeDirectory $(images_dir)$(DIRSEP)$(hardware)$(DIRSEP)$(buildtype)) elseif $(and $(isInstall), $(defined INSTALL_ROOT)) images_dir = $(INSTALL_ROOT_IMAGES) export images_dir else export module_dir images_dir private.base_dir = $(getOutputBaseDirectory) if $(equal ., $(base_dir)) module_dir = images_dir = $(base_dir)$(DIRSEP)$(SUBDIR_IMAGES) # テストをビルドする場合はパスの規則が変わる if $(isTestBuild) module_dir = tests$(DIRSEP)$(gsub $(module_dir), $"\$(DIRSEP)tests?(\$(DIRSEP)|$$)", $(DIRSEP)) export module_dir return $(makeDirectory $(images_dir)$(DIRSEP)$(module_dir)$(getTargetSubDirectory false)) #------------------------------------------------------- # getImageDirectoryOf # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getImageDirectoryOf(target_dir) = private.images_dir = $(getModuleImageSubDirectoryOf $(target_dir)) return $(dir $(images_dir)$(DIRSEP)$(getTargetSubDirectory false)) #------------------------------------------------------- # isSdkTool # # 概要 # | # # 参照しているグローバル変数 # INSTALL_SDK_TOOL #------------------------------------------------------- isSdkTool() = if $(and $(defined INSTALL_SDK_TOOL), $(INSTALL_SDK_TOOL), \ $(equal $(systemname), Process), \ $(equal $(processor), MPCore), \ $(equal $(effort), fast)) return true else return false #------------------------------------------------------- # getOptimizeType # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getOptimizeType() = private.opttype = switch($(buildtype)) case Debug value noopt case Development value verbose case Release value release default value etc return $(opttype) #------------------------------------------------------- # getTargetSubDirectory # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getTargetSubDirectory(isLibrary) = private.subdir = $(hardware).$(systemname).$(processor) if $(isLibrary) return $(subdir)$(DIRSEP)$(getOptimizeType) else return $(subdir).$(effort)$(DIRSEP)$(buildtype) #------------------------------------------------------- # getLibraryName # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getLibraryName(name) = return $(name).$(effort)$(EXT_LIB) #------------------------------------------------------- # getStaticObjectName # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getStaticObjectName(name) = return $(basename $(name)).$(effort)$(EXT_OBJ) #------------------------------------------------------- # getLdscriptPath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getLdscriptPath(name) = return $(getBinaryPath $(name), $(EXT_LDS)) #------------------------------------------------------- # getMapfilePath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getMapfilePath(name) = return $(getBinaryPath $(name), $(EXT_MAP)) #------------------------------------------------------- # getLdscriptTemplatePath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getLdscriptTemplatePath() = private.base = $(ROOT_BUILD)$(DIRSEP)linker$(DIRSEP)$(platform).$(systemname).$(processor) if $(and $(equal $(processor), ARM946ES) $(equal $(hardware), CTR-CTTS)) return $(file $(base).Legacy.ldscript.template) else return $(file $(base).ldscript.template) #------------------------------------------------------- # getFeedBackPath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getFeedBackPath() = return $(file $(getImageDirectory false)$(DIRSEP)$(getOutputFilename feedback, .dat)) #------------------------------------------------------- # getBinaryPath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getBinaryPath(name, suffix) = return $(file $(getImageDirectory false)$(DIRSEP)$(getOutputFilename $(name), $(suffix))) #------------------------------------------------------- # getBinaryPathOf # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getBinaryPathOf(target_dir, name, suffix) = private.sub_dir = $(getModuleImageSubDirectoryOf $(target_dir)) private.img_dir = $(dir $(sub_dir)$(DIRSEP)$(getTargetSubDirectory false)) return $(file $(img_dir)$(DIRSEP)$(getOutputFilename $(name), $(suffix))) #------------------------------------------------------- # getDefaultDescriptorPath # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getDefaultDescriptorPath() = return $(file $(ROOT_RESOURCES)$(DIRSEP)specfiles$(DIRSEP)Application.desc) #------------------------------------------------------- # getDefaultRomSpecFile # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getDefaultRomSpecFile() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(file $(ROOT_RESOURCES)$(DIRSEP)specfiles$(DIRSEP)$(spec.getDefaultRomSpecFile $(hardware))) #------------------------------------------------------- # getDefaultBannerFile # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getDefaultBannerFile() = return $(ROOT_RESOURCES)$(DIRSEP)banner$(DIRSEP)Default.bnr #------------------------------------------------------- # getDefaultIconFile # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getDefaultIconFile() = return $(ROOT_RESOURCES)$(DIRSEP)banner$(DIRSEP)Default.icn #------------------------------------------------------- # getOutputFilename # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getOutputFilename(name, suffix) = return $(name)$(suffix) #------------------------------------------------------- # getSuitableKernelFilename # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getSuitableKernelFilename() = return $(HORIZON_ROOT_IMAGES)$(DIRSEP)kernel$(DIRSEP)$(getFullnameWithSystem Kernel)$(DIRSEP)$(buildtype)$(DIRSEP)kernel.axf #------------------------------------------------------- # getSystemCCFlags # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getSystemCCFlags() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(spec.getSystemFlags $(systemname)) #------------------------------------------------------- # getMinimumLibraries # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getMinimumLibraries() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(spec.getMinimumLibraries $(systemname), $(processor)) #------------------------------------------------------- # getDefaultLibraries # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getDefaultLibraries() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(spec.getDefaultLibraries $(systemname), $(processor)) #------------------------------------------------------- # getHostIoLibraries # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getHostIoLibraries() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(spec.getHostIoLibraries $(systemname), $(processor)) #------------------------------------------------------- # getMacroFlags # # 概要 # | # # 参照しているグローバル変数 # TARGET_MANAGER #------------------------------------------------------- getMacroFlags() = private.spec = $(TARGET_MANAGER.getSpecByHardware $(hardware)) return $(spec.getMacroFlags $(systemname), $(processor)) #------------------------------------------------------- # matches # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- matches(varvalue, pattern) = private.regex = compileToRegex($(pattern)) match($(varvalue)) case $(pattern) return true default return false #------------------------------------------------------- # isHostIoEnable # # 概要 # | # # 参照しているグローバル変数 # HOST_IO_DEFAULT, HOST_IO #------------------------------------------------------- isHostIoEnable() = if $(equal $(buildtype),Release) HOST_IO_DEFAULT = false export else HOST_IO_DEFAULT = true export if $,(HOST_IO) return true else return false #------------------------------------------------------- # isFilterMatched # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- isFilterMatched() = return $(matched) HardwareTargetConfig. = extends $(TargetConfig) class HardwareTargetConfig #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # new # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- new() = return $(this) #------------------------------------------------------- # getFullname # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getFullname() = return $(hardware).$(effort) #------------------------------------------------------- # getFullnameDetailed # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getFullnameDetailed(altsystemname, altprocessor) = return $(hardware).$(altsystemname).$(altprocessor).$(effort) #------------------------------------------------------- # getTargetSubDirectory # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getTargetSubDirectory(isLibrary) = if $(isLibrary) return $(hardware)$(DIRSEP)$(getOptimizeType) else return $(hardware).$(effort)$(DIRSEP)$(buildtype) TargetManager. = class TargetManager #---------------------------------------------------------------------------- # 変数定義 #---------------------------------------------------------------------------- this.tmap = $(EMPTY) #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # new # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- new() = this.tmap = $(Map) return $(this) #------------------------------------------------------- # register # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- register(target) = tmap = $(tmap.add $(target.hardware), $(target)) return $(this) #------------------------------------------------------- # dump # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- dump() = tmap.foreach(k, v) v.dump() #------------------------------------------------------- # getProcessors # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getProcessors(hardware) = spec = $(getSpecByHardware $(hardware)) return $(spec.processors) #------------------------------------------------------- # getHardwares # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getHardwares() = return $(tmap.keys) #------------------------------------------------------- # getPlatform # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getPlatform(hardware) = private.spec = $(getSpecByHardware $(hardware)) return $(spec.platform) #------------------------------------------------------- # getSpecByHardware # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getSpecByHardware(hardware) = return $(tmap.find $(hardware)) #------------------------------------------------------- # collectTargetValues # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- collectTargetValues(getter) = private.values = $(tmap.map $(fun k,V,$(apply $(getter), $(V)))) return $(set $(values)) #------------------------------------------------------- # enumerateTargets # # 概要 # | # # 参照しているグローバル変数 # TARGET_FILTER, TARGETS_LIST, TARGET_BUILDTYPES # MATCHED_FAST #------------------------------------------------------- enumerateTargets(filterstrings, ignoreFastSmall, system_list) = private.regex = $(compileToRegex $(filterstrings)) private.regex_global = $(compileToRegex $(TARGET_FILTER)) private.hardwares = $(getHardwares) TARGETS_LIST = $(EMPTY) foreach(buildtype, $(TARGET_BUILDTYPES)) export TARGETS_LIST foreach(hardware, $(hardwares)) foreach(systemname, $(system_list)) foreach(processor, $(getProcessors $(hardware))) MATCHED_FAST = false export MATCHED_FAST foreach(effort, fast small) private.full_name = $"$(hardware).$(systemname).$(processor).$(effort)" if $(and $(isFilterMatch $(regex), $(full_name)), $(isFilterMatch $(regex_global), $(full_name))) private.tgt = $(TargetConfig.new) tgt.platform = $(getPlatform $(hardware)) tgt.hardware = $(hardware) tgt.systemname = $(systemname) tgt.processor = $(processor) tgt.effort = $(effort) tgt.buildtype = $(buildtype) TARGETS_LIST += $(tgt) if $(equal $(effort), fast) MATCHED_FAST = true elseif $(and $(not $(MATCHED_FAST)), $(ignoreFastSmall)) tgt.effort = fast tgt.matched = false TARGETS_LIST += $(tgt) elseif $(and $(MATCHED_FAST), $(ignoreFastSmall)) private.tgt = $(TargetConfig.new) tgt.platform = $(getPlatform $(hardware)) tgt.hardware = $(hardware) tgt.systemname = $(systemname) tgt.processor = $(processor) tgt.effort = small tgt.buildtype = $(buildtype) tgt.matched = false TARGETS_LIST += $(tgt) return $(TARGETS_LIST) #------------------------------------------------------- # enumerateHardwareTargets # # 概要 # | # # 参照しているグローバル変数 # TARGETS_LIST #------------------------------------------------------- enumerateHardwareTargets(filterstrings) = private.regex = $(compileToRegex $(filterstrings)) private.regex_global = $(compileToRegex $(TARGET_FILTER)) private.hardwares = $(getHardwares) TARGETS_LIST = $(EMPTY) foreach(buildtype, $(TARGET_BUILDTYPES)) export TARGETS_LIST foreach(hardware, $(hardwares)) foreach(effort, fast small) private.full_name = $"$(hardware).$(effort)" if $(and $(isFilterMatch $(regex), $(full_name)), $(isFilterMatch $(regex_global), $(full_name))) private.tgt = $(HardwareTargetConfig.new) tgt.platform = $(getPlatform $(hardware)) tgt.hardware = $(hardware) tgt.effort = $(effort) tgt.buildtype = $(buildtype) TARGETS_LIST += $(tgt) return $(TARGETS_LIST) #------------------------------------------------------- # isFilterMatch # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- isFilterMatch(regex, full_name) = match $(full_name) case $(regex) return true default return false Builder. = class Builder #---------------------------------------------------------------------------- # 変数定義 #---------------------------------------------------------------------------- this.manager = $(EMPTY) #---------------------------------------------------------------------------- # 関数定義 #---------------------------------------------------------------------------- #------------------------------------------------------- # new # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- new(manager) = this.manager = $(manager) return $(this) #------------------------------------------------------- # getTargets # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getTargets(targetfilters) = return $(manager.enumerateTargets $(targetfilters), false, Kernel Process) #------------------------------------------------------- # getLibraryTargets # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getLibraryTargets(targetfilters) = return $(manager.enumerateTargets $(targetfilters), true, Kernel Process) #------------------------------------------------------- # getHardwareTargets # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- getHardwareTargets(targetfilters) = return $(manager.enumerateHardwareTargets $(targetfilters)) #------------------------------------------------------- # getToolTargets # # 概要 # | # # 参照しているグローバル変数 # TARGET_FILTER #------------------------------------------------------- getToolTargets(targetfilters) = TARGET_FILTER = WIN-IA32.* SYSTEM_LIST = Tool return $(manager.enumerateTargets *) #------------------------------------------------------- # go # # 概要 # | # # 参照しているグローバル変数 # TARGET #------------------------------------------------------- go(targetfilters, verb) = result = configs = $(getTargets $(targetfilters)) foreach(TARGET, $(configs)) result += $,(verb)) export return $(result) #------------------------------------------------------- # dumpConfigList # # 概要 # | # # 参照しているグローバル変数 # なし #------------------------------------------------------- dumpConfigList(configs) = foreach(config, $(configs)) config.dump() #---------------------------------------------------------------------------- # 変数定義 #---------------------------------------------------------------------------- global.TARGET_MANAGER = $(TargetManager.new) #---------------------------------------------------------------------------- # ターゲット定義読み込み #---------------------------------------------------------------------------- # 最初に無印を読み込む foreach(om,$(ls $(ROOT_OMAKE)/platforms/$(TARGET_PLATFORM.Name)/$(TARGET_PLATFORM.Name).targetdefs.om)) include $(removesuffix $(om)) export # 次にオプションを読み込む foreach(om,$(ls i,$(ROOT_OMAKE)/platforms/$(TARGET_PLATFORM.Name)/$(TARGET_PLATFORM.Name).targetdefs.*.om)) include $(removesuffix $(om)) export global.BUILDER = $(Builder.new $(TARGET_MANAGER))