| [819] | 1 | # $Id: gnumake-footer.kmk 819 2007-02-01 02:28:30Z bird $ | 
|---|
|  | 2 | ## @file | 
|---|
|  | 3 | # | 
|---|
|  | 4 | # kBuild - Additional footer for use when bootstrapping kBuild using Vanilla GNU Make. | 
|---|
|  | 5 | # | 
|---|
|  | 6 | # Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net> | 
|---|
|  | 7 | # | 
|---|
|  | 8 | # | 
|---|
|  | 9 | # This file is part of kBuild. | 
|---|
|  | 10 | # | 
|---|
|  | 11 | # kBuild is free software; you can redistribute it and/or modify | 
|---|
|  | 12 | # it under the terms of the GNU General Public License as published by | 
|---|
|  | 13 | # the Free Software Foundation; either version 2 of the License, or | 
|---|
|  | 14 | # (at your option) any later version. | 
|---|
|  | 15 | # | 
|---|
|  | 16 | # kBuild is distributed in the hope that it will be useful, | 
|---|
|  | 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
|  | 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
|  | 19 | # GNU General Public License for more details. | 
|---|
|  | 20 | # | 
|---|
|  | 21 | # You should have received a copy of the GNU General Public License | 
|---|
|  | 22 | # along with kBuild; if not, write to the Free Software | 
|---|
|  | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
|---|
|  | 24 | # | 
|---|
|  | 25 | # | 
|---|
|  | 26 |  | 
|---|
|  | 27 | ## Converts an relative path to an absolute path using the given CWD. | 
|---|
|  | 28 | # @returns absolute path. | 
|---|
|  | 29 | # @param    $1      The path to fixup. | 
|---|
|  | 30 | # @param    $2      The CWD to use. | 
|---|
|  | 31 | abspathex = $(foreach _fix_path,$1\ | 
|---|
|  | 32 | ,$(if $(subst :$(call no-root-slash,$(call no-drive,$(_fix_path))):,,:$(_fix_path):),$(_fix_path),$(abspath $2/$(_fix_path)))) | 
|---|
|  | 33 |  | 
|---|
|  | 34 | ## Figure out the tool for a source | 
|---|
|  | 35 | # @param    target       source file | 
|---|
|  | 36 | # @param    source       normalized main target | 
|---|
|  | 37 | # @param    type         tooltype | 
|---|
|  | 38 | # @param    bld_trg      build target. | 
|---|
|  | 39 | # @param    bld_trg_arch build target architecture. | 
|---|
|  | 40 | # @remark       Obsoleted by kBuild helpers in kmk. Only required for gmake compatbility. | 
|---|
|  | 41 | _SOURCE_TOOL = $(strip $(firstword \ | 
|---|
|  | 42 | $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 43 | $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 44 | $($(target)_$(source)_$(type)TOOL) \ | 
|---|
|  | 45 | $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 46 | $($(target)_$(source)_TOOL.$(bld_trg)) \ | 
|---|
|  | 47 | $($(target)_$(source)_TOOL) \ | 
|---|
|  | 48 | $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 49 | $($(source)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 50 | $($(source)_$(type)TOOL) \ | 
|---|
|  | 51 | $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 52 | $($(source)_TOOL.$(bld_trg)) \ | 
|---|
|  | 53 | $($(source)_TOOL) \ | 
|---|
|  | 54 | $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 55 | $($(target)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 56 | $($(target)_$(type)TOOL) \ | 
|---|
|  | 57 | $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 58 | $($(target)_TOOL.$(bld_trg)) \ | 
|---|
|  | 59 | $($(target)_TOOL) \ | 
|---|
|  | 60 | $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 61 | $($(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 62 | $($(type)TOOL) \ | 
|---|
|  | 63 | $(TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 64 | $(TOOL.$(bld_trg)) \ | 
|---|
|  | 65 | $(TOOL) )) | 
|---|
|  | 66 |  | 
|---|
|  | 67 | ## Figure out where to put object files. | 
|---|
|  | 68 | # @param    $1      source file | 
|---|
|  | 69 | # @param    $2      normalized main target | 
|---|
|  | 70 | # @remark There are two major hacks here: | 
|---|
|  | 71 | #           1. Source files in the output directory are translated into a gen/ subdir. | 
|---|
|  | 72 | #               2. Catch anyone specifying $(PATH_SUB_CURRENT)/sourcefile.c. | 
|---|
|  | 73 | # @remark       obsoleted by kBuild helpers in kmk. Only required for gmake compatbility. | 
|---|
|  | 74 | _OBJECT_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename \ | 
|---|
|  | 75 | $(patsubst $(PATH_ROOT)/%,%,$(patsubst $(PATH_SUB_CURRENT)/%,%,$(patsubst $(PATH_TARGET)/$(2)/%,gen/%,$(1))))))) | 
|---|
|  | 76 |  | 
|---|
|  | 77 |  | 
|---|
|  | 78 | ## Generic macro for processing C, C++ and Assembly sources. | 
|---|
|  | 79 | # @param    $(target)     Normalized target name. | 
|---|
|  | 80 | # @param    $(source)     Source file name. | 
|---|
|  | 81 | # @param    $(type)       Source type. {C,CXX,AS} | 
|---|
|  | 82 | # @param    bld_type      Build type. | 
|---|
|  | 83 | # @param    bld_trg       Build target. | 
|---|
|  | 84 | # @param    bld_trg_arch  Build target arch. | 
|---|
|  | 85 | # @param    bld_trg_cpu   Build target cpu. | 
|---|
|  | 86 | # @remark       obsoleted by kBuild helpers in kmk. Only required for limited gmake compatbility. | 
|---|
|  | 87 | # | 
|---|
|  | 88 | define def_target_source_c_cpp_asm_rc_old | 
|---|
|  | 89 | #$ (warning dbg: def_target_source_c_cpp_asm_rc_old: source='$(source)' target='$(target)' type='$(type)') | 
|---|
|  | 90 |  | 
|---|
|  | 91 | tool := $(call _SOURCE_TOOL,$(source),$(target),$(type)) | 
|---|
|  | 92 | outbase     := $(call _OBJECT_BASE,$(source),$(target)) | 
|---|
|  | 93 | PATH_$(target)_$(source) := $(patsubst %/,%,$(dir $(outbase))) | 
|---|
|  | 94 | dirdep      := $(call DIRDEP,$(dir $(outbase))) | 
|---|
|  | 95 | defs        :=\ | 
|---|
|  | 96 | $(TOOL_$(tool)_DEFS)\ | 
|---|
|  | 97 | $(TOOL_$(tool)_DEFS.$(bld_type))\ | 
|---|
|  | 98 | $(TOOL_$(tool)_DEFS.$(bld_trg))\ | 
|---|
|  | 99 | $(TOOL_$(tool)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 100 | $(TOOL_$(tool)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 101 | $(TOOL_$(tool)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 102 | $(TOOL_$(tool)_$(type)DEFS)\ | 
|---|
|  | 103 | $(TOOL_$(tool)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 104 | $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 105 | $(SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 106 | $(SDKS.$(bld_trg)) \ | 
|---|
|  | 107 | $(SDKS.$(bld_type)) \ | 
|---|
|  | 108 | $(SDKS),\ | 
|---|
|  | 109 | $(SDK_$(sdk)_DEFS)\ | 
|---|
|  | 110 | $(SDK_$(sdk)_DEFS.$(bld_type))\ | 
|---|
|  | 111 | $(SDK_$(sdk)_DEFS.$(bld_trg))\ | 
|---|
|  | 112 | $(SDK_$(sdk)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 113 | $(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 114 | $(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 115 | $(SDK_$(sdk)_$(type)DEFS)\ | 
|---|
|  | 116 | $(SDK_$(sdk)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 117 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 118 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 119 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 120 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\ | 
|---|
|  | 121 | $(DEFS)\ | 
|---|
|  | 122 | $(DEFS.$(bld_type))\ | 
|---|
|  | 123 | $(DEFS.$(bld_trg))\ | 
|---|
|  | 124 | $(DEFS.$(bld_trg_arch))\ | 
|---|
|  | 125 | $(DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 126 | $(DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 127 | $($(type)DEFS)\ | 
|---|
|  | 128 | $($(type)DEFS.$(bld_type))\ | 
|---|
|  | 129 | $($(type)DEFS.$(bld_trg))\ | 
|---|
|  | 130 | $($(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 131 | $($(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 132 | $($(type)DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 133 | $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 134 | $($(target)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 135 | $($(target)_SDKS.$(bld_trg)) \ | 
|---|
|  | 136 | $($(target)_SDKS.$(bld_type)) \ | 
|---|
|  | 137 | $($(target)_SDKS),\ | 
|---|
|  | 138 | $(SDK_$(sdk)_DEFS)\ | 
|---|
|  | 139 | $(SDK_$(sdk)_DEFS.$(bld_type))\ | 
|---|
|  | 140 | $(SDK_$(sdk)_DEFS.$(bld_trg))\ | 
|---|
|  | 141 | $(SDK_$(sdk)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 142 | $(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 143 | $(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 144 | $(SDK_$(sdk)_$(type)DEFS)\ | 
|---|
|  | 145 | $(SDK_$(sdk)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 146 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 147 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 148 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 149 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\ | 
|---|
|  | 150 | $($(target)_DEFS)\ | 
|---|
|  | 151 | $($(target)_DEFS.$(bld_type))\ | 
|---|
|  | 152 | $($(target)_DEFS.$(bld_trg))\ | 
|---|
|  | 153 | $($(target)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 154 | $($(target)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 155 | $($(target)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 156 | $($(target)_$(type)DEFS)\ | 
|---|
|  | 157 | $($(target)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 158 | $($(target)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 159 | $($(target)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 160 | $($(target)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 161 | $($(target)_$(type)DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 162 | $(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 163 | $($(source)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 164 | $($(source)_SDKS.$(bld_trg)) \ | 
|---|
|  | 165 | $($(source)_SDKS.$(bld_type)) \ | 
|---|
|  | 166 | $($(source)_SDKS),\ | 
|---|
|  | 167 | $(SDK_$(sdk)_DEFS)\ | 
|---|
|  | 168 | $(SDK_$(sdk)_DEFS.$(bld_type))\ | 
|---|
|  | 169 | $(SDK_$(sdk)_DEFS.$(bld_trg))\ | 
|---|
|  | 170 | $(SDK_$(sdk)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 171 | $(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 172 | $(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 173 | $(SDK_$(sdk)_$(type)DEFS)\ | 
|---|
|  | 174 | $(SDK_$(sdk)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 175 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 176 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 177 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 178 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\ | 
|---|
|  | 179 | $($(source)_DEFS)\ | 
|---|
|  | 180 | $($(source)_DEFS.$(bld_type))\ | 
|---|
|  | 181 | $($(source)_DEFS.$(bld_trg))\ | 
|---|
|  | 182 | $($(source)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 183 | $($(source)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 184 | $($(source)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 185 | $($(source)_$(type)DEFS)\ | 
|---|
|  | 186 | $($(source)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 187 | $($(source)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 188 | $($(source)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 189 | $($(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 190 | $($(source)_$(type)DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 191 | $(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 192 | $($(target)_$(source)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 193 | $($(target)_$(source)_SDKS.$(bld_trg)) \ | 
|---|
|  | 194 | $($(target)_$(source)_SDKS.$(bld_type)) \ | 
|---|
|  | 195 | $($(target)_$(source)_SDKS),\ | 
|---|
|  | 196 | $(SDK_$(sdk)_DEFS)\ | 
|---|
|  | 197 | $(SDK_$(sdk)_DEFS.$(bld_type))\ | 
|---|
|  | 198 | $(SDK_$(sdk)_DEFS.$(bld_trg))\ | 
|---|
|  | 199 | $(SDK_$(sdk)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 200 | $(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 201 | $(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 202 | $(SDK_$(sdk)_$(type)DEFS)\ | 
|---|
|  | 203 | $(SDK_$(sdk)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 204 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 205 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 206 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 207 | $(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\ | 
|---|
|  | 208 | $($(target)_$(source)_DEFS)\ | 
|---|
|  | 209 | $($(target)_$(source)_DEFS.$(bld_type))\ | 
|---|
|  | 210 | $($(target)_$(source)_DEFS.$(bld_trg))\ | 
|---|
|  | 211 | $($(target)_$(source)_DEFS.$(bld_trg_arch))\ | 
|---|
|  | 212 | $($(target)_$(source)_DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 213 | $($(target)_$(source)_DEFS.$(bld_trg_cpu))\ | 
|---|
|  | 214 | $($(target)_$(source)_$(type)DEFS)\ | 
|---|
|  | 215 | $($(target)_$(source)_$(type)DEFS.$(bld_type))\ | 
|---|
|  | 216 | $($(target)_$(source)_$(type)DEFS.$(bld_trg))\ | 
|---|
|  | 217 | $($(target)_$(source)_$(type)DEFS.$(bld_trg_arch))\ | 
|---|
|  | 218 | $($(target)_$(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 219 | $($(target)_$(source)_$(type)DEFS.$(bld_trg_cpu)) | 
|---|
|  | 220 | incs        :=\ | 
|---|
|  | 221 | $($(target)_$(source)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 222 | $($(target)_$(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 223 | $($(target)_$(source)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 224 | $($(target)_$(source)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 225 | $($(target)_$(source)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 226 | $($(target)_$(source)_$(type)INCS)\ | 
|---|
|  | 227 | $($(target)_$(source)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 228 | $($(target)_$(source)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 229 | $($(target)_$(source)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 230 | $($(target)_$(source)_INCS.$(bld_trg))\ | 
|---|
|  | 231 | $($(target)_$(source)_INCS.$(bld_type))\ | 
|---|
|  | 232 | $($(target)_$(source)_INCS)\ | 
|---|
|  | 233 | $(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 234 | $($(target)_$(source)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 235 | $($(target)_$(source)_SDKS.$(bld_trg)) \ | 
|---|
|  | 236 | $($(target)_$(source)_SDKS.$(bld_type)) \ | 
|---|
|  | 237 | $($(target)_$(source)_SDKS),\ | 
|---|
|  | 238 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 239 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 240 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 241 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 242 | $(SDK_$(sdk)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 243 | $(SDK_$(sdk)_$(type)INCS)\ | 
|---|
|  | 244 | $(SDK_$(sdk)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 245 | $(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 246 | $(SDK_$(sdk)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 247 | $(SDK_$(sdk)_INCS.$(bld_trg))\ | 
|---|
|  | 248 | $(SDK_$(sdk)_INCS.$(bld_type))\ | 
|---|
|  | 249 | $(SDK_$(sdk)_INCS))\ | 
|---|
|  | 250 | $($(source)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 251 | $($(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 252 | $($(source)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 253 | $($(source)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 254 | $($(source)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 255 | $($(source)_$(type)INCS)\ | 
|---|
|  | 256 | $($(source)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 257 | $($(source)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 258 | $($(source)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 259 | $($(source)_INCS.$(bld_trg))\ | 
|---|
|  | 260 | $($(source)_INCS.$(bld_type))\ | 
|---|
|  | 261 | $($(source)_INCS)\ | 
|---|
|  | 262 | $(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 263 | $($(source)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 264 | $($(source)_SDKS.$(bld_trg)) \ | 
|---|
|  | 265 | $($(source)_SDKS.$(bld_type)) \ | 
|---|
|  | 266 | $($(source)_SDKS),\ | 
|---|
|  | 267 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 268 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 269 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 270 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 271 | $(SDK_$(sdk)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 272 | $(SDK_$(sdk)_$(type)INCS)\ | 
|---|
|  | 273 | $(SDK_$(sdk)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 274 | $(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 275 | $(SDK_$(sdk)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 276 | $(SDK_$(sdk)_INCS.$(bld_trg))\ | 
|---|
|  | 277 | $(SDK_$(sdk)_INCS.$(bld_type))\ | 
|---|
|  | 278 | $(SDK_$(sdk)_INCS))\ | 
|---|
|  | 279 | $($(target)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 280 | $($(target)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 281 | $($(target)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 282 | $($(target)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 283 | $($(target)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 284 | $($(target)_$(type)INCS)\ | 
|---|
|  | 285 | $($(target)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 286 | $($(target)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 287 | $($(target)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 288 | $($(target)_INCS.$(bld_trg))\ | 
|---|
|  | 289 | $($(target)_INCS.$(bld_type))\ | 
|---|
|  | 290 | $($(target)_INCS)\ | 
|---|
|  | 291 | $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 292 | $($(target)_SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 293 | $($(target)_SDKS.$(bld_trg)) \ | 
|---|
|  | 294 | $($(target)_SDKS.$(bld_type)) \ | 
|---|
|  | 295 | $($(target)_SDKS),\ | 
|---|
|  | 296 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 297 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 298 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 299 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 300 | $(SDK_$(sdk)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 301 | $(SDK_$(sdk)_$(type)INCS)\ | 
|---|
|  | 302 | $(SDK_$(sdk)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 303 | $(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 304 | $(SDK_$(sdk)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 305 | $(SDK_$(sdk)_INCS.$(bld_trg))\ | 
|---|
|  | 306 | $(SDK_$(sdk)_INCS.$(bld_type))\ | 
|---|
|  | 307 | $(SDK_$(sdk)_INCS))\ | 
|---|
|  | 308 | $(INCS.$(bld_trg_cpu))\ | 
|---|
|  | 309 | $(INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 310 | $(INCS.$(bld_trg_arch))\ | 
|---|
|  | 311 | $(INCS.$(bld_trg))\ | 
|---|
|  | 312 | $(INCS.$(bld_type))\ | 
|---|
|  | 313 | $(INCS)\ | 
|---|
|  | 314 | $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 315 | $(SDKS.$(bld_trg_arch)) \ | 
|---|
|  | 316 | $(SDKS.$(bld_trg)) \ | 
|---|
|  | 317 | $(SDKS.$(bld_type)) \ | 
|---|
|  | 318 | $(SDKS),\ | 
|---|
|  | 319 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 320 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 321 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 322 | $(SDK_$(sdk)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 323 | $(SDK_$(sdk)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 324 | $(SDK_$(sdk)_$(type)INCS)\ | 
|---|
|  | 325 | $(SDK_$(sdk)_INCS.$(bld_trg_cpu))\ | 
|---|
|  | 326 | $(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 327 | $(SDK_$(sdk)_INCS.$(bld_trg_arch))\ | 
|---|
|  | 328 | $(SDK_$(sdk)_INCS.$(bld_trg))\ | 
|---|
|  | 329 | $(SDK_$(sdk)_INCS.$(bld_type))\ | 
|---|
|  | 330 | $(SDK_$(sdk)_INCS))\ | 
|---|
|  | 331 | $(TOOL_$(tool)_$(type)INCS.$(bld_trg_cpu))\ | 
|---|
|  | 332 | $(TOOL_$(tool)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 333 | $(TOOL_$(tool)_$(type)INCS.$(bld_trg_arch))\ | 
|---|
|  | 334 | $(TOOL_$(tool)_$(type)INCS.$(bld_trg))\ | 
|---|
|  | 335 | $(TOOL_$(tool)_$(type)INCS.$(bld_type))\ | 
|---|
|  | 336 | $(TOOL_$(tool)_$(type)INCS) | 
|---|
|  | 337 | flags        :=\ | 
|---|
|  | 338 | $(TOOL_$(tool)_$(type)FLAGS)\ | 
|---|
|  | 339 | $(TOOL_$(tool)_$(type)FLAGS.$(bld_type))\ | 
|---|
|  | 340 | $(TOOL_$(tool)_$(type)FLAGS.$(bld_trg))\ | 
|---|
|  | 341 | $(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_arch))\ | 
|---|
|  | 342 | $(TOOL_$(tool)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 343 | $(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_cpu))\ | 
|---|
|  | 344 | $($(type)FLAGS)\ | 
|---|
|  | 345 | $($(type)FLAGS.$(bld_type))\ | 
|---|
|  | 346 | $($(type)FLAGS.$(bld_trg))\ | 
|---|
|  | 347 | $($(type)FLAGS.$(bld_trg_arch))\ | 
|---|
|  | 348 | $($(type)FLAGS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 349 | $($(type)FLAGS.$(bld_trg_cpu))\ | 
|---|
|  | 350 | $($(target)_$(type)FLAGS)\ | 
|---|
|  | 351 | $($(target)_$(type)FLAGS.$(bld_type))\ | 
|---|
|  | 352 | $($(target)_$(type)FLAGS.$(bld_trg))\ | 
|---|
|  | 353 | $($(target)_$(type)FLAGS.$(bld_trg_arch))\ | 
|---|
|  | 354 | $($(target)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 355 | $($(target)_$(type)FLAGS.$(bld_trg_cpu))\ | 
|---|
|  | 356 | $($(source)_$(type)FLAGS)\ | 
|---|
|  | 357 | $($(source)_$(type)FLAGS.$(bld_type))\ | 
|---|
|  | 358 | $($(source)_$(type)FLAGS.$(bld_trg))\ | 
|---|
|  | 359 | $($(source)_$(type)FLAGS.$(bld_trg_arch))\ | 
|---|
|  | 360 | $($(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 361 | $($(source)_$(type)FLAGS.$(bld_trg_cpu))\ | 
|---|
|  | 362 | $($(target)_$(source)_$(type)FLAGS)\ | 
|---|
|  | 363 | $($(target)_$(source)_$(type)FLAGS.$(bld_type))\ | 
|---|
|  | 364 | $($(target)_$(source)_$(type)FLAGS.$(bld_trg))\ | 
|---|
|  | 365 | $($(target)_$(source)_$(type)FLAGS.$(bld_trg_arch))\ | 
|---|
|  | 366 | $($(target)_$(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 367 | $($(target)_$(source)_$(type)FLAGS.$(bld_trg_cpu)) | 
|---|
|  | 368 | # this isn't 100% in sync with kBuild, but it doesn't matter as it's only for gmake now. | 
|---|
|  | 369 | objsuff     := $(firstword \ | 
|---|
|  | 370 | $($(target)_$(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 371 | $($(target)_$(source)_OBJSUFF.$(bld_trg))\ | 
|---|
|  | 372 | $($(target)_$(source)_OBJSUFF)\ | 
|---|
|  | 373 | $($(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 374 | $($(source)_OBJSUFF.$(bld_trg))\ | 
|---|
|  | 375 | $($(source)_OBJSUFF)\ | 
|---|
|  | 376 | $($(target)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 377 | $($(target)_OBJSUFF.$(bld_trg))\ | 
|---|
|  | 378 | $($(target)_OBJSUFF)\ | 
|---|
|  | 379 | $(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 380 | $(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg))\ | 
|---|
|  | 381 | $(TOOL_$(tool)_$(type)OBJSUFF)\ | 
|---|
|  | 382 | $(SUFF_OBJ)) | 
|---|
|  | 383 | obj         := $(outbase)$(objsuff) | 
|---|
|  | 384 | deps        := \ | 
|---|
|  | 385 | $($(target)_$(source)_DEPS)\ | 
|---|
|  | 386 | $($(target)_$(source)_DEPS.$(bld_type))\ | 
|---|
|  | 387 | $($(target)_$(source)_DEPS.$(bld_trg))\ | 
|---|
|  | 388 | $($(target)_$(source)_DEPS.$(bld_trg_arch))\ | 
|---|
|  | 389 | $($(target)_$(source)_DEPS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 390 | $($(target)_$(source)_DEPS.$(bld_trg_cpu))\ | 
|---|
|  | 391 | $($(source)_DEPS)\ | 
|---|
|  | 392 | $($(source)_DEPS.$(bld_type))\ | 
|---|
|  | 393 | $($(source)_DEPS.$(bld_trg))\ | 
|---|
|  | 394 | $($(source)_DEPS.$(bld_trg_arch))\ | 
|---|
|  | 395 | $($(source)_DEPS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 396 | $($(source)_DEPS.$(bld_trg_cpu))\ | 
|---|
|  | 397 | $($(target)_DEPS)\ | 
|---|
|  | 398 | $($(target)_DEPS.$(bld_type))\ | 
|---|
|  | 399 | $($(target)_DEPS.$(bld_trg))\ | 
|---|
|  | 400 | $($(target)_DEPS.$(bld_trg_arch))\ | 
|---|
|  | 401 | $($(target)_DEPS.$(bld_trg).$(bld_trg_arch))\ | 
|---|
|  | 402 | $($(target)_DEPS.$(bld_trg_cpu)) | 
|---|
|  | 403 |  | 
|---|
|  | 404 | # dependencies | 
|---|
|  | 405 | dep         := $(obj)$(SUFF_DEP) | 
|---|
|  | 406 | ifndef NO_COMPILE_CMDS_DEPS | 
|---|
|  | 407 | _DEPFILES_INCLUDED += $(dep) | 
|---|
|  | 408 | $(if $(wildcard $(dep)),$(eval include $(dep))) | 
|---|
|  | 409 | endif | 
|---|
|  | 410 |  | 
|---|
|  | 411 | #$ (warning dbg: target=$(target) source=$(source) tool=$(tool) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps)) | 
|---|
|  | 412 | ifndef TOOL_$(tool)_COMPILE_$(type)_CMDS | 
|---|
|  | 413 | $(warning kBuild: tools: \ | 
|---|
|  | 414 | 1 $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 415 | 2 $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 416 | 3 $($(target)_$(source)_$(type)TOOL) \ | 
|---|
|  | 417 | 4 $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 418 | 5 $($(target)_$(source)_TOOL.$(bld_trg)) \ | 
|---|
|  | 419 | 6 $($(target)_$(source)_TOOL) \ | 
|---|
|  | 420 | 7 $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 421 | 8 $($(target)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 422 | 9 $($(target)_$(type)TOOL) \ | 
|---|
|  | 423 | 10 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 424 | 11 $($(target)_TOOL.$(bld_trg)) \ | 
|---|
|  | 425 | 12 $($(target)_TOOL) \ | 
|---|
|  | 426 | 13 $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 427 | 14 $($(source)_$(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 428 | 15 $($(source)_$(type)TOOL) \ | 
|---|
|  | 429 | 16 $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 430 | 17 $($(source)_TOOL.$(bld_trg)) \ | 
|---|
|  | 431 | 18 $($(source)_TOOL) \ | 
|---|
|  | 432 | 19 $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 433 | 20 $($(type)TOOL.$(bld_trg)) \ | 
|---|
|  | 434 | 21 $($(type)TOOL) \ | 
|---|
|  | 435 | 22 $(TOOL.$(bld_trg).$(bld_trg_arch)) \ | 
|---|
|  | 436 | 23 $(TOOL.$(bld_trg)) \ | 
|---|
|  | 437 | 24 $(TOOL) ) | 
|---|
|  | 438 | $(error kBuild: TOOL_$(tool)_COMPILE_$(type)_CMDS is not defined. source=$(source) target=$(target) ) | 
|---|
|  | 439 | endif | 
|---|
|  | 440 |  | 
|---|
|  | 441 | # call the tool | 
|---|
|  | 442 | $(target)_$(source)_CMDS_   := $(TOOL_$(tool)_COMPILE_$(type)_CMDS) | 
|---|
|  | 443 | $(target)_$(source)_OUTPUT_ := $(TOOL_$(tool)_COMPILE_$(type)_OUTPUT) | 
|---|
|  | 444 | $(target)_$(source)_DEPEND_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPEND) $(deps) $(source) | 
|---|
|  | 445 | $(target)_$(source)_DEPORD_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPORD) $(dirdep) | 
|---|
|  | 446 |  | 
|---|
|  | 447 | # generate the compile rule. | 
|---|
|  | 448 | $(eval $(def_target_source_rule)) | 
|---|
|  | 449 |  | 
|---|
|  | 450 | _OUT_FILES      += $($(target)_$(source)_OUTPUT_) | 
|---|
|  | 451 | $(target)_OBJS_ += $(obj) | 
|---|
|  | 452 |  | 
|---|
|  | 453 | endef | 
|---|
|  | 454 |  | 
|---|