[72] | 1 | # $Id: footer-inherit-uses-tools.kmk 2521 2011-07-26 18:18:19Z bird $
|
---|
| 2 | ## @file
|
---|
[2521] | 3 | # kBuild - Footer - Target lists - Pass 2 - Template & Target Inheritance, Uses and Tools.
|
---|
[72] | 4 | #
|
---|
[1547] | 5 |
|
---|
| 6 | #
|
---|
[2521] | 7 | # Copyright (c) 2004-2011 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
---|
[72] | 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
|
---|
[106] | 13 | # the Free Software Foundation; either version source of the License, or
|
---|
[72] | 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
|
---|
[353] | 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
[72] | 24 | #
|
---|
| 25 | #
|
---|
[1547] | 26 | # As a special exception you are granted permission to include this file, via
|
---|
[1599] | 27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
| 28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
[1547] | 29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
| 30 | # program, whatever should not be covered the GPL.
|
---|
| 31 | #
|
---|
| 32 | #
|
---|
[72] | 33 |
|
---|
[2007] | 34 | ## Converts a variable from simple to recursive flavor.
|
---|
| 35 | # This is used by def_inherit_template_one_accumulate_l and def_inherit_template_one_accumulate_r.
|
---|
| 36 | # @param $1 The variable name.
|
---|
| 37 | define def_simple_2_recursive
|
---|
| 38 | $1_DEFERRED := $$($1)
|
---|
| 39 | $1 = $$($1_DEFERRED)
|
---|
| 40 | endef
|
---|
| 41 |
|
---|
| 42 |
|
---|
[1413] | 43 | ## Inherit one keyword in a non-accumulative manner.
|
---|
| 44 | # @param $(trg) Target object.
|
---|
| 45 | # @param $(prop) The property.
|
---|
| 46 | # @param $(src_key) Source keyword.
|
---|
| 47 | # @param $(trg_key) Target keyword.
|
---|
| 48 | define def_inherit_one_keyword
|
---|
| 49 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 50 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 51 | $(trg)_$(prop).$(trg_key) = $($(trg)_$(prop).$(src_key))
|
---|
| 52 | endif
|
---|
| 53 | endif
|
---|
| 54 | endef
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | # EXPAND_BY = overriding
|
---|
| 58 |
|
---|
| 59 | ## Inherit one keyword in a non-accumulative manner.
|
---|
| 60 | # @param $(trg) Target object.
|
---|
| 61 | # @param $(prop) The property.
|
---|
| 62 | # @param $(src_key) Source keyword.
|
---|
| 63 | # @param $(trg_key) Target keyword.
|
---|
| 64 | define def_inherit_one_keyword_overriding_now_l
|
---|
| 65 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 66 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 67 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(src_key))
|
---|
| 68 | endif
|
---|
| 69 | endif
|
---|
| 70 | endef
|
---|
| 71 |
|
---|
| 72 | ## @copydoc def_inherit_one_overriding_now_l
|
---|
| 73 | define def_inherit_one_keyword_overriding_now_r
|
---|
| 74 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 75 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 76 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(src_key))
|
---|
| 77 | endif
|
---|
| 78 | endif
|
---|
| 79 | endef
|
---|
| 80 |
|
---|
| 81 | ## Inherit one keyword in a non-accumulative manner, deferred expansion.
|
---|
| 82 | # @param $(trg) Target object.
|
---|
| 83 | # @param $(prop) The property.
|
---|
| 84 | # @param $(src_key) Source keyword.
|
---|
| 85 | # @param $(trg_key) Target keyword.
|
---|
| 86 | # @remark This define relies on double evaluation
|
---|
| 87 | define def_inherit_one_keyword_overriding_deferred
|
---|
| 88 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 89 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 90 | $(trg)_$(prop).$(trg_key) = $$($(trg)_$(prop).$(src_key))
|
---|
| 91 | endif
|
---|
| 92 | endif
|
---|
| 93 | endef
|
---|
| 94 |
|
---|
| 95 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 96 | define def_inherit_one_keyword_overriding_deferred_l
|
---|
| 97 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 98 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 99 | $(trg)_$(prop).$(trg_key) = $$($(trg)_$(prop).$(src_key))
|
---|
| 100 | endif
|
---|
| 101 | endif
|
---|
| 102 | endef
|
---|
| 103 |
|
---|
| 104 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 105 | define def_inherit_one_keyword_overriding_deferred_r
|
---|
| 106 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 107 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 108 | $(trg)_$(prop).$(trg_key) = $$($(trg)_$(prop).$(src_key))
|
---|
| 109 | endif
|
---|
| 110 | endif
|
---|
| 111 | endef
|
---|
| 112 |
|
---|
| 113 |
|
---|
| 114 | # EXPAND_BY = prepending
|
---|
| 115 |
|
---|
| 116 | ## Inherit one keyword in a prepending manner.
|
---|
| 117 | # @param $(trg) Target object.
|
---|
| 118 | # @param $(prop) The property.
|
---|
| 119 | # @param $(src_key) Source keyword.
|
---|
| 120 | # @param $(trg_key) Target keyword.
|
---|
| 121 | define def_inherit_one_keyword_prepending_now_l
|
---|
| 122 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 123 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(src_key)) $($(trg)_$(prop).$(trg_key))
|
---|
| 124 | endif
|
---|
| 125 | endef
|
---|
| 126 |
|
---|
| 127 | ## @copydoc def_inherit_one_prepending_now_l
|
---|
| 128 | define def_inherit_one_keyword_prepending_now_r
|
---|
| 129 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 130 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(trg_key)) $($(trg)_$(prop).$(src_key))
|
---|
| 131 | endif
|
---|
| 132 | endef
|
---|
| 133 |
|
---|
| 134 | ## Inherit one keyword in a non-accumulative manner, deferred expansion.
|
---|
| 135 | # @param $(trg) Target object.
|
---|
| 136 | # @param $(prop) The property.
|
---|
| 137 | # @param $(src_key) Source keyword.
|
---|
| 138 | # @param $(trg_key) Target keyword.
|
---|
| 139 | # @remark This define relies on double evaluation
|
---|
| 140 | define def_inherit_one_keyword_prepending_deferred
|
---|
| 141 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 142 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 143 | $(trg)_$(prop).$(trg_key) = $$($(trg)_$(prop).$(src_key))
|
---|
| 144 | endif
|
---|
| 145 | endif
|
---|
| 146 | endef
|
---|
| 147 |
|
---|
| 148 | ## Inherit one keyword in a prepending manner, deferred expansion.
|
---|
| 149 | # @param $(trg) Target object.
|
---|
| 150 | # @param $(prop) The property.
|
---|
| 151 | # @param $(src_key) Source keyword.
|
---|
| 152 | # @param $(trg_key) Target keyword.
|
---|
| 153 | define def_inherit_one_keyword_prepending_deferred_l
|
---|
| 154 | ifdef $(trg)_$(prop).$(src_key)
|
---|
[2007] | 155 | ifeq ($$(flavor $(trg)_$(prop).$(trg_key)),simple)
|
---|
| 156 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop).$(trg_key))
|
---|
| 157 | endif
|
---|
[1413] | 158 | $(trg)_$(prop).$(trg_key) <= $$($(trg)_$(prop).$(src_key))
|
---|
| 159 | endif
|
---|
| 160 | endef
|
---|
| 161 |
|
---|
| 162 | ## @copydoc def_inherit_one_prepending_deferred_l
|
---|
| 163 | define def_inherit_one_keyword_prepending_deferred_r
|
---|
| 164 | ifdef $(trg)_$(prop).$(src_key)
|
---|
[2007] | 165 | ifeq ($$(flavor $(trg)_$(prop).$(trg_key)),simple)
|
---|
| 166 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop).$(trg_key))
|
---|
| 167 | endif
|
---|
| 168 | $(trg)_$(prop).$(trg_key) += $$($(trg)_$(prop).$(src_key))
|
---|
[1413] | 169 | endif
|
---|
| 170 | endef
|
---|
| 171 |
|
---|
| 172 |
|
---|
| 173 | # EXPAND_BY = appending
|
---|
| 174 |
|
---|
| 175 | ## Inherit one keyword in an appending manner.
|
---|
| 176 | # @param $(trg) Target object.
|
---|
| 177 | # @param $(prop) The property.
|
---|
| 178 | # @param $(src_key) Source keyword.
|
---|
| 179 | # @param $(trg_key) Target keyword.
|
---|
| 180 | define def_inherit_one_keyword_appending_now_l
|
---|
| 181 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 182 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(trg_key)) $($(trg)_$(prop).$(src_key))
|
---|
| 183 | endif
|
---|
| 184 | endef
|
---|
| 185 |
|
---|
| 186 | ## @copydoc def_inherit_one_appending_now_l
|
---|
| 187 | define def_inherit_one_keyword_appending_now_r
|
---|
| 188 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 189 | $(trg)_$(prop).$(trg_key) := $($(trg)_$(prop).$(src_key)) $($(trg)_$(prop).$(trg_key))
|
---|
| 190 | endif
|
---|
| 191 | endef
|
---|
| 192 |
|
---|
| 193 | ## Inherit one keyword in a non-accumulative manner, deferred expansion.
|
---|
| 194 | # @param $(trg) Target object.
|
---|
| 195 | # @param $(prop) The property.
|
---|
| 196 | # @param $(src_key) Source keyword.
|
---|
| 197 | # @param $(trg_key) Target keyword.
|
---|
| 198 | # @remark This define relies on double evaluation
|
---|
| 199 | define def_inherit_one_keyword_appending_deferred
|
---|
| 200 | ifdef $(trg)_$(prop).$(src_key)
|
---|
| 201 | ifndef $(trg)_$(prop).$(trg_key)
|
---|
| 202 | $(trg)_$(prop).$(trg_key) = $$($(trg)_$(prop).$(src_key))
|
---|
| 203 | endif
|
---|
| 204 | endif
|
---|
| 205 | endef
|
---|
| 206 |
|
---|
| 207 | ## Inherit one keyword in an appending manner, deferred expansion.
|
---|
| 208 | # @param $(trg) Target object.
|
---|
| 209 | # @param $(prop) The property.
|
---|
| 210 | # @param $(src_key) Source keyword.
|
---|
| 211 | # @param $(trg_key) Target keyword.
|
---|
| 212 | define def_inherit_one_keyword_appending_deferred_l
|
---|
| 213 | ifdef $(trg)_$(prop).$(src_key)
|
---|
[2007] | 214 | ifeq ($$(flavor $(trg)_$(prop).$(trg_key)),simple)
|
---|
| 215 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop).$(trg_key))
|
---|
| 216 | endif
|
---|
[1413] | 217 | $(trg)_$(prop).$(trg_key) += $$($(trg)_$(prop).$(src_key))
|
---|
| 218 | endif
|
---|
| 219 | endef
|
---|
| 220 |
|
---|
| 221 | ## @copydoc def_inherit_one_appending_deferred_l
|
---|
| 222 | define def_inherit_one_keyword_appending_deferred_r
|
---|
| 223 | ifdef $(trg)_$(prop).$(src_key)
|
---|
[2007] | 224 | ifeq ($$(flavor $(trg)_$(prop).$(trg_key)),simple)
|
---|
| 225 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop).$(trg_key))
|
---|
| 226 | endif
|
---|
| 227 | $(trg)_$(prop).$(trg_key) <= $$($(trg)_$(prop).$(src_key))
|
---|
[1413] | 228 | endif
|
---|
| 229 | endef
|
---|
| 230 |
|
---|
| 231 |
|
---|
[2011] | 232 | ## Worker for def_inherit that deals with one keyword that makes
|
---|
[1413] | 233 | # use of inheritance.
|
---|
| 234 | # @param prefix_keyword key_prefix:keyword. The cool join/split game as usual.
|
---|
| 235 | # @param trg Object to consider for inheriting.
|
---|
| 236 | # @param properties List of the properties with straight expansion.
|
---|
| 237 | # @param properties_now_l List of the properties with immediate expansion, accumulating on the left side.
|
---|
| 238 | # @param properties_now_r List of the properties with immediate expansion, accumulating on the right side.
|
---|
| 239 | # @param properties_deferred List of the properties with deferred expansion (e.g. function), non-accumulative .
|
---|
| 240 | # @param properties_deferred_l List of the properties with deferred expansion (e.g. function), accumulating on the left side.
|
---|
| 241 | # @param properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
|
---|
| 242 | define def_inherit_keyword
|
---|
[1496] | 243 | local prefix := $(word 1,$(subst :, ,$(prefix_keyword)))
|
---|
| 244 | local trg_key := $(word 2,$(subst :, ,$(prefix_keyword)))
|
---|
| 245 | local src_key := $($(prefix)_$(trg_key)_EXTENDS)
|
---|
| 246 | local by := $($(prefix)_$(trg_key)_EXTENDS_BY)
|
---|
[1413] | 247 |
|
---|
| 248 | # Inherit the properties.
|
---|
| 249 | $(foreach prop, $(properties), $(eval $(def_inherit_one_keyword)))
|
---|
| 250 | $(foreach prop, $(properties_now_l), $(eval $(def_inherit_one_keyword_$(by)_now_l)))
|
---|
| 251 | $(foreach prop, $(properties_now_r), $(eval $(def_inherit_one_keyword_$(by)_now_r)))
|
---|
| 252 | $(foreach prop, $(properties_deferred), $(eval $(def_inherit_one_keyword_$(by)_deferred)))
|
---|
| 253 | $(foreach prop, $(properties_deferred_l), $(eval $(def_inherit_one_keyword_$(by)_deferred_l)))
|
---|
| 254 | $(foreach prop, $(properties_deferred_r), $(eval $(def_inherit_one_keyword_$(by)_deferred_r)))
|
---|
| 255 |
|
---|
| 256 | endef # def_inherit_keyword
|
---|
| 257 |
|
---|
| 258 |
|
---|
[985] | 259 | ## Inherit one template property in a non-accumulative manner.
|
---|
| 260 | # @param $(prop) Property name
|
---|
| 261 | # @param $(src) Source (parent) object.
|
---|
| 262 | # @param $(trg) Target (child) object.
|
---|
| 263 | define def_inherit_one
|
---|
| 264 | ifdef $(src)_$(prop)
|
---|
| 265 | ifndef $(trg)_$(prop)
|
---|
| 266 | $(trg)_$(prop) = $($(src)_$(prop))
|
---|
| 267 | endif
|
---|
| 268 | endif
|
---|
[1413] | 269 | endef
|
---|
[723] | 270 |
|
---|
[1407] | 271 |
|
---|
| 272 | # EXPAND_BY = overriding
|
---|
| 273 |
|
---|
[985] | 274 | ## Inherit one template property in a non-accumulative manner.
|
---|
| 275 | # @param $(prop) Property name
|
---|
| 276 | # @param $(src) Source (parent) object.
|
---|
| 277 | # @param $(trg) Target (child) object.
|
---|
[1407] | 278 | define def_inherit_one_overriding_now_l
|
---|
[985] | 279 | ifdef $(src)_$(prop)
|
---|
| 280 | ifndef $(trg)_$(prop)
|
---|
| 281 | $(trg)_$(prop) := $($(src)_$(prop))
|
---|
| 282 | endif
|
---|
| 283 | endif
|
---|
[1413] | 284 | endef
|
---|
[185] | 285 |
|
---|
[1407] | 286 | ## @copydoc def_inherit_one_overriding_now_l
|
---|
| 287 | define def_inherit_one_overriding_now_r
|
---|
| 288 | ifdef $(src)_$(prop)
|
---|
| 289 | ifndef $(trg)_$(prop)
|
---|
| 290 | $(trg)_$(prop) := $($(src)_$(prop))
|
---|
| 291 | endif
|
---|
| 292 | endif
|
---|
[1413] | 293 | endef
|
---|
[1407] | 294 |
|
---|
[985] | 295 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 296 | # @param $(prop) Property name
|
---|
| 297 | # @param $(src) Source
|
---|
| 298 | # @param $(trg) Target
|
---|
| 299 | # @remark This define relies on double evaluation
|
---|
[1407] | 300 | define def_inherit_one_overriding_deferred
|
---|
[985] | 301 | ifdef $(src)_$(prop)
|
---|
| 302 | ifndef $(trg)_$(prop)
|
---|
| 303 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 304 | endif
|
---|
[185] | 305 | endif
|
---|
[1413] | 306 | endef
|
---|
[185] | 307 |
|
---|
[1407] | 308 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 309 | define def_inherit_one_overriding_deferred_l
|
---|
| 310 | ifdef $(src)_$(prop)
|
---|
| 311 | ifndef $(trg)_$(prop)
|
---|
| 312 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 313 | endif
|
---|
| 314 | endif
|
---|
[1413] | 315 | endef
|
---|
[1407] | 316 |
|
---|
| 317 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 318 | define def_inherit_one_overriding_deferred_r
|
---|
| 319 | ifdef $(src)_$(prop)
|
---|
| 320 | ifndef $(trg)_$(prop)
|
---|
| 321 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 322 | endif
|
---|
| 323 | endif
|
---|
[1413] | 324 | endef
|
---|
[1407] | 325 |
|
---|
| 326 |
|
---|
| 327 | # EXPAND_BY = prepending
|
---|
| 328 |
|
---|
| 329 | ## Inherit one template property in a prepending manner.
|
---|
| 330 | # @param $(prop) Property name
|
---|
| 331 | # @param $(src) Source (parent) object.
|
---|
| 332 | # @param $(trg) Target (child) object.
|
---|
| 333 | define def_inherit_one_prepending_now_l
|
---|
| 334 | ifdef $(src)_$(prop)
|
---|
[1413] | 335 | $(trg)_$(prop) := $($(src)_$(prop)) $($(trg)_$(prop))
|
---|
[1407] | 336 | endif
|
---|
[1413] | 337 | endef
|
---|
[1407] | 338 |
|
---|
| 339 | ## @copydoc def_inherit_one_prepending_now_l
|
---|
| 340 | define def_inherit_one_prepending_now_r
|
---|
| 341 | ifdef $(src)_$(prop)
|
---|
[1413] | 342 | $(trg)_$(prop) := $($(trg)_$(prop)) $($(src)_$(prop))
|
---|
[1407] | 343 | endif
|
---|
[1413] | 344 | endef
|
---|
[1407] | 345 |
|
---|
| 346 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 347 | # @param $(prop) Property name
|
---|
| 348 | # @param $(src) Source
|
---|
| 349 | # @param $(trg) Target
|
---|
| 350 | # @remark This define relies on double evaluation
|
---|
| 351 | define def_inherit_one_prepending_deferred
|
---|
| 352 | ifdef $(src)_$(prop)
|
---|
| 353 | ifndef $(trg)_$(prop)
|
---|
| 354 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 355 | endif
|
---|
| 356 | endif
|
---|
[1413] | 357 | endef
|
---|
[1407] | 358 |
|
---|
| 359 | ## Inherit one template property in a prepending manner, deferred expansion.
|
---|
| 360 | # @param $(prop) Property name
|
---|
| 361 | # @param $(src) Source (parent) object.
|
---|
| 362 | # @param $(trg) Target (child) object.
|
---|
| 363 | define def_inherit_one_prepending_deferred_l
|
---|
| 364 | ifdef $(src)_$(prop)
|
---|
[2007] | 365 | ifeq ($$(flavor $(trg)_$(prop)),simple)
|
---|
| 366 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop))
|
---|
| 367 | endif
|
---|
[1407] | 368 | $(trg)_$(prop) <= $$($(src)_$(prop))
|
---|
| 369 | endif
|
---|
[1413] | 370 | endef
|
---|
[1407] | 371 |
|
---|
| 372 | ## @copydoc def_inherit_one_prepending_deferred_l
|
---|
| 373 | define def_inherit_one_prepending_deferred_r
|
---|
| 374 | ifdef $(src)_$(prop)
|
---|
[2007] | 375 | ifeq ($$(flavor $(trg)_$(prop)),simple)
|
---|
| 376 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop))
|
---|
| 377 | endif
|
---|
| 378 | $(trg)_$(prop) += $$($(src)_$(prop))
|
---|
[1407] | 379 | endif
|
---|
[1413] | 380 | endef
|
---|
[1407] | 381 |
|
---|
| 382 |
|
---|
| 383 | # EXPAND_BY = appending
|
---|
| 384 |
|
---|
[1413] | 385 | ## Inherit one template property in an appending manner.
|
---|
[1407] | 386 | # @param $(prop) Property name
|
---|
| 387 | # @param $(src) Source (parent) object.
|
---|
| 388 | # @param $(trg) Target (child) object.
|
---|
| 389 | define def_inherit_one_appending_now_l
|
---|
| 390 | ifdef $(src)_$(prop)
|
---|
[1413] | 391 | $(trg)_$(prop) := $($(trg)_$(prop)) $($(src)_$(prop))
|
---|
[1407] | 392 | endif
|
---|
[1413] | 393 | endef
|
---|
[1407] | 394 |
|
---|
| 395 | ## @copydoc def_inherit_one_appending_now_l
|
---|
| 396 | define def_inherit_one_appending_now_r
|
---|
| 397 | ifdef $(src)_$(prop)
|
---|
[1413] | 398 | $(trg)_$(prop) := $($(src)_$(prop)) $($(trg)_$(prop))
|
---|
[1407] | 399 | endif
|
---|
[1413] | 400 | endef
|
---|
[1407] | 401 |
|
---|
| 402 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 403 | # @param $(prop) Property name
|
---|
| 404 | # @param $(src) Source
|
---|
| 405 | # @param $(trg) Target
|
---|
| 406 | # @remark This define relies on double evaluation
|
---|
| 407 | define def_inherit_one_appending_deferred
|
---|
| 408 | ifdef $(src)_$(prop)
|
---|
| 409 | ifndef $(trg)_$(prop)
|
---|
| 410 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 411 | endif
|
---|
| 412 | endif
|
---|
[1413] | 413 | endef
|
---|
[1407] | 414 |
|
---|
[1413] | 415 | ## Inherit one template property in an appending manner, deferred expansion.
|
---|
[1407] | 416 | # @param $(prop) Property name
|
---|
| 417 | # @param $(src) Source (parent) object.
|
---|
| 418 | # @param $(trg) Target (child) object.
|
---|
| 419 | define def_inherit_one_appending_deferred_l
|
---|
| 420 | ifdef $(src)_$(prop)
|
---|
[2007] | 421 | ifeq ($$(flavor $(trg)_$(prop)),simple)
|
---|
| 422 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop))
|
---|
| 423 | endif
|
---|
[1407] | 424 | $(trg)_$(prop) += $$($(src)_$(prop))
|
---|
| 425 | endif
|
---|
[1413] | 426 | endef
|
---|
[1407] | 427 |
|
---|
| 428 | ## @copydoc def_inherit_one_appending_deferred_l
|
---|
| 429 | define def_inherit_one_appending_deferred_r
|
---|
| 430 | ifdef $(src)_$(prop)
|
---|
[2007] | 431 | ifeq ($$(flavor $(trg)_$(prop)),simple)
|
---|
| 432 | $$(evalcall2 def_simple_2_recursive,$(trg)_$(prop))
|
---|
| 433 | endif
|
---|
| 434 | $(trg)_$(prop) <= $$($(src)_$(prop))
|
---|
[1407] | 435 | endif
|
---|
[1413] | 436 | endef
|
---|
[1407] | 437 |
|
---|
| 438 |
|
---|
[1413] | 439 | ## combines the specified properties $(1) with the $(_KEYWORDS) list.
|
---|
| 440 | _INHERIT_JOIN_KEYWORDS = $(1) $(foreach keyword,$(_KEYWORDS), $(addsuffix .$(keyword), $(1)))
|
---|
[1407] | 441 |
|
---|
[1413] | 442 |
|
---|
[985] | 443 | ## Generic inheritance for use with targets templates and tools.
|
---|
[1407] | 444 | # @param trg Object to consider for inheriting.
|
---|
| 445 | # @param src_prefix What to prefix the value found in EXTENDS with to get the object.
|
---|
[1414] | 446 | # @param load_function Load function for stuff that needs
|
---|
[1407] | 447 | # @param properties List of the properties with straight expansion.
|
---|
| 448 | # @param properties_now_l List of the properties with immediate expansion, accumulating on the left side.
|
---|
| 449 | # @param properties_now_r List of the properties with immediate expansion, accumulating on the right side.
|
---|
| 450 | # @param properties_deferred List of the properties with deferred expansion (e.g. function), non-accumulative .
|
---|
| 451 | # @param properties_deferred_l List of the properties with deferred expansion (e.g. function), accumulating on the left side.
|
---|
| 452 | # @param properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
|
---|
[985] | 453 | define def_inherit
|
---|
[1414] | 454 |
|
---|
[1496] | 455 | # Load it - loading is a mess, fix.
|
---|
[1414] | 456 | ifneq ($(load_function),)
|
---|
[1496] | 457 | local loading := $(patsubst $(src_prefix)%,%,$(trg))
|
---|
| 458 | $(evalvalctx $(load_function))
|
---|
[1414] | 459 | endif
|
---|
| 460 |
|
---|
[1496] | 461 | local src := $(strip $($(trg)_EXTENDS))
|
---|
[985] | 462 | ifneq ($(src),)
|
---|
| 463 | ifndef $(trg)_EXTENDS_STATUS_
|
---|
| 464 | $(trg)_EXTENDS_STATUS_ := 0
|
---|
[1414] | 465 |
|
---|
| 466 | # Load the source.
|
---|
| 467 | ifneq ($(load_function),)
|
---|
[1496] | 468 | local loading := $(src)
|
---|
| 469 | $(evalvalctx $(load_function))
|
---|
[1414] | 470 | endif
|
---|
| 471 |
|
---|
| 472 | # less typing.
|
---|
[1496] | 473 | local src := $(src_prefix)$(src)
|
---|
[185] | 474 |
|
---|
[985] | 475 | # Recursivly process the parent (src) if it's inherting from somebody too.
|
---|
| 476 | ifdef $(src)_EXTENDS
|
---|
| 477 | ifneq ($($(src)_EXTENDS_STATUS_),42)
|
---|
| 478 | # 'foreach' will create 'trg' in a new variable context hiding
|
---|
[1502] | 479 | # out current variable. 'src' OTOH will be overwritten.
|
---|
[1496] | 480 | $(foreach trg, $(src), $(evalval def_inherit))
|
---|
| 481 | local src := $(src_prefix)$(strip $($(trg)_EXTENDS))
|
---|
[985] | 482 | endif
|
---|
| 483 | endif
|
---|
[984] | 484 |
|
---|
[1407] | 485 | # Get & check EXTENDS_BY.
|
---|
[1496] | 486 | local by = $(strip $($(trg)_EXTENDS_BY))
|
---|
[1407] | 487 | ifeq ($(by),)
|
---|
[1496] | 488 | local by = overriding
|
---|
[1407] | 489 | else ifn1of ($(by), overriding appending prepending)
|
---|
| 490 | $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(trg)'!)
|
---|
| 491 | endif
|
---|
| 492 |
|
---|
| 493 | # Inherit the properties.
|
---|
[1413] | 494 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties)), $(eval $(def_inherit_one)))
|
---|
| 495 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties_now_l)), $(eval $(def_inherit_one_$(by)_now_l)))
|
---|
| 496 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties_now_r)), $(eval $(def_inherit_one_$(by)_now_r)))
|
---|
| 497 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties_deferred)), $(eval $(def_inherit_one_$(by)_deferred)))
|
---|
| 498 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties_deferred_l)), $(eval $(def_inherit_one_$(by)_deferred_l)))
|
---|
| 499 | $(foreach prop, $(call _INHERIT_JOIN_KEYWORDS,$(properties_deferred_r)), $(eval $(def_inherit_one_$(by)_deferred_r)))
|
---|
[1407] | 500 |
|
---|
| 501 | # Mark the target as done.
|
---|
[985] | 502 | $(trg)_EXTENDS_STATUS_ := 42
|
---|
| 503 | else
|
---|
| 504 | # Check for inheritance loops.
|
---|
[1266] | 505 | ifneq ($($(trg)_EXTENDS_STATUS_),42)
|
---|
| 506 | $(error kBuild: Target inheritance loop! target=$(trg) $(trg)_EXTENDS_STATUS_=$($(trg)_EXTENDS_STATUS_))
|
---|
[985] | 507 | endif
|
---|
| 508 | endif
|
---|
| 509 | endif
|
---|
[984] | 510 |
|
---|
[1413] | 511 | # Keyword inheritance.
|
---|
[1496] | 512 | $(foreach prefix_keyword, $(join $(_KEYWORDS_PREFIX), $(addprefix :,$(_KEYWORDS_EXTENDS))), $(evalval def_inherit_keyword))
|
---|
[985] | 513 |
|
---|
[1413] | 514 | endef # def_inherit
|
---|
[1399] | 515 |
|
---|
| 516 |
|
---|
[984] | 517 | #
|
---|
[1672] | 518 | # Load global units before doing any inheriting so they can add new properties.
|
---|
| 519 | #
|
---|
| 520 | # This only applies to the guys listed in the global USES since there is
|
---|
| 521 | # no reliable way to deal with things on a target level without first
|
---|
| 522 | # applying templates. So, to avoid having USES mess up all targets,
|
---|
| 523 | # we'll make the global and per-target USES property work differently:
|
---|
| 524 | # The global USES does not apply to targets, just globally.
|
---|
| 525 | #
|
---|
| 526 |
|
---|
| 527 | ## Unit load function.
|
---|
| 528 | # @param loading The unit name
|
---|
| 529 | define def_unit_load_function
|
---|
| 530 | ifndef UNIT_$(loading)
|
---|
| 531 | UNIT_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
|
---|
| 532 | ifeq ($(UNIT_$(loading)_KMK_FILE),)
|
---|
| 533 | $(error kBuild: Cannot find include file for the unit '$(loading)'! Searched: $(KBUILD_UNIT_PATHS) $(KBUILD_PATH)/units $(KBUILD_DEFAULT_PATHS))
|
---|
| 534 | endif
|
---|
| 535 | include $(UNIT_$(loading)_KMK_FILE)
|
---|
| 536 | ifndef UNIT_$(loading)
|
---|
| 537 | $(warning kBuild: UNIT_$(loading) was not defined by $(UNIT_$(loading)_KMK_FILE)!)
|
---|
| 538 | endif
|
---|
| 539 | endif
|
---|
| 540 | endef # def_unit_load_function
|
---|
| 541 |
|
---|
| 542 | $(foreach loading, \
|
---|
| 543 | $(USES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
| 544 | $(USES.$(KBUILD_TARGET_CPU)) \
|
---|
| 545 | $(USES.$(KBUILD_TARGET_ARCH)) \
|
---|
| 546 | $(USES.$(KBUILD_TARGET)) \
|
---|
| 547 | $(USES.$(KBUILD_HOST).$(KBUILD_HOST_ARCH)) \
|
---|
| 548 | $(USES.$(KBUILD_HOST_CPU)) \
|
---|
| 549 | $(USES.$(KBUILD_HOST_ARCH)) \
|
---|
| 550 | $(USES.$(KBUILD_TARGET)) \
|
---|
| 551 | $(USES.$(KBUILD_TYPE)) \
|
---|
| 552 | $(USES),$(evalval def_unit_load_function))
|
---|
| 553 |
|
---|
| 554 |
|
---|
| 555 | #
|
---|
[985] | 556 | # Determin all the templates that is being used and make
|
---|
[1415] | 557 | # sure they are present before we try collect keywords.
|
---|
[72] | 558 | #
|
---|
| 559 | _TEMPLATES := $(TEMPLATE)
|
---|
| 560 | define def_templates
|
---|
| 561 | ifdef $(target)_TEMPLATE
|
---|
[985] | 562 | ifneq ("$($(target)_TEMPLATE)","$(strip $($(target)_TEMPLATE))")
|
---|
| 563 | $$(error kBuild: The template name of target '$(target)' contains tabs ($($(target)_TEMPLATE))). Please remove them)
|
---|
| 564 | endif
|
---|
| 565 | _TEMPLATES += $($(target)_TEMPLATE)
|
---|
[72] | 566 | endif
|
---|
[985] | 567 | endef # def_templates
|
---|
[984] | 568 | $(foreach target, $(_ALL_TARGETS), $(eval $(def_templates)))
|
---|
[72] | 569 | _TEMPLATES := $(sort $(_TEMPLATES))
|
---|
| 570 |
|
---|
[1417] | 571 | ## Template load function.
|
---|
| 572 | # @param loading The template name. This is prefixed.
|
---|
| 573 | define def_templates_load_function
|
---|
| 574 | ifndef TEMPLATE_$(loading)
|
---|
[1504] | 575 | TEMPLATE_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_TEMPLATE_PATHS) $(KBUILD_PATH)/templates $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
|
---|
[1496] | 576 | ifeq ($(TEMPLATE_$(loading)_KMK_FILE),)
|
---|
[1504] | 577 | $(error kBuild: Cannot find include file for the template '$(loading)'! Searched: $(KBUILD_TEMPLATE_PATHS) $(KBUILD_PATH)/templates $(KBUILD_DEFAULT_PATHS))
|
---|
[985] | 578 | endif
|
---|
[1417] | 579 | include $(TEMPLATE_$(loading)_KMK_FILE)
|
---|
| 580 | ifndef TEMPLATE_$(loading)
|
---|
| 581 | $(warning kBuild: TEMPLATE_$(loading) was not defined by $(TEMPLATE_$(loading)_KMK_FILE)!)
|
---|
| 582 | endif
|
---|
[72] | 583 | endif
|
---|
[1456] | 584 | endef # def_templates_load_function
|
---|
[1496] | 585 | $(foreach loading, $(_TEMPLATES), $(evalval def_templates_load_function))
|
---|
[72] | 586 |
|
---|
[74] | 587 |
|
---|
[72] | 588 | #
|
---|
[1415] | 589 | # Determin the keywords required for correct inherting and setup keyword inheritance.
|
---|
[412] | 590 | #
|
---|
[1415] | 591 | # This means walking all the lists of immediate template and targets and
|
---|
| 592 | # pick up all the BLD_T* keywords. Since templates that are referenced
|
---|
| 593 | # indirectly in the inheritance hierarchy, the result from this exercise
|
---|
| 594 | # might not be 100% accurate... :-/
|
---|
[985] | 595 | #
|
---|
[1504] | 596 | _BLD_TYPES := $(KBUILD_TYPE)
|
---|
| 597 | _BLD_TARGETS := $(KBUILD_TARGET) $(KBUILD_HOSTS)
|
---|
| 598 | _BLD_ARCHES := $(KBUILD_TARGET_ARCH) $(KBUILD_HOST_ARCH)
|
---|
| 599 | _BLD_CPUS := $(KBUILD_TARGET_CPU) $(KBUILD_HOST_CPU)
|
---|
[985] | 600 |
|
---|
| 601 | define def_collect_bld_xyz
|
---|
[1410] | 602 | ifdef $(src)_BLD_TYPE
|
---|
| 603 | ifn1of ($($(src)_BLD_TYPE), $(KBUILD_BLD_TYPES))
|
---|
| 604 | $(error kBuild: $(src)_BLD_TYPE=$($(src)_BLD_TYPE) not in KBUILD_BLD_TYPES={$(KBUILD_BLD_TYPES)}!)
|
---|
| 605 | endif
|
---|
[1394] | 606 | _BLD_TYPES += $($(src)_BLD_TYPE)
|
---|
[412] | 607 | endif
|
---|
[1410] | 608 | ifdef $(src)_BLD_TRG
|
---|
| 609 | ifn1of ($($(src)_BLD_TRG), $(KBUILD_OSES))
|
---|
| 610 | $(error kBuild: $(src)_BLD_TRG=$($(src)_BLD_TRG) not in KBUILD_OSES={$(KBUILD_OSES)}!)
|
---|
| 611 | endif
|
---|
[985] | 612 | _BLD_TARGETS += $($(src)_BLD_TRG)
|
---|
| 613 | endif
|
---|
[1410] | 614 | ifdef $(src)_BLD_TRG_ARCH
|
---|
| 615 | ifn1of ($($(src)_BLD_TRG_ARCH), $(KBUILD_ARCHES))
|
---|
| 616 | $(error kBuild: $(src)_BLD_TRG_ARCH=$($(src)_BLD_TRG_ARCH) not in KBUILD_ARCHES={$(KBUILD_ARCHES)}!)
|
---|
| 617 | endif
|
---|
[985] | 618 | _BLD_ARCHES += $($(src)_BLD_TRG_ARCH)
|
---|
| 619 | endif
|
---|
[1410] | 620 | ifdef $(src)_BLD_TRG_CPU
|
---|
| 621 | if1of ($($(src)_BLD_CPU), $(KBUILD_ARCHES) $(KBUILD_OSES) $(KBUILD_BLD_TYPES))
|
---|
| 622 | $(error kBuild: $(src)_BLD_TRG_CPU=$($(src)_BLD_TRG_CPU) found in KBUILD_ARCHES, KBUILD_OSES or KBUILD_BLD_TYPES!)
|
---|
| 623 | endif
|
---|
[1394] | 624 | _BLD_CPUS += $($(src)_BLD_TRG_CPU)
|
---|
[985] | 625 | endif
|
---|
| 626 | endef # def_collect_bld_xyz
|
---|
[1410] | 627 | $(foreach src, $(addprefix TEMPLATE_, $(_TEMPLATES)) $(_ALL_TARGETS) \
|
---|
[1496] | 628 | ,$(evalval def_collect_bld_xyz))
|
---|
[412] | 629 |
|
---|
[1410] | 630 | # Drop duplicate values.
|
---|
[1413] | 631 | # WARNING! These list might not include keywords only involved in inheritance.
|
---|
[985] | 632 | _BLD_TYPES := $(sort $(_BLD_TYPES))
|
---|
| 633 | _BLD_TARGETS := $(sort $(_BLD_TARGETS))
|
---|
| 634 | _BLD_ARCHES := $(sort $(_BLD_ARCHES))
|
---|
| 635 | _BLD_CPUS := $(sort $(_BLD_CPUS))
|
---|
[552] | 636 |
|
---|
[1413] | 637 | ## Look for keywords which extends others and order them.
|
---|
| 638 | # @param keyword
|
---|
| 639 | # @param prefix
|
---|
| 640 | # @param valid
|
---|
[1410] | 641 | define def_keyword_ordering
|
---|
[1413] | 642 | # Check for EXTENDS, fix and validate it if found.
|
---|
[1496] | 643 | local src := $(strip $($(prefix)_$(keyword)_EXTENDS))
|
---|
[1410] | 644 | ifneq ($(src),)
|
---|
| 645 | ifndef $(prefix)_$(keyword)_EXTENDS_STATUS_
|
---|
| 646 | ifn1of ($(src), $(valid))
|
---|
| 647 | $(error kBuild: $(keyword) tries to extend unknown keyword '$(src)'! (known = $(valid)))
|
---|
| 648 | endif
|
---|
| 649 |
|
---|
[1413] | 650 | # Recursivly process the parent (src).
|
---|
[1410] | 651 | ifneq ($($(prefix)_$(src)_EXTENDS_STATUS_),42)
|
---|
[1413] | 652 | $(prefix)_$(keyword)_EXTENDS_STATUS_ := 0
|
---|
| 653 | # 'foreach' will create 'keyword' in a new variable context hiding
|
---|
| 654 | # out current variable. 'src' OTOH will be overwritten.
|
---|
[1496] | 655 | $(foreach keyword, $(src), $(evalval def_keyword_ordering))
|
---|
| 656 | local src := $(strip $($(prefix)_$(keyword)_EXTENDS))
|
---|
[1410] | 657 | endif
|
---|
| 658 |
|
---|
[1413] | 659 | # Check and strip EXTENDS_BY.
|
---|
[1496] | 660 | local by = $(strip $($(prefix)_$(keyword)_EXTENDS_BY))
|
---|
[1410] | 661 | ifeq ($(by),)
|
---|
[1496] | 662 | local by = overriding
|
---|
[1410] | 663 | else ifn1of ($(by), overriding appending prepending)
|
---|
| 664 | $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(keyword)'!)
|
---|
| 665 | endif
|
---|
| 666 |
|
---|
[1413] | 667 | # Update the attributes with stripped
|
---|
| 668 | $(prefix)_$(keyword)_EXTENDS_BY := $(by)
|
---|
| 669 | $(prefix)_$(keyword)_EXTENDS := $(src)
|
---|
| 670 |
|
---|
[1410] | 671 | # Add it to the list and mark it as done.
|
---|
[1413] | 672 | _KEYWORDS_EXTENDS += $(keyword)
|
---|
| 673 | _KEYWORDS_PREFIX += $(prefix)
|
---|
[1410] | 674 | $(prefix)_$(keyword)_EXTENDS_STATUS_ := 42
|
---|
| 675 | else
|
---|
| 676 | # Check for inheritance loops.
|
---|
| 677 | ifneq ($($(trg)_EXTENDS_STATUS_),42)
|
---|
| 678 | $(error kBuild: Keyword inheritance loop! keyword=$(keyword) $(prefix)_$(keyword)_EXTENDS_STATUS_=$($(prefix)_$(keyword)_EXTENDS_STATUS_))
|
---|
| 679 | endif
|
---|
| 680 | endif
|
---|
[1413] | 681 | else
|
---|
| 682 | # Add it to the ordered list and mark it as done.
|
---|
| 683 | _KEYWORDS_ORDERED += $(keyword)
|
---|
| 684 | $(prefix)_$(src)_EXTENDS_STATUS_ := 42
|
---|
[1410] | 685 | endif
|
---|
[1413] | 686 | endef # def_keyword_ordering
|
---|
[1936] | 687 | $(eval-opt-var def_keyword_ordering)
|
---|
[1410] | 688 |
|
---|
[1413] | 689 | # Look for keywords which extends others and their parents, and from this
|
---|
| 690 | # construct two lists.
|
---|
| 691 | _KEYWORDS_ORDERED :=
|
---|
| 692 | _KEYWORDS_EXTENDS :=
|
---|
| 693 | _KEYWORDS_PREFIX :=
|
---|
[1410] | 694 |
|
---|
| 695 | prefix := BLD_TYPE
|
---|
| 696 | valid := $(KBUILD_BLD_TYPES)
|
---|
[1496] | 697 | $(foreach keyword, $(_BLD_TYPES) , $(evalval def_keyword_ordering))
|
---|
[1410] | 698 |
|
---|
[1413] | 699 | prefix := BLD_TRG
|
---|
| 700 | valid := $(KBUILD_OSES)
|
---|
[1496] | 701 | $(foreach keyword, $(_BLD_TARGETS), $(evalval def_keyword_ordering))
|
---|
[1413] | 702 |
|
---|
[1410] | 703 | prefix := BLD_ARCH
|
---|
| 704 | valid := $(KBUILD_ARCHES)
|
---|
[1496] | 705 | $(foreach keyword, $(_BLD_ARCHES) , $(evalval def_keyword_ordering))
|
---|
[1410] | 706 |
|
---|
| 707 | prefix := BLD_CPU
|
---|
| 708 | valid := $(KBUILD_CPUS)
|
---|
[1496] | 709 | $(foreach keyword, $(_BLD_CPUS) , $(evalval def_keyword_ordering))
|
---|
[1410] | 710 |
|
---|
[1413] | 711 | ## @todo Inherit bld_trg.bld_arch for too?
|
---|
[1410] | 712 |
|
---|
[1413] | 713 | # Construct all the possible keywords.
|
---|
| 714 | _KEYWORDS := $(_KEYWORDS_ORDERED) $(_KEYWORDS_EXTENDS) \
|
---|
| 715 | $(foreach bld_trg,$(_BLD_TARGETS),$(addprefix $(bld_trg).,$(_BLD_ARCHES)))
|
---|
| 716 |
|
---|
[988] | 717 | ifdef KBUILD_PROFILE_SELF
|
---|
[2008] | 718 | $(evalcall def_profile_self, done keywords)
|
---|
[988] | 719 | endif
|
---|
[552] | 720 |
|
---|
[988] | 721 |
|
---|
[985] | 722 | #
|
---|
| 723 | # Target inheritance.
|
---|
| 724 | #
|
---|
| 725 | # This has to be done on a per target list basis as to avoid adding
|
---|
| 726 | # incorrect properties that will wast memory, time, and may confuse
|
---|
| 727 | # later strictness checks. This also has to be done *before* templates
|
---|
| 728 | # are applied to the targets. Since we're doing that part rather
|
---|
| 729 | # early on, the target inheritance feature is a bit restricted at
|
---|
| 730 | # the moment. However, this will be addressed in a little(?) while.
|
---|
| 731 | #
|
---|
[552] | 732 |
|
---|
[985] | 733 | src_prefix :=
|
---|
[1414] | 734 | load_function :=
|
---|
[1407] | 735 | properties_deferred_l :=
|
---|
| 736 | properties_deferred_r :=
|
---|
| 737 |
|
---|
[985] | 738 | # Fetches.
|
---|
[1413] | 739 | properties := $(PROPS_FETCHES_SINGLE)
|
---|
| 740 | properties_now_l := $(PROPS_FETCHES_ACCUMULATE_L)
|
---|
| 741 | properties_now_r := $(PROPS_FETCHES_ACCUMULATE_R)
|
---|
| 742 | properties_deferred := $(PROPS_FETCHES_DEFERRED)
|
---|
[1496] | 743 | $(foreach trg, $(_ALL_FETCHES),$(evalval def_inherit))
|
---|
[412] | 744 |
|
---|
[985] | 745 | ## Patches. - not implemented yet.
|
---|
[1413] | 746 | #properties := $(PROPS_PATCHES_SINGLE)
|
---|
| 747 | #properties_now_l := $(PROPS_PATCHES_ACCUMULATE_L)
|
---|
| 748 | #properties_now_r := $(PROPS_PATCHES_ACCUMULATE_R)
|
---|
| 749 | #properties_deferred := $(PROPS_PATCHES_DEFERRED)
|
---|
[1496] | 750 | #$(foreach trg, $(_ALL_PATCHES),$(evalval def_inherit))
|
---|
[412] | 751 |
|
---|
[985] | 752 | # Programs and build programs.
|
---|
[1413] | 753 | properties := $(PROPS_PROGRAMS_SINGLE)
|
---|
| 754 | properties_now_l := $(PROPS_PROGRAMS_ACCUMULATE_L)
|
---|
| 755 | properties_now_r := $(PROPS_PROGRAMS_ACCUMULATE_R)
|
---|
| 756 | properties_deferred := $(PROPS_PROGRAMS_DEFERRED)
|
---|
[1496] | 757 | $(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(evalval def_inherit))
|
---|
[985] | 758 |
|
---|
| 759 | # Libraries and import libraries.
|
---|
[1413] | 760 | properties := $(PROPS_LIBRARIES_SINGLE)
|
---|
| 761 | properties_now_l := $(PROPS_LIBRARIES_ACCUMULATE_L)
|
---|
| 762 | properties_now_r := $(PROPS_LIBRARIES_ACCUMULATE_R)
|
---|
| 763 | properties_deferred := $(PROPS_LIBRARIES_DEFERRED)
|
---|
[1504] | 764 | if1of ($(KBUILD_TARGET), nt os2 win)
|
---|
[1496] | 765 | $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(evalval def_inherit))
|
---|
[989] | 766 | else
|
---|
[1496] | 767 | $(foreach trg, $(_ALL_LIBRARIES),$(evalval def_inherit))
|
---|
[989] | 768 | endif
|
---|
[985] | 769 |
|
---|
| 770 | # DLLs.
|
---|
[1413] | 771 | properties := $(PROPS_DLLS_SINGLE)
|
---|
| 772 | properties_now_l := $(PROPS_DLLS_ACCUMULATE_L)
|
---|
| 773 | properties_now_r := $(PROPS_DLLS_ACCUMULATE_R)
|
---|
| 774 | properties_deferred := $(PROPS_DLLS_DEFERRED)
|
---|
[1504] | 775 | if1of ($(KBUILD_TARGET), nt os2 win)
|
---|
[1496] | 776 | $(foreach trg, $(_ALL_DLLS),$(evalval def_inherit))
|
---|
[989] | 777 | else
|
---|
[1496] | 778 | $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(evalval def_inherit))
|
---|
[989] | 779 | endif
|
---|
[985] | 780 |
|
---|
[989] | 781 | # System modules.
|
---|
[1413] | 782 | properties := $(PROPS_SYSMODS_SINGLE)
|
---|
| 783 | properties_now_l := $(PROPS_SYSMODS_ACCUMULATE_L)
|
---|
| 784 | properties_now_r := $(PROPS_SYSMODS_ACCUMULATE_R)
|
---|
| 785 | properties_deferred := $(PROPS_SYSMODS_DEFERRED)
|
---|
[1496] | 786 | $(foreach trg, $(_ALL_SYSMODS),$(evalval def_inherit))
|
---|
[989] | 787 |
|
---|
[2084] | 788 | # Misc binaries.
|
---|
| 789 | properties := $(PROPS_MISCBINS_SINGLE)
|
---|
| 790 | properties_now_l := $(PROPS_MISCBINS_ACCUMULATE_L)
|
---|
| 791 | properties_now_r := $(PROPS_MISCBINS_ACCUMULATE_R)
|
---|
| 792 | properties_deferred := $(PROPS_MISCBINS_DEFERRED)
|
---|
| 793 | $(foreach trg, $(_ALL_MISCBINS),$(evalval def_inherit))
|
---|
| 794 |
|
---|
[985] | 795 | # Installs.
|
---|
[1413] | 796 | properties := $(PROPS_INSTALLS_SINGLE)
|
---|
| 797 | properties_now_l := $(PROPS_INSTALLS_ACCUMULATE_L)
|
---|
| 798 | properties_now_r := $(PROPS_INSTALLS_ACCUMULATE_R)
|
---|
| 799 | properties_deferred := $(PROPS_INSTALLS_DEFERRED)
|
---|
[1496] | 800 | $(foreach trg, $(_ALL_INSTALLS),$(evalval def_inherit))
|
---|
[985] | 801 |
|
---|
[988] | 802 | ifdef KBUILD_PROFILE_SELF
|
---|
[2008] | 803 | $(evalcall def_profile_self, done target inheritance)
|
---|
[988] | 804 | endif
|
---|
[985] | 805 |
|
---|
[988] | 806 |
|
---|
[412] | 807 | #
|
---|
[985] | 808 | # Template Inheritance.
|
---|
| 809 | #
|
---|
| 810 | # This is much the same as with target inheritance, except we cannot
|
---|
[1370] | 811 | # restrict the properties involved since we haven't got a clue which
|
---|
| 812 | # target platforms/archs are using them. But, we can drop the instance
|
---|
| 813 | # expansion we're doing for targets since there won't be any more
|
---|
| 814 | # changes to either the source nor the target templates beyond this
|
---|
| 815 | # exercise.
|
---|
[985] | 816 | #
|
---|
| 817 |
|
---|
| 818 | src_prefix := TEMPLATE_
|
---|
[1417] | 819 | load_function := def_templates_load_function
|
---|
[985] | 820 | properties :=
|
---|
[1407] | 821 | properties_now_l :=
|
---|
| 822 | properties_now_r :=
|
---|
[1413] | 823 | properties_deferred := $(PROPS_SINGLE) $(PROPS_DEFERRED)
|
---|
| 824 | properties_deferred_l := $(PROPS_ACCUMULATE_L)
|
---|
| 825 | properties_deferred_r := $(PROPS_ACCUMULATE_R)
|
---|
[1496] | 826 | $(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(evalval def_inherit))
|
---|
[985] | 827 |
|
---|
[1407] | 828 | # done inheriting.
|
---|
| 829 | src_prefix :=
|
---|
[1414] | 830 | load_function :=
|
---|
[1407] | 831 | properties :=
|
---|
| 832 | properties_now_l :=
|
---|
| 833 | properties_now_r :=
|
---|
| 834 | properties_deferred :=
|
---|
| 835 | properties_deferred_l :=
|
---|
| 836 | properties_deferred_r :=
|
---|
| 837 |
|
---|
[1414] | 838 | ifdef KBUILD_PROFILE_SELF
|
---|
[2008] | 839 | $(evalcall def_profile_self, done template inheritance)
|
---|
[1414] | 840 | endif
|
---|
[1407] | 841 |
|
---|
[1414] | 842 |
|
---|
| 843 |
|
---|
| 844 |
|
---|
[985] | 845 | #
|
---|
[1399] | 846 | # Template/Target Expansion.
|
---|
[72] | 847 | #
|
---|
[1399] | 848 | # Extend all targets with the values from the template. Doing this up front
|
---|
| 849 | # allows more generic code and less mess down in the pass 2 target handling.
|
---|
| 850 | # However it does eat a good deal of memory.
|
---|
| 851 | #
|
---|
[72] | 852 |
|
---|
[2429] | 853 | define def_inherit_template_workaround_target
|
---|
| 854 | local _tmpl := $(firstword $($(target)_TEMPLATE) $(TEMPLATE))
|
---|
[2432] | 855 | local _bld_type := $(firstword $($(target)_BLD_TYPE) $(TEMPLATE_$(_tmpl)_BLD_TYPE) $(KBUILD_TYPE))
|
---|
| 856 | local _bld_trg := $(firstword $($(target)_BLD_TRG) $(TEMPLATE_$(_tmpl)_BLD_TRG) $(KBUILD_TARGET))
|
---|
| 857 | local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(TEMPLATE_$(_tmpl)_BLD_TRG_ARCH) $(KBUILD_TARGET_ARCH))
|
---|
| 858 | local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(TEMPLATE_$(_tmpl)_BLD_TRG_CPU) $(KBUILD_TARGET_CPU))
|
---|
[2429] | 859 | $(kb-exp-tmpl 1,$(target),$(_bld_trg),$(_bld_trg_arch),$(_bld_trg_cpu),$(_bld_type))
|
---|
| 860 | endef # def_inherit_template_workaround_target
|
---|
| 861 | #$(kb-exp-tmpl 1,$(_ALL_TARGET_TARGETS),$(KBUILD_TARGET),$(KBUILD_TARGET_ARCH),$(KBUILD_TARGET_CPU),$(KBUILD_TYPE))
|
---|
| 862 | $(foreach target,$(_ALL_TARGET_TARGETS),$(evalval def_inherit_template_workaround_target))
|
---|
[2011] | 863 |
|
---|
[2429] | 864 | define def_inherit_template_workaround_host
|
---|
| 865 | local _tmpl := $(firstword $($(target)_TEMPLATE) $(TEMPLATE))
|
---|
[2432] | 866 | local _bld_type := $(firstword $($(target)_BLD_TYPE) $(TEMPLATE_$(_tmpl)_BLD_TYPE) $(KBUILD_TYPE))
|
---|
| 867 | local _bld_trg := $(firstword $($(target)_BLD_TRG) $(TEMPLATE_$(_tmpl)_BLD_TRG) $(KBUILD_HOST))
|
---|
| 868 | local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(TEMPLATE_$(_tmpl)_BLD_TRG_ARCH) $(KBUILD_HOST_ARCH))
|
---|
| 869 | local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(TEMPLATE_$(_tmpl)_BLD_TRG_CPU) $(KBUILD_HOST_CPU))
|
---|
[2429] | 870 | $(kb-exp-tmpl 1,$(target),$(_bld_trg),$(_bld_trg_arch),$(_bld_trg_cpu),$(_bld_type))
|
---|
| 871 | endef # def_inherit_template_workaround_target
|
---|
| 872 | #$(kb-exp-tmpl 1,$(_ALL_HOST_TARGETS),$(KBUILD_HOST),$(KBUILD_HOST_ARCH),$(KBUILD_HOST_CPU),$(KBUILD_TYPE))
|
---|
| 873 | $(foreach target,$(_ALL_HOST_TARGETS),$(evalval def_inherit_template_workaround_host))
|
---|
[2011] | 874 |
|
---|
[988] | 875 | ifdef KBUILD_PROFILE_SELF
|
---|
[2008] | 876 | $(evalcall def_profile_self, done template/target expansion)
|
---|
[988] | 877 | endif
|
---|
[447] | 878 |
|
---|
[988] | 879 |
|
---|
[72] | 880 | #
|
---|
[1621] | 881 | # Include tools, sdks and units.
|
---|
[183] | 882 | #
|
---|
[985] | 883 | # The first part of this exercise is to figure out which TOOLS and SDKS
|
---|
| 884 | # that should be included.
|
---|
| 885 | #
|
---|
[1504] | 886 | _TOOLS := $(TOOL.$(KBUILD_TARGET)) $(TOOL.$(KBUILD_TARGET_ARCH)) $(TOOL.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
| 887 | $(TOOL.$(KBUILD_HOST)) $(TOOL.$(KBUILD_HOST_ARCH)) $(TOOL.$(KBUILD_HOST).$(KBUILD_HOST_ARCH)) \
|
---|
[592] | 888 | $(TOOL)
|
---|
[1504] | 889 | _SDKS := $(SDKS.$(KBUILD_TARGET)) $(SDKS.$(KBUILD_TARGET_ARCH)) $(SDKS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
| 890 | $(SDKS.$(KBUILD_HOST)) $(SDKS.$(KBUILD_HOST_ARCH)) $(SDKS.$(KBUILD_HOST).$(KBUILD_HOST_ARCH)) \
|
---|
| 891 | $(SDKS.$(KBUILD_TYPE)) \
|
---|
[592] | 892 | $(SDKS)
|
---|
[1621] | 893 | _USES := $(USES.$(KBUILD_TARGET)) $(USES.$(KBUILD_TARGET_ARCH)) $(USES.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) \
|
---|
| 894 | $(USES.$(KBUILD_HOST)) $(USES.$(KBUILD_HOST_ARCH)) $(USES.$(KBUILD_HOST).$(KBUILD_HOST_ARCH)) \
|
---|
| 895 | $(USES.$(KBUILD_TYPE)) \
|
---|
| 896 | $(USES)
|
---|
[460] | 897 | define def_tools_sdks_target_source
|
---|
[353] | 898 | $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \
|
---|
[460] | 899 | $($(source)_$(prop).$(_bld_trg)) \
|
---|
| 900 | $($(target)_$(source)_$(prop).$(_bld_trg)) \
|
---|
[481] | 901 | $($(source)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 902 | $($(target)_$(source)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 903 | $($(source)_$(prop).$(_bld_trg_arch)) \
|
---|
| 904 | $($(target)_$(source)_$(prop).$(_bld_trg_arch)) \
|
---|
[353] | 905 | $($(source)_$(prop)) \
|
---|
| 906 | $($(target)_$(source)_$(prop))))
|
---|
[460] | 907 | $(eval _SDKS += \
|
---|
| 908 | $($(source)_SDKS.$(_bld_trg)) \
|
---|
| 909 | $($(target)_$(source)_SDKS.$(_bld_trg)) \
|
---|
[481] | 910 | $($(source)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 911 | $($(target)_$(source)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 912 | $($(source)_SDKS.$(_bld_trg_arch)) \
|
---|
| 913 | $($(target)_$(source)_SDKS.$(_bld_trg_arch)) \
|
---|
[1504] | 914 | $($(source)_SDKS.$(KBUILD_TYPE)) \
|
---|
| 915 | $($(target)_$(source)_SDKS.$(KBUILD_TYPE)) \
|
---|
[460] | 916 | $($(source)_SDKS) \
|
---|
| 917 | $($(target)_$(source)_SDKS))
|
---|
[1621] | 918 | $(eval _USES += \
|
---|
| 919 | $($(source)_USES.$(_bld_trg)) \
|
---|
| 920 | $($(target)_$(source)_USES.$(_bld_trg)) \
|
---|
| 921 | $($(source)_USES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 922 | $($(target)_$(source)_USES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 923 | $($(source)_USES.$(_bld_trg_arch)) \
|
---|
| 924 | $($(target)_$(source)_USES.$(_bld_trg_arch)) \
|
---|
| 925 | $($(source)_USES.$(KBUILD_TYPE)) \
|
---|
| 926 | $($(target)_$(source)_USES.$(KBUILD_TYPE)) \
|
---|
| 927 | $($(source)_USES) \
|
---|
| 928 | $($(target)_$(source)_USES))
|
---|
[985] | 929 | endef # def_tools_sdks_target_source
|
---|
[1936] | 930 | $(eval-opt-var def_tools_sdks_target_source)
|
---|
[353] | 931 |
|
---|
[460] | 932 | define def_tools_sdks_target
|
---|
[1504] | 933 | local _bld_type := $(firstword $($(target)_BLD_TYPE) $(KBUILD_TYPE))
|
---|
[1496] | 934 | local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
|
---|
| 935 | local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
|
---|
| 936 | local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
|
---|
[460] | 937 |
|
---|
[353] | 938 | $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \
|
---|
[460] | 939 | $($(target)_$(prop).$(_bld_trg)) \
|
---|
| 940 | $($(target)_$(prop).$(_bld_trg_arch)) \
|
---|
[481] | 941 | $($(target)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[353] | 942 | $($(target)_$(prop))))
|
---|
[460] | 943 | $(eval _SDKS += \
|
---|
| 944 | $($(target)_SDKS.$(_bld_trg)) \
|
---|
| 945 | $($(target)_SDKS.$(_bld_trg_arch)) \
|
---|
[481] | 946 | $($(target)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 947 | $($(target)_SDKS))
|
---|
[1621] | 948 | $(eval _USES += \
|
---|
| 949 | $($(target)_USES.$(_bld_trg)) \
|
---|
| 950 | $($(target)_USES.$(_bld_trg_arch)) \
|
---|
| 951 | $($(target)_USES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 952 | $($(target)_USES))
|
---|
[353] | 953 | $(foreach source, \
|
---|
[460] | 954 | $($(target)_SOURCES.$(_bld_trg)) \
|
---|
| 955 | $($(target)_SOURCES.$(_bld_trg_arch)) \
|
---|
[481] | 956 | $($(target)_SOURCES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 957 | $($(target)_SOURCES.$(_bld_trg_cpu)) \
|
---|
[985] | 958 | $($(target)_SOURCES.$(_bld_type)) \
|
---|
[353] | 959 | $($(target)_SOURCES) \
|
---|
[1496] | 960 | , $(evalval def_tools_sdks_target_source))
|
---|
[985] | 961 | endef # def_tools_sdks_target
|
---|
[1936] | 962 | $(eval-opt-var def_tools_sdks_target)
|
---|
[353] | 963 |
|
---|
[640] | 964 | define def_tools_srcname_target
|
---|
[1504] | 965 | local _bld_type := $(firstword $($(target)_BLD_TYPE) $(KBUILD_TYPE))
|
---|
[1496] | 966 | local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
|
---|
| 967 | local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
|
---|
| 968 | local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
|
---|
[640] | 969 |
|
---|
| 970 | $(foreach source, $(notdir\
|
---|
| 971 | $($(target)_SOURCES.$(_bld_trg)) \
|
---|
| 972 | $($(target)_SOURCES.$(_bld_trg_arch)) \
|
---|
| 973 | $($(target)_SOURCES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 974 | $($(target)_SOURCES.$(_bld_trg_cpu)) \
|
---|
[985] | 975 | $($(target)_SOURCES.$(_bld_type)) \
|
---|
[640] | 976 | $($(target)_SOURCES) \
|
---|
[1496] | 977 | ), $(evalval def_tools_sdks_target_source))
|
---|
[985] | 978 | endef # def_tools_srcname_target
|
---|
[1936] | 979 | $(eval-opt-var def_tools_srcname_target)
|
---|
[640] | 980 |
|
---|
[1504] | 981 | bld_trg := $(KBUILD_TARGET)
|
---|
| 982 | bld_trg_arch := $(KBUILD_TARGET_ARCH)
|
---|
| 983 | bld_trg_cpu := $(KBUILD_TARGET_CPU)
|
---|
| 984 | $(foreach target, $(_ALL_TARGET_TARGETS), $(evalval def_tools_sdks_target))
|
---|
[1496] | 985 | $(foreach target, $(_ALL_SRCNAME_TARGETS), $(evalval def_tools_srcname_target))
|
---|
[72] | 986 |
|
---|
[1504] | 987 | bld_trg := $(KBUILD_HOST)
|
---|
| 988 | bld_trg_arch := $(KBUILD_HOST_ARCH)
|
---|
| 989 | bld_trg_cpu := $(KBUILD_HOST_CPU)
|
---|
| 990 | $(foreach target, $(_ALL_HOST_TARGETS), $(evalval def_tools_sdks_target))
|
---|
[460] | 991 |
|
---|
[1414] | 992 | _TOOLS := $(sort $(_TOOLS))
|
---|
| 993 | _SDKS := $(sort $(_SDKS))
|
---|
[460] | 994 |
|
---|
[1414] | 995 | ## Tool load function.
|
---|
| 996 | # @param loading The tool name
|
---|
| 997 | define def_tools_load_function
|
---|
| 998 | ifndef TOOL_$(loading)
|
---|
[1504] | 999 | TOOL_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_TOOL_PATHS) $(KBUILD_PATH)/tools $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
|
---|
[1414] | 1000 | ifeq ($(TOOL_$(loading)_KMK_FILE),)
|
---|
[1504] | 1001 | $(error kBuild: Cannot find include file for the tool '$(loading)'! Searched: $(KBUILD_TOOL_PATHS) $(KBUILD_PATH)/tools $(KBUILD_DEFAULT_PATHS))
|
---|
[985] | 1002 | endif
|
---|
[1414] | 1003 | include $(TOOL_$(loading)_KMK_FILE)
|
---|
| 1004 | ifndef TOOL_$(loading)
|
---|
| 1005 | $(warning kBuild: TOOL_$(loading) was not defined by $(TOOL_$(loading)_KMK_FILE)!)
|
---|
[985] | 1006 | endif
|
---|
[72] | 1007 | endif
|
---|
[985] | 1008 | endef # def_tools_include
|
---|
[460] | 1009 |
|
---|
[1414] | 1010 | ## SDK load function.
|
---|
| 1011 | # @param loading The tool name
|
---|
| 1012 | define def_sdk_load_function
|
---|
| 1013 | ifndef SDK_$(loading)
|
---|
[1504] | 1014 | SDK_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_SDK_PATHS) $(KBUILD_PATH)/sdks $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
|
---|
[1414] | 1015 | ifeq ($(SDK_$(loading)_KMK_FILE),)
|
---|
[1504] | 1016 | $(error kBuild: Cannot find include file for the SDK '$(loading)'! Searched: $(KBUILD_SDK_PATHS) $(KBUILD_PATH)/sdks $(KBUILD_DEFAULT_PATHS))
|
---|
[985] | 1017 | endif
|
---|
[1414] | 1018 | include $(SDK_$(loading)_KMK_FILE)
|
---|
| 1019 | ifndef SDK_$(loading)
|
---|
| 1020 | $(warning kBuild: SDK_$(loading) was not defined by $(SDK_$(loading)_KMK_FILE)!)
|
---|
[985] | 1021 | endif
|
---|
[72] | 1022 | endif
|
---|
[1414] | 1023 | endef # def_sdk_load_function
|
---|
[460] | 1024 |
|
---|
[72] | 1025 |
|
---|
[1414] | 1026 | properties :=
|
---|
| 1027 | properties_now_l :=
|
---|
| 1028 | properties_now_r :=
|
---|
| 1029 | properties_deferred := $(PROPS_SINGLE) $(PROPS_DEFERRED)
|
---|
| 1030 | properties_deferred_l := $(PROPS_ACCUMULATE_L)
|
---|
| 1031 | properties_deferred_r := $(PROPS_ACCUMULATE_R)
|
---|
[380] | 1032 |
|
---|
[2274] | 1033 | src_prefix := SDK_
|
---|
| 1034 | load_function := def_sdk_load_function
|
---|
| 1035 | $(foreach trg, $(addprefix SDK_,$(_SDKS)), $(evalval def_inherit))
|
---|
| 1036 |
|
---|
| 1037 | properties_deferred := $(PROPS_SINGLE) $(PROPS_DEFERRED) $(PROPS_TOOLS_ONLY)
|
---|
[1414] | 1038 | src_prefix := TOOL_
|
---|
| 1039 | load_function := def_tools_load_function
|
---|
[1654] | 1040 | $(foreach trg, $(addprefix TOOL_,$(_TOOLS)), $(evalval def_inherit))
|
---|
[1414] | 1041 |
|
---|
| 1042 | # done inheriting.
|
---|
| 1043 | src_prefix :=
|
---|
| 1044 | load_function :=
|
---|
| 1045 | properties :=
|
---|
| 1046 | properties_now_l :=
|
---|
| 1047 | properties_now_r :=
|
---|
| 1048 | properties_deferred :=
|
---|
| 1049 | properties_deferred_l :=
|
---|
| 1050 | properties_deferred_r :=
|
---|
| 1051 |
|
---|
[1621] | 1052 | # No inheriting for the uses, they're just global 'code'.
|
---|
| 1053 | $(foreach loading, $(_USES), $(evalval def_unit_load_function))
|
---|
[1414] | 1054 |
|
---|
[1621] | 1055 |
|
---|
[988] | 1056 | ifdef KBUILD_PROFILE_SELF
|
---|
[2008] | 1057 | $(evalcall def_profile_self, done tools + sdks + units)
|
---|
[988] | 1058 | endif
|
---|
[640] | 1059 |
|
---|