[72] | 1 | # $Id: footer.kmk 1410 2008-03-18 16:00:56Z bird $
|
---|
| 2 | ## @file
|
---|
| 3 | #
|
---|
| 4 | # kBuild - File included at top of makefile.
|
---|
| 5 | #
|
---|
[782] | 6 | # Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
|
---|
[72] | 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
|
---|
[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 | #
|
---|
| 26 |
|
---|
| 27 | ifndef __footer_kmk__
|
---|
| 28 | # start-of-file-content
|
---|
[988] | 29 | ifdef KBUILD_PROFILE_SELF
|
---|
| 30 | _KBUILD_TS_FOOTER_START := $(nanots )
|
---|
| 31 | $(info prof: $(int-sub $(_KBUILD_TS_FOOTER_START), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_FOOTER_START), $(_KBUILD_TS_PREV)) - start of footer.kmk)
|
---|
| 32 | _KBUILD_TS_PREV := $(_KBUILD_TS_FOOTER_START)
|
---|
| 33 | endif
|
---|
[72] | 34 |
|
---|
| 35 | #
|
---|
| 36 | # Variables.
|
---|
[73] | 37 | # (Some of these need initialization before including definitions using them.)
|
---|
[72] | 38 | #
|
---|
| 39 |
|
---|
[985] | 40 | # All targets of each types.
|
---|
| 41 | _ALL_BLDPROGS := $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)) $(BLDPROGS.$(BUILD_PLATFORM_ARCH)) $(BLDPROGS.$(BUILD_PLATFORM_CPU)) $(BLDPROGS.$(BUILD_TYPE))
|
---|
| 42 | _ALL_LIBRARIES := $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(LIBRARIES.$(BUILD_TARGET_ARCH)) $(LIBRARIES.$(BUILD_TARGET_CPU)) $(LIBRARIES.$(BUILD_TYPE))
|
---|
| 43 | _ALL_IMPORT_LIBS := $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(IMPORT_LIBS.$(BUILD_TARGET_ARCH)) $(IMPORT_LIBS.$(BUILD_TARGET_CPU)) $(IMPORT_LIBS.$(BUILD_TYPE))
|
---|
| 44 | _ALL_DLLS := $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(DLLS.$(BUILD_TARGET_ARCH)) $(DLLS.$(BUILD_TARGET_CPU)) $(DLLS.$(BUILD_TYPE))
|
---|
| 45 | _ALL_PROGRAMS := $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(PROGRAMS.$(BUILD_TARGET_ARCH)) $(PROGRAMS.$(BUILD_TARGET_CPU)) $(PROGRAMS.$(BUILD_TYPE))
|
---|
| 46 | _ALL_SYSMODS := $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(SYSMODS.$(BUILD_TARGET_ARCH)) $(SYSMODS.$(BUILD_TARGET_CPU)) $(SYSMODS.$(BUILD_TYPE))
|
---|
| 47 | _ALL_OTHERS := $(OTHERS) $(OTHERS.$(BUILD_TARGET)) $(OTHERS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(OTHERS.$(BUILD_TARGET_ARCH)) $(OTHERS.$(BUILD_TARGET_CPU)) $(OTHERS.$(BUILD_TYPE))
|
---|
| 48 | _ALL_INSTALLS := $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(INSTALLS.$(BUILD_TARGET_ARCH)) $(INSTALLS.$(BUILD_TARGET_CPU)) $(INSTALLS.$(BUILD_TYPE))
|
---|
| 49 | _ALL_FETCHES := $(FETCHES) $(FETCHES.$(BUILD_TARGET)) $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(FETCHES.$(BUILD_TARGET_ARCH)) $(FETCHES.$(BUILD_TARGET_CPU)) $(FETCHES.$(BUILD_TYPE))
|
---|
| 50 | _ALL_PATCHES := $(PATCHES) $(PATCHES.$(BUILD_TARGET)) $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) $(PATCHES.$(BUILD_TARGET_ARCH)) $(PATCHES.$(BUILD_TARGET_CPU)) $(PATCHES.$(BUILD_TYPE))
|
---|
| 51 |
|
---|
[72] | 52 | # all targets.
|
---|
[985] | 53 | _ALL_TARGETS = \
|
---|
| 54 | $(_ALL_FETCHES) \
|
---|
| 55 | $(_ALL_PATCHES) \
|
---|
| 56 | $(_ALL_BLDPROGS) \
|
---|
| 57 | $(_ALL_LIBRARIES) \
|
---|
| 58 | $(_ALL_IMPORT_LIBS) \
|
---|
| 59 | $(_ALL_DLLS) \
|
---|
| 60 | $(_ALL_PROGRAMS) \
|
---|
| 61 | $(_ALL_SYSMODS) \
|
---|
| 62 | $(_ALL_INSTALLS) \
|
---|
| 63 | $(_ALL_OTHERS)
|
---|
[72] | 64 |
|
---|
[447] | 65 | # all $(BUILD_TARGET) targets.
|
---|
[985] | 66 | _ALL_BUILD_TARGET_TARGETS = \
|
---|
| 67 | $(_ALL_FETCHES) \
|
---|
| 68 | $(_ALL_PATCHES) \
|
---|
| 69 | $(_ALL_LIBRARIES) \
|
---|
| 70 | $(_ALL_IMPORT_LIBS) \
|
---|
| 71 | $(_ALL_DLLS) \
|
---|
| 72 | $(_ALL_PROGRAMS) \
|
---|
| 73 | $(_ALL_SYSMODS) \
|
---|
| 74 | $(_ALL_INSTALLS) \
|
---|
| 75 | $(_ALL_OTHERS)
|
---|
[447] | 76 |
|
---|
[985] | 77 | # all $(BUILD_PLATFORM) targets.
|
---|
| 78 | _ALL_BUILD_PLATFORM_TARGETS = \
|
---|
| 79 | $(_ALL_BLDPROGS)
|
---|
[447] | 80 |
|
---|
[640] | 81 | # all targets making use of srcname.
|
---|
[985] | 82 | _ALL_SRCNAME_TARGETS = \
|
---|
| 83 | $(_ALL_FETCHES) \
|
---|
| 84 | $(_ALL_PATCHES)
|
---|
[640] | 85 |
|
---|
[75] | 86 | # dependency files.
|
---|
| 87 | _DEPFILES :=
|
---|
| 88 |
|
---|
[380] | 89 | # included dependency files.
|
---|
| 90 | _DEPFILES_INCLUDED :=
|
---|
| 91 |
|
---|
| 92 |
|
---|
[75] | 93 | # All kind of output files except for _OBJS and _DEPFILES.
|
---|
| 94 | # Compiling or linking definition outputting other things that $@ and any
|
---|
| 95 | # required dependency file must add those output files to this variable.
|
---|
| 96 | _OUT_FILES :=
|
---|
| 97 |
|
---|
[353] | 98 | # Files which only requires cleaning up.
|
---|
| 99 | _CLEAN_FILES :=
|
---|
| 100 |
|
---|
[72] | 101 | # all of a type
|
---|
[219] | 102 | _OBJS :=
|
---|
[640] | 103 | _FETCHES :=
|
---|
| 104 | _DOWNLOADS:=
|
---|
| 105 | _UNPACKS :=
|
---|
| 106 | _PATCHES :=
|
---|
[688] | 107 | _UNFETCHES:=
|
---|
[222] | 108 | _BLDPROGS :=
|
---|
[219] | 109 | _LIBS :=
|
---|
| 110 | _DLLS :=
|
---|
| 111 | _PROGRAMS :=
|
---|
| 112 | _SYSMODS :=
|
---|
[353] | 113 | _INSTALLS :=
|
---|
[827] | 114 | _INSTALLS_FILES :=
|
---|
[380] | 115 | _INSTALLS_DIRS :=
|
---|
[353] | 116 | _OTHERS :=
|
---|
[417] | 117 | _PACKING :=
|
---|
[897] | 118 | _DIRS := $(PATH_TARGET)/ $(PATH_TARGET) $(BLDDIRS)
|
---|
[189] | 119 | _IMPORT_LIBS :=
|
---|
[72] | 120 |
|
---|
[220] | 121 | # misc
|
---|
| 122 | pass_prev :=
|
---|
| 123 |
|
---|
| 124 |
|
---|
[984] | 125 |
|
---|
[72] | 126 | #
|
---|
[984] | 127 | # Footer macros
|
---|
[73] | 128 | #
|
---|
| 129 |
|
---|
[78] | 130 | ## Figure out the tool for a target.
|
---|
[753] | 131 | # @param $1 normalized target.
|
---|
| 132 | # @param $2 tooltype.
|
---|
[222] | 133 | # @param bld_trg build target.
|
---|
[481] | 134 | # @param bld_trg_arch build target architecture.
|
---|
[79] | 135 | _TARGET_TOOL = $(strip $(firstword \
|
---|
[753] | 136 | $($(1)_$(2)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 137 | $($(1)_$(2)TOOL.$(bld_trg)) \
|
---|
| 138 | $($(1)_$(2)TOOL) \
|
---|
| 139 | $($(1)_TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 140 | $($(1)_TOOL.$(bld_trg)) \
|
---|
| 141 | $($(1)_TOOL) \
|
---|
| 142 | $($(2)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 143 | $($(2)TOOL.$(bld_trg)) \
|
---|
| 144 | $($(2)TOOL) \
|
---|
[481] | 145 | $(TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
[222] | 146 | $(TOOL.$(bld_trg)) \
|
---|
[106] | 147 | $(TOOL) \
|
---|
[79] | 148 | ))
|
---|
[183] | 149 |
|
---|
[353] | 150 | ## Figure out the actual name of an installed file.
|
---|
| 151 | # @param $1 The file to install.
|
---|
| 152 | # @param $2 The target name.
|
---|
| 153 | # @param $3 The _INST value (can be empty).
|
---|
| 154 | # @param $4 The default directory to use when $3 is empty.
|
---|
| 155 | _INSTALL_FILE = $(patsubst %/,%/$(notdir $(1)),$(if $(3),$(PATH_INS)/$(3),$(4)/))
|
---|
| 156 |
|
---|
| 157 |
|
---|
[985] | 158 | ## Inherit one template property in a non-accumulative manner.
|
---|
| 159 | # @param $(prop) Property name
|
---|
| 160 | # @param $(src) Source (parent) object.
|
---|
| 161 | # @param $(trg) Target (child) object.
|
---|
| 162 | define def_inherit_one
|
---|
| 163 | ifdef $(src)_$(prop)
|
---|
| 164 | ifndef $(trg)_$(prop)
|
---|
| 165 | $(trg)_$(prop) = $($(src)_$(prop))
|
---|
[1407] | 166 | #$ (warning def_inherit_one: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
[985] | 167 | endif
|
---|
| 168 | endif
|
---|
| 169 | endef # def_inherit_one
|
---|
[723] | 170 |
|
---|
[1407] | 171 |
|
---|
| 172 | # EXPAND_BY = overriding
|
---|
| 173 |
|
---|
[985] | 174 | ## Inherit one template property in a non-accumulative manner.
|
---|
| 175 | # @param $(prop) Property name
|
---|
| 176 | # @param $(src) Source (parent) object.
|
---|
| 177 | # @param $(trg) Target (child) object.
|
---|
[1407] | 178 | define def_inherit_one_overriding_now_l
|
---|
[985] | 179 | ifdef $(src)_$(prop)
|
---|
| 180 | ifndef $(trg)_$(prop)
|
---|
| 181 | $(trg)_$(prop) := $($(src)_$(prop))
|
---|
[1407] | 182 | #$ (warning def_inherit_one_overriding_now_l: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
[985] | 183 | endif
|
---|
| 184 | endif
|
---|
[1407] | 185 | endef # def_inherit_one_overriding_now_l
|
---|
[185] | 186 |
|
---|
[1407] | 187 | ## @copydoc def_inherit_one_overriding_now_l
|
---|
| 188 | define def_inherit_one_overriding_now_r
|
---|
| 189 | ifdef $(src)_$(prop)
|
---|
| 190 | ifndef $(trg)_$(prop)
|
---|
| 191 | $(trg)_$(prop) := $($(src)_$(prop))
|
---|
| 192 | #$ (warning def_inherit_one_overriding_now_r: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
| 193 | endif
|
---|
| 194 | endif
|
---|
| 195 | endef # def_inherit_one_overriding_now_r
|
---|
| 196 |
|
---|
[985] | 197 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 198 | # @param $(prop) Property name
|
---|
| 199 | # @param $(src) Source
|
---|
| 200 | # @param $(trg) Target
|
---|
| 201 | # @remark This define relies on double evaluation
|
---|
[1407] | 202 | define def_inherit_one_overriding_deferred
|
---|
[985] | 203 | ifdef $(src)_$(prop)
|
---|
| 204 | ifndef $(trg)_$(prop)
|
---|
| 205 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
[1407] | 206 | #$ (warning def_inherit_one_overriding_deferred: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
[985] | 207 | endif
|
---|
[185] | 208 | endif
|
---|
[1407] | 209 | endef # def_inherit_one_overriding_deferred
|
---|
[185] | 210 |
|
---|
[1407] | 211 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 212 | define def_inherit_one_overriding_deferred_l
|
---|
| 213 | ifdef $(src)_$(prop)
|
---|
| 214 | ifndef $(trg)_$(prop)
|
---|
| 215 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 216 | #$ (warning def_inherit_one_overriding_deferred_l: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
| 217 | endif
|
---|
| 218 | endif
|
---|
| 219 | endef # def_inherit_one_overriding_deferred_l
|
---|
| 220 |
|
---|
| 221 | ## @copydoc def_inherit_one_overriding_deferred
|
---|
| 222 | define def_inherit_one_overriding_deferred_r
|
---|
| 223 | ifdef $(src)_$(prop)
|
---|
| 224 | ifndef $(trg)_$(prop)
|
---|
| 225 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 226 | #$ (warning def_inherit_one_overriding_deferred_r: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
| 227 | endif
|
---|
| 228 | endif
|
---|
| 229 | endef # def_inherit_one_overriding_deferred_r
|
---|
| 230 |
|
---|
| 231 |
|
---|
| 232 | # EXPAND_BY = prepending
|
---|
| 233 |
|
---|
| 234 | ## Inherit one template property in a prepending manner.
|
---|
| 235 | # @param $(prop) Property name
|
---|
| 236 | # @param $(src) Source (parent) object.
|
---|
| 237 | # @param $(trg) Target (child) object.
|
---|
| 238 | define def_inherit_one_prepending_now_l
|
---|
| 239 | ifdef $(src)_$(prop)
|
---|
| 240 | $(trg)_$(prop) := $(trg)_$(prop) $($(src)_$(prop))
|
---|
| 241 | #$ (warning def_inherit_one_prepending_now_l: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 242 | endif
|
---|
| 243 | endef # def_inherit_one_prepending_now_l
|
---|
| 244 |
|
---|
| 245 | ## @copydoc def_inherit_one_prepending_now_l
|
---|
| 246 | define def_inherit_one_prepending_now_r
|
---|
| 247 | ifdef $(src)_$(prop)
|
---|
| 248 | $(trg)_$(prop) := $($(src)_$(prop)) $(trg)_$(prop)
|
---|
| 249 | #$ (warning def_inherit_one_prepending_now_r: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 250 | endif
|
---|
| 251 | endef # def_inherit_one_prepending_now_r
|
---|
| 252 |
|
---|
| 253 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 254 | # @param $(prop) Property name
|
---|
| 255 | # @param $(src) Source
|
---|
| 256 | # @param $(trg) Target
|
---|
| 257 | # @remark This define relies on double evaluation
|
---|
| 258 | define def_inherit_one_prepending_deferred
|
---|
| 259 | ifdef $(src)_$(prop)
|
---|
| 260 | ifndef $(trg)_$(prop)
|
---|
| 261 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 262 | #$ (warning def_inherit_one_prepending_deferred: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
| 263 | endif
|
---|
| 264 | endif
|
---|
| 265 | endef # def_inherit_one_prepending_deferred
|
---|
| 266 |
|
---|
| 267 | ## Inherit one template property in a prepending manner, deferred expansion.
|
---|
| 268 | # @param $(prop) Property name
|
---|
| 269 | # @param $(src) Source (parent) object.
|
---|
| 270 | # @param $(trg) Target (child) object.
|
---|
| 271 | define def_inherit_one_prepending_deferred_l
|
---|
| 272 | ifdef $(src)_$(prop)
|
---|
| 273 | $(trg)_$(prop) <= $$($(src)_$(prop))
|
---|
| 274 | #$ (warning def_inherit_one_prepending_deferred_l: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 275 | endif
|
---|
| 276 | endef # def_inherit_one_prepending_deferred_l
|
---|
| 277 |
|
---|
| 278 | ## @copydoc def_inherit_one_prepending_deferred_l
|
---|
| 279 | define def_inherit_one_prepending_deferred_r
|
---|
| 280 | ifdef $(src)_$(prop)
|
---|
| 281 | $(trg)_$(prop) += $$($(src)_$(prop))
|
---|
| 282 | #$ (warning def_inherit_one_prepending_deferred_r: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 283 | endif
|
---|
| 284 | endef # def_inherit_one_prepending_deferred_r
|
---|
| 285 |
|
---|
| 286 |
|
---|
| 287 | # EXPAND_BY = appending
|
---|
| 288 |
|
---|
| 289 | ## Inherit one template property in a appending manner.
|
---|
| 290 | # @param $(prop) Property name
|
---|
| 291 | # @param $(src) Source (parent) object.
|
---|
| 292 | # @param $(trg) Target (child) object.
|
---|
| 293 | define def_inherit_one_appending_now_l
|
---|
| 294 | ifdef $(src)_$(prop)
|
---|
| 295 | $(trg)_$(prop) := $($(src)_$(prop)) $(trg)_$(prop)
|
---|
| 296 | #$ (warning def_inherit_one_appending_now_l: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 297 | endif
|
---|
| 298 | endef # def_inherit_one_appending_now_l
|
---|
| 299 |
|
---|
| 300 | ## @copydoc def_inherit_one_appending_now_l
|
---|
| 301 | define def_inherit_one_appending_now_r
|
---|
| 302 | ifdef $(src)_$(prop)
|
---|
| 303 | $(trg)_$(prop) := $(trg)_$(prop) $($(src)_$(prop))
|
---|
| 304 | #$ (warning def_inherit_one_appending_now_r: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 305 | endif
|
---|
| 306 | endef # def_inherit_one_appending_now_r
|
---|
| 307 |
|
---|
| 308 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 309 | # @param $(prop) Property name
|
---|
| 310 | # @param $(src) Source
|
---|
| 311 | # @param $(trg) Target
|
---|
| 312 | # @remark This define relies on double evaluation
|
---|
| 313 | define def_inherit_one_appending_deferred
|
---|
| 314 | ifdef $(src)_$(prop)
|
---|
| 315 | ifndef $(trg)_$(prop)
|
---|
| 316 | $(trg)_$(prop) = $$($(src)_$(prop))
|
---|
| 317 | #$ (warning def_inherit_one_appending_deferred: $(trg)_$(prop) = $($(src)_$(prop)) )
|
---|
| 318 | endif
|
---|
| 319 | endif
|
---|
| 320 | endef # def_inherit_one_appending_deferred
|
---|
| 321 |
|
---|
| 322 | ## Inherit one template property in a appending manner, deferred expansion.
|
---|
| 323 | # @param $(prop) Property name
|
---|
| 324 | # @param $(src) Source (parent) object.
|
---|
| 325 | # @param $(trg) Target (child) object.
|
---|
| 326 | define def_inherit_one_appending_deferred_l
|
---|
| 327 | ifdef $(src)_$(prop)
|
---|
| 328 | $(trg)_$(prop) += $$($(src)_$(prop))
|
---|
| 329 | #$ (warning def_inherit_one_appending_deferred_l: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 330 | endif
|
---|
| 331 | endef # def_inherit_one_appending_deferred_l
|
---|
| 332 |
|
---|
| 333 | ## @copydoc def_inherit_one_appending_deferred_l
|
---|
| 334 | define def_inherit_one_appending_deferred_r
|
---|
| 335 | ifdef $(src)_$(prop)
|
---|
| 336 | $(trg)_$(prop) <= $$($(src)_$(prop))
|
---|
| 337 | #$ (warning def_inherit_one_appending_deferred_r: $(trg)_$(prop) = $($(trg)_$(prop)) )
|
---|
| 338 | endif
|
---|
| 339 | endef # def_inherit_one_appending_deferred_r
|
---|
| 340 |
|
---|
| 341 |
|
---|
| 342 |
|
---|
[985] | 343 | ## Generic inheritance for use with targets templates and tools.
|
---|
[1407] | 344 | # @param trg Object to consider for inheriting.
|
---|
| 345 | # @param src_prefix What to prefix the value found in EXTENDS with to get the object.
|
---|
| 346 | # @param properties List of the properties with straight expansion.
|
---|
| 347 | # @param properties_now_l List of the properties with immediate expansion, accumulating on the left side.
|
---|
| 348 | # @param properties_now_r List of the properties with immediate expansion, accumulating on the right side.
|
---|
| 349 | # @param properties_deferred List of the properties with deferred expansion (e.g. function), non-accumulative .
|
---|
| 350 | # @param properties_deferred_l List of the properties with deferred expansion (e.g. function), accumulating on the left side.
|
---|
| 351 | # @param properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
|
---|
[985] | 352 | define def_inherit
|
---|
| 353 | src := $(strip $($(trg)_EXTENDS))
|
---|
| 354 | ifneq ($(src),)
|
---|
| 355 | ifndef $(trg)_EXTENDS_STATUS_
|
---|
| 356 | $(trg)_EXTENDS_STATUS_ := 0
|
---|
| 357 | src := $(src_prefix)$(src)
|
---|
[185] | 358 |
|
---|
[985] | 359 | # Recursivly process the parent (src) if it's inherting from somebody too.
|
---|
| 360 | ifdef $(src)_EXTENDS
|
---|
| 361 | ifneq ($($(src)_EXTENDS_STATUS_),42)
|
---|
| 362 | # 'foreach' will create 'trg' in a new variable context hiding
|
---|
| 363 | # out current variable. 'src' OTOH will be overwritten.
|
---|
| 364 | #$ (warning def_inherit: recursing into $(src) from $(trg))
|
---|
| 365 | $(foreach trg, $(src), $(eval $(value def_inherit)))
|
---|
| 366 | src := $(src_prefix)$(strip $($(trg)_EXTENDS))
|
---|
| 367 | endif
|
---|
| 368 | endif
|
---|
[984] | 369 |
|
---|
[1407] | 370 | # Get & check EXTENDS_BY.
|
---|
| 371 | by = $(strip $($(trg)_EXTENDS_BY))
|
---|
| 372 | ifeq ($(by),)
|
---|
| 373 | by = overriding
|
---|
| 374 | else ifn1of ($(by), overriding appending prepending)
|
---|
| 375 | $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(trg)'!)
|
---|
| 376 | endif
|
---|
| 377 |
|
---|
| 378 | # Inherit the properties.
|
---|
[985] | 379 | #$ (warning def_inherit: trg=$(trg) src=$(src))
|
---|
[1407] | 380 | $(foreach prop, $(properties), $(eval $(def_inherit_one)))
|
---|
| 381 | $(foreach prop, $(properties_now_l), $(eval $(def_inherit_one_$(by)_now_l)))
|
---|
| 382 | $(foreach prop, $(properties_now_r), $(eval $(def_inherit_one_$(by)_now_r)))
|
---|
| 383 | $(foreach prop, $(properties_deferred), $(eval $(def_inherit_one_$(by)_deferred)))
|
---|
| 384 | $(foreach prop, $(properties_deferred_l), $(eval $(def_inherit_one_$(by)_deferred_l)))
|
---|
| 385 | $(foreach prop, $(properties_deferred_r), $(eval $(def_inherit_one_$(by)_deferred_r)))
|
---|
| 386 |
|
---|
| 387 | # Mark the target as done.
|
---|
[985] | 388 | $(trg)_EXTENDS_STATUS_ := 42
|
---|
| 389 | else
|
---|
| 390 | # Check for inheritance loops.
|
---|
[1266] | 391 | ifneq ($($(trg)_EXTENDS_STATUS_),42)
|
---|
| 392 | $(error kBuild: Target inheritance loop! target=$(trg) $(trg)_EXTENDS_STATUS_=$($(trg)_EXTENDS_STATUS_))
|
---|
[985] | 393 | endif
|
---|
| 394 | endif
|
---|
| 395 | endif
|
---|
| 396 | endef # def_inherit
|
---|
[984] | 397 |
|
---|
[985] | 398 |
|
---|
[1407] | 399 | ##
|
---|
[1399] | 400 | # Function for $(call)'ing.
|
---|
[1407] | 401 | # @param 1 trg Object to consider for inheriting.
|
---|
| 402 | # @param 2 src_prefix What to prefix the value found in EXTENDS with to get the object.
|
---|
| 403 | # @param 3 properties List of the properties with straight expansion.
|
---|
| 404 | # @param 4 properties_now_l List of the properties with immediate expansion, accumulating on the left side.
|
---|
| 405 | # @param 5 properties_now_r List of the properties with immediate expansion, accumulating on the right side.
|
---|
| 406 | # @param 6 properties_deferred List of the properties with deferred expansion (e.g. function), non-accumulative .
|
---|
| 407 | # @param 7 properties_deferred_l List of the properties with deferred expansion (e.g. function), accumulating on the left side.
|
---|
| 408 | # @param 8 properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
|
---|
[1399] | 409 | define fn_inherit
|
---|
[1407] | 410 | src_prefix := $(2)
|
---|
| 411 | properties := $(3)
|
---|
| 412 | properties_now_l := $(4)
|
---|
| 413 | properties_now_r := $(5)
|
---|
| 414 | properties_deferred := $(6)
|
---|
| 415 | properties_deferred_l := $(7)
|
---|
| 416 | properties_deferred_r := $(8)
|
---|
[1399] | 417 | $(foreach trg, $(1),$(eval $(value def_inherit)))
|
---|
| 418 | endef
|
---|
| 419 |
|
---|
| 420 |
|
---|
| 421 |
|
---|
[984] | 422 | #
|
---|
[985] | 423 | # Determin all the templates that is being used and make
|
---|
| 424 | # sure they are present.
|
---|
[72] | 425 | #
|
---|
| 426 | _TEMPLATES := $(TEMPLATE)
|
---|
| 427 | define def_templates
|
---|
| 428 | ifdef $(target)_TEMPLATE
|
---|
[985] | 429 | ifneq ("$($(target)_TEMPLATE)","$(strip $($(target)_TEMPLATE))")
|
---|
| 430 | $$(error kBuild: The template name of target '$(target)' contains tabs ($($(target)_TEMPLATE))). Please remove them)
|
---|
| 431 | endif
|
---|
| 432 | _TEMPLATES += $($(target)_TEMPLATE)
|
---|
[72] | 433 | endif
|
---|
[985] | 434 | endef # def_templates
|
---|
[984] | 435 | $(foreach target, $(_ALL_TARGETS), $(eval $(def_templates)))
|
---|
[72] | 436 | _TEMPLATES := $(sort $(_TEMPLATES))
|
---|
| 437 |
|
---|
| 438 | define def_templates_include
|
---|
| 439 | ifndef TEMPLATE_$(template)
|
---|
[985] | 440 | TEMPLATE_$(template)_INCLUDE_FILE_ := $(firstword $(foreach path, $(TEMPLATE_PATHS) $(PATH_KBUILD)/templates/, $(wildcard $(path)/$(template).kmk)))
|
---|
| 441 | ifneq ($(TEMPLATE_$(template)_INCLUDE_FILE_),)
|
---|
| 442 | include $(TEMPLATE_$(template)_INCLUDE_FILE_)
|
---|
| 443 | else
|
---|
| 444 | $$(error kBuild: Cannot find template '$(template)')
|
---|
| 445 | endif
|
---|
[72] | 446 | endif
|
---|
[985] | 447 | endef # def_templates_include
|
---|
[1370] | 448 | $(foreach template, $(_TEMPLATES), $(eval $(def_templates_include)))
|
---|
[72] | 449 |
|
---|
[985] | 450 | #$ (warning dbg _TEMPLATES := $(_TEMPLATES))
|
---|
[74] | 451 |
|
---|
[985] | 452 |
|
---|
[72] | 453 | #
|
---|
[1410] | 454 | # Determin the BLD_TRG_* and BLD_TYPE keywords required for correct
|
---|
| 455 | # inherting, and then check for inheritance.
|
---|
[412] | 456 | #
|
---|
[985] | 457 | # This means walking all the template and target lists in order to
|
---|
| 458 | # pick up all BLD_TRG_* attributes.
|
---|
| 459 | #
|
---|
| 460 | _BLD_TYPES := $(BUILD_TYPE)
|
---|
| 461 | _BLD_TARGETS := $(BUILD_TARGET) $(BUILD_PLATFORMS)
|
---|
| 462 | _BLD_ARCHES := $(BUILD_TARGET_ARCH) $(BUILD_PLATFORM_ARCH)
|
---|
| 463 | _BLD_CPUS := $(BUILD_TARGET_CPU) $(BUILD_PLATFORM_CPU)
|
---|
| 464 |
|
---|
| 465 | define def_collect_bld_xyz
|
---|
[1410] | 466 | ifdef $(src)_BLD_TYPE
|
---|
| 467 | ifn1of ($($(src)_BLD_TYPE), $(KBUILD_BLD_TYPES))
|
---|
| 468 | $(error kBuild: $(src)_BLD_TYPE=$($(src)_BLD_TYPE) not in KBUILD_BLD_TYPES={$(KBUILD_BLD_TYPES)}!)
|
---|
| 469 | endif
|
---|
[1394] | 470 | _BLD_TYPES += $($(src)_BLD_TYPE)
|
---|
[412] | 471 | endif
|
---|
[1410] | 472 | ifdef $(src)_BLD_TRG
|
---|
| 473 | ifn1of ($($(src)_BLD_TRG), $(KBUILD_OSES))
|
---|
| 474 | $(error kBuild: $(src)_BLD_TRG=$($(src)_BLD_TRG) not in KBUILD_OSES={$(KBUILD_OSES)}!)
|
---|
| 475 | endif
|
---|
[985] | 476 | _BLD_TARGETS += $($(src)_BLD_TRG)
|
---|
| 477 | endif
|
---|
[1410] | 478 | ifdef $(src)_BLD_TRG_ARCH
|
---|
| 479 | ifn1of ($($(src)_BLD_TRG_ARCH), $(KBUILD_ARCHES))
|
---|
| 480 | $(error kBuild: $(src)_BLD_TRG_ARCH=$($(src)_BLD_TRG_ARCH) not in KBUILD_ARCHES={$(KBUILD_ARCHES)}!)
|
---|
| 481 | endif
|
---|
[985] | 482 | _BLD_ARCHES += $($(src)_BLD_TRG_ARCH)
|
---|
| 483 | endif
|
---|
[1410] | 484 | ifdef $(src)_BLD_TRG_CPU
|
---|
| 485 | if1of ($($(src)_BLD_CPU), $(KBUILD_ARCHES) $(KBUILD_OSES) $(KBUILD_BLD_TYPES))
|
---|
| 486 | $(error kBuild: $(src)_BLD_TRG_CPU=$($(src)_BLD_TRG_CPU) found in KBUILD_ARCHES, KBUILD_OSES or KBUILD_BLD_TYPES!)
|
---|
| 487 | endif
|
---|
[1394] | 488 | _BLD_CPUS += $($(src)_BLD_TRG_CPU)
|
---|
[985] | 489 | endif
|
---|
| 490 | endef # def_collect_bld_xyz
|
---|
[1410] | 491 | $(foreach src, $(addprefix TEMPLATE_, $(_TEMPLATES)) $(_ALL_TARGETS) \
|
---|
| 492 | ,$(eval $(value def_collect_bld_xyz)))
|
---|
[412] | 493 |
|
---|
[1410] | 494 | # Drop duplicate values.
|
---|
[985] | 495 | _BLD_TYPES := $(sort $(_BLD_TYPES))
|
---|
| 496 | _BLD_TARGETS := $(sort $(_BLD_TARGETS))
|
---|
| 497 | _BLD_ARCHES := $(sort $(_BLD_ARCHES))
|
---|
| 498 | _BLD_CPUS := $(sort $(_BLD_CPUS))
|
---|
[552] | 499 |
|
---|
[985] | 500 | # Construct all the possible keywords.
|
---|
| 501 | _KEYWORDS := $(_BLD_TYPES) $(_BLD_TARGETS) $(_BLD_ARCHES) $(_BLD_CPUS) \
|
---|
| 502 | $(foreach bld_trg,$(_BLD_TARGETS),$(addprefix $(bld_trg).,$(_BLD_ARCHES)))
|
---|
[412] | 503 |
|
---|
[1410] | 504 | # Look for keywords which extends others and order them.
|
---|
| 505 | _KEYWORDS_ORDERED :=
|
---|
| 506 | define def_keyword_ordering
|
---|
| 507 | src := $(strip $($(prefix)_$(keyword)_EXTENDS))
|
---|
| 508 | ifneq ($(src),)
|
---|
| 509 | ifndef $(prefix)_$(keyword)_EXTENDS_STATUS_
|
---|
| 510 | $(prefix)_$(keyword)_EXTENDS_STATUS_ := 0
|
---|
| 511 |
|
---|
| 512 | # Validate src.
|
---|
| 513 | ifn1of ($(src), $(valid))
|
---|
| 514 | $(error kBuild: $(keyword) tries to extend unknown keyword '$(src)'! (known = $(valid)))
|
---|
| 515 | endif
|
---|
| 516 |
|
---|
| 517 | # Recursivly process the parent (src) if it's inherting from somebody too.
|
---|
| 518 | # If it isn't, then we'll have to add it to the ordered keyword list here.
|
---|
| 519 | ifneq ($($(prefix)_$(src)_EXTENDS_STATUS_),42)
|
---|
| 520 | ifneq ($($(prefix)_$(src)_EXTENDS_STATUS_),)
|
---|
| 521 | $(error kBuild: Keyword inheritance loop! keyword=$(src) $(prefix)_$(src)_EXTENDS_STATUS_=$($(prefix)_$(src)_EXTENDS_STATUS_))
|
---|
| 522 | endif
|
---|
| 523 | ifdef $(prefix)_$(src)_EXTENDS
|
---|
| 524 | # 'foreach' will create 'keyword' in a new variable context hiding
|
---|
| 525 | # out current variable. 'src' OTOH will be overwritten.
|
---|
| 526 | $(foreach keyword, $(src), $(eval $(value def_keyword_ordering)))
|
---|
| 527 | src := $(strip $($(keyword)_EXTENDS))
|
---|
| 528 | else
|
---|
| 529 | # Add it to the list and mark it as done.
|
---|
| 530 | _KEYWORDS_ORDERED += $(src)
|
---|
| 531 | $(prefix)_$(src)_EXTENDS_STATUS_ := 42
|
---|
| 532 | endif
|
---|
| 533 | endif
|
---|
| 534 |
|
---|
| 535 | # Check EXTENDS_BY.
|
---|
| 536 | by = $(strip $($(trg)_EXTENDS_BY))
|
---|
| 537 | ifeq ($(by),)
|
---|
| 538 | by = overriding
|
---|
| 539 | else ifn1of ($(by), overriding appending prepending)
|
---|
| 540 | $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(keyword)'!)
|
---|
| 541 | endif
|
---|
| 542 |
|
---|
| 543 | # Add it to the list and mark it as done.
|
---|
| 544 | _KEYWORDS_ORDERED += $(keyword)
|
---|
| 545 | $(prefix)_$(keyword)_EXTENDS_STATUS_ := 42
|
---|
| 546 | else
|
---|
| 547 | # Check for inheritance loops.
|
---|
| 548 | ifneq ($($(trg)_EXTENDS_STATUS_),42)
|
---|
| 549 | $(error kBuild: Keyword inheritance loop! keyword=$(keyword) $(prefix)_$(keyword)_EXTENDS_STATUS_=$($(prefix)_$(keyword)_EXTENDS_STATUS_))
|
---|
| 550 | endif
|
---|
| 551 | endif
|
---|
| 552 | endif
|
---|
| 553 |
|
---|
| 554 | endef
|
---|
| 555 |
|
---|
| 556 | prefix := BLD_TYPE
|
---|
| 557 | valid := $(KBUILD_BLD_TYPES)
|
---|
| 558 | $(foreach keyword, $(_BLD_TYPES) , $(eval $(value def_keyword_ordering)))
|
---|
| 559 |
|
---|
| 560 | prefix := BLD_ARCH
|
---|
| 561 | valid := $(KBUILD_ARCHES)
|
---|
| 562 | $(foreach keyword, $(_BLD_ARCHES), $(eval $(value def_keyword_ordering)))
|
---|
| 563 |
|
---|
| 564 | prefix := BLD_CPU
|
---|
| 565 | valid := $(KBUILD_CPUS)
|
---|
| 566 | $(foreach keyword, $(_BLD_CPUS) , $(eval $(value def_keyword_ordering)))
|
---|
| 567 |
|
---|
| 568 | # Update _KEYWORDS to the ordered list making sure parent keywords are included too.
|
---|
| 569 | _KEYWORDS := $(_KEYWORDS_ORDERED) $(filter-out $(_KEYWORDS_ORDERED), $(_KEYWORDS))
|
---|
| 570 |
|
---|
[988] | 571 | ifdef KBUILD_PROFILE_SELF
|
---|
| 572 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 573 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done keywords)
|
---|
| 574 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 575 | endif
|
---|
[552] | 576 |
|
---|
[988] | 577 |
|
---|
[985] | 578 | #
|
---|
| 579 | # Target inheritance.
|
---|
| 580 | #
|
---|
| 581 | # This has to be done on a per target list basis as to avoid adding
|
---|
| 582 | # incorrect properties that will wast memory, time, and may confuse
|
---|
| 583 | # later strictness checks. This also has to be done *before* templates
|
---|
| 584 | # are applied to the targets. Since we're doing that part rather
|
---|
| 585 | # early on, the target inheritance feature is a bit restricted at
|
---|
| 586 | # the moment. However, this will be addressed in a little(?) while.
|
---|
| 587 | #
|
---|
[552] | 588 |
|
---|
[985] | 589 | src_prefix :=
|
---|
[1407] | 590 | properties_deferred_l :=
|
---|
| 591 | properties_deferred_r :=
|
---|
| 592 |
|
---|
[985] | 593 | ## combines the specified properties $(1) with the $(_KEYWORDS).
|
---|
| 594 | _COMB_KEY_PROP = $(1) $(foreach keyword,$(_KEYWORDS), $(addsuffix .$(keyword), $(1)))
|
---|
[412] | 595 |
|
---|
[985] | 596 | # Fetches.
|
---|
| 597 | properties := $(call _COMB_KEY_PROP,$(PROPS_FETCHES_SINGLE))
|
---|
[1407] | 598 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_FETCHES_ACCUMULATE_L))
|
---|
| 599 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_FETCHES_ACCUMULATE_R))
|
---|
[985] | 600 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_FETCHES_DEFERRED))
|
---|
| 601 | $(foreach trg, $(_ALL_FETCHES),$(eval $(value def_inherit)))
|
---|
[412] | 602 |
|
---|
[985] | 603 | ## Patches. - not implemented yet.
|
---|
| 604 | #properties := $(call _COMB_KEY_PROP,$(PROPS_PATCHES_SINGLE))
|
---|
[1407] | 605 | #properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_PATCHES_ACCUMULATE_L))
|
---|
| 606 | #properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_PATCHES_ACCUMULATE_R))
|
---|
[985] | 607 | #properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_PATCHES_DEFERRED))
|
---|
| 608 | #$(foreach trg, $(_ALL_PATCHES),$(eval $(value def_inherit)))
|
---|
[412] | 609 |
|
---|
[985] | 610 | # Programs and build programs.
|
---|
| 611 | properties := $(call _COMB_KEY_PROP,$(PROPS_PROGRAMS_SINGLE))
|
---|
[1407] | 612 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_PROGRAMS_ACCUMULATE_L))
|
---|
| 613 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_PROGRAMS_ACCUMULATE_R))
|
---|
[985] | 614 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_PROGRAMS_DEFERRED))
|
---|
| 615 | $(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(eval $(value def_inherit)))
|
---|
| 616 |
|
---|
| 617 | # Libraries and import libraries.
|
---|
| 618 | properties := $(call _COMB_KEY_PROP,$(PROPS_LIBRARIES_SINGLE))
|
---|
[1407] | 619 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_LIBRARIES_ACCUMULATE_L))
|
---|
| 620 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_LIBRARIES_ACCUMULATE_R))
|
---|
[985] | 621 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_LIBRARIES_DEFERRED))
|
---|
[1407] | 622 | if1of ($(BUILD_TARGET), nt os2 win)
|
---|
[989] | 623 | $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))
|
---|
| 624 | else
|
---|
| 625 | $(foreach trg, $(_ALL_LIBRARIES),$(eval $(value def_inherit)))
|
---|
| 626 | endif
|
---|
[985] | 627 |
|
---|
| 628 | # DLLs.
|
---|
| 629 | properties := $(call _COMB_KEY_PROP,$(PROPS_DLLS_SINGLE))
|
---|
[1407] | 630 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_DLLS_ACCUMULATE_L))
|
---|
| 631 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_DLLS_ACCUMULATE_R))
|
---|
[985] | 632 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_DLLS_DEFERRED))
|
---|
[1407] | 633 | if1of ($(BUILD_TARGET), nt os2 win)
|
---|
[989] | 634 | $(foreach trg, $(_ALL_DLLS),$(eval $(value def_inherit)))
|
---|
| 635 | else
|
---|
| 636 | $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))
|
---|
| 637 | endif
|
---|
[985] | 638 |
|
---|
[989] | 639 | # System modules.
|
---|
| 640 | properties := $(call _COMB_KEY_PROP,$(PROPS_SYSMODS_SINGLE))
|
---|
[1407] | 641 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_SYSMODS_ACCUMULATE_L))
|
---|
| 642 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_SYSMODS_ACCUMULATE_R))
|
---|
[989] | 643 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_SYSMODS_DEFERRED))
|
---|
| 644 | $(foreach trg, $(_ALL_SYSMODS),$(eval $(value def_inherit)))
|
---|
| 645 |
|
---|
[985] | 646 | # Installs.
|
---|
| 647 | properties := $(call _COMB_KEY_PROP,$(PROPS_INSTALLS_SINGLE))
|
---|
[1407] | 648 | properties_now_l := $(call _COMB_KEY_PROP,$(PROPS_INSTALLS_ACCUMULATE_L))
|
---|
| 649 | properties_now_r := $(call _COMB_KEY_PROP,$(PROPS_INSTALLS_ACCUMULATE_R))
|
---|
[985] | 650 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_INSTALLS_DEFERRED))
|
---|
| 651 | $(foreach trg, $(_ALL_INSTALLS),$(eval $(value def_inherit)))
|
---|
| 652 |
|
---|
[988] | 653 | ifdef KBUILD_PROFILE_SELF
|
---|
| 654 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 655 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done target inheritance)
|
---|
| 656 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 657 | endif
|
---|
[985] | 658 |
|
---|
[988] | 659 |
|
---|
[412] | 660 | #
|
---|
[985] | 661 | # Template Inheritance.
|
---|
| 662 | #
|
---|
| 663 | # This is much the same as with target inheritance, except we cannot
|
---|
[1370] | 664 | # restrict the properties involved since we haven't got a clue which
|
---|
| 665 | # target platforms/archs are using them. But, we can drop the instance
|
---|
| 666 | # expansion we're doing for targets since there won't be any more
|
---|
| 667 | # changes to either the source nor the target templates beyond this
|
---|
| 668 | # exercise.
|
---|
[985] | 669 | #
|
---|
| 670 |
|
---|
| 671 | src_prefix := TEMPLATE_
|
---|
| 672 | properties :=
|
---|
[1407] | 673 | properties_now_l :=
|
---|
| 674 | properties_now_r :=
|
---|
| 675 | properties_deferred := $(call _COMB_KEY_PROP,$(PROPS_SINGLE) $(PROPS_DEFERRED))
|
---|
| 676 | properties_deferred_l := $(call _COMB_KEY_PROP,$(PROPS_ACCUMULATE_L))
|
---|
| 677 | properties_deferred_r := $(call _COMB_KEY_PROP,$(PROPS_ACCUMULATE_R))
|
---|
[985] | 678 | $(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(eval $(value def_inherit)))
|
---|
| 679 |
|
---|
[988] | 680 | ifdef KBUILD_PROFILE_SELF
|
---|
| 681 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 682 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done template inheritance)
|
---|
| 683 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 684 | endif
|
---|
[985] | 685 |
|
---|
[988] | 686 |
|
---|
[1407] | 687 | # done inheriting.
|
---|
| 688 | src_prefix :=
|
---|
| 689 | properties :=
|
---|
| 690 | properties_now_l :=
|
---|
| 691 | properties_now_r :=
|
---|
| 692 | properties_deferred :=
|
---|
| 693 | properties_deferred_l :=
|
---|
| 694 | properties_deferred_r :=
|
---|
| 695 |
|
---|
| 696 |
|
---|
[985] | 697 | #
|
---|
[1399] | 698 | # Template/Target Expansion.
|
---|
[72] | 699 | #
|
---|
[1399] | 700 | # Extend all targets with the values from the template. Doing this up front
|
---|
| 701 | # allows more generic code and less mess down in the pass 2 target handling.
|
---|
| 702 | # However it does eat a good deal of memory.
|
---|
| 703 | #
|
---|
[72] | 704 |
|
---|
[353] | 705 | ## Inherit one template property in a non-accumulative manner.
|
---|
[72] | 706 | # @param $(prop) Property name
|
---|
| 707 | # @param $(target) Target name
|
---|
[78] | 708 | # @todo fix the precedence order for some properties.
|
---|
[72] | 709 | define def_inherit_template_one
|
---|
[78] | 710 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
|
---|
[72] | 711 | ifndef $(target)_$(prop)
|
---|
[353] | 712 | $(target)_$(prop) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
| 713 | #$ (warning dbgtarget: $(target)_$(prop):='$(value $(target)_$(prop))' TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
[72] | 714 | endif
|
---|
| 715 | endif
|
---|
[447] | 716 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
|
---|
| 717 | ifndef $(target)_$(prop).$(bld_trg)
|
---|
| 718 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
| 719 | $(target)_$(prop).$(bld_trg) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
[79] | 720 | endif
|
---|
| 721 | endif
|
---|
[481] | 722 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
| 723 | ifndef $(target)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
| 724 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg).$(bld_trg_arch)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
| 725 | $(target)_$(prop).$(bld_trg).$(bld_trg_arch) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
| 726 | endif
|
---|
| 727 | endif
|
---|
[455] | 728 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)
|
---|
| 729 | ifndef $(target)_$(prop).$(bld_trg_arch)
|
---|
| 730 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg_arch)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
| 731 | $(target)_$(prop).$(bld_trg_arch) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
| 732 | endif
|
---|
| 733 | endif
|
---|
| 734 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)
|
---|
| 735 | ifndef $(target)_$(prop).$(bld_trg_cpu)
|
---|
| 736 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg_cpu)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
| 737 | $(target)_$(prop).$(bld_trg_cpu) := $(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
| 738 | endif
|
---|
| 739 | endif
|
---|
[72] | 740 | endef
|
---|
| 741 |
|
---|
[353] | 742 | ## Inherit one template property in a non-accumulative manner, deferred expansion.
|
---|
| 743 | # @param 1: $(prop) Property name
|
---|
| 744 | # @param 2: $(target) Target name
|
---|
| 745 | # @todo fix the precedence order for some properties.
|
---|
| 746 | # @remark this define relies on double evaluation
|
---|
| 747 | define def_inherit_template_one_deferred
|
---|
| 748 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
|
---|
| 749 | ifndef $(target)_$(prop)
|
---|
| 750 | $(target)_$(prop) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
| 751 | #$ (warning dbgtarget: $(target)_$(prop):='$(value $(target)_$(prop))' TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
| 752 | endif
|
---|
| 753 | endif
|
---|
[447] | 754 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
|
---|
| 755 | ifndef $(target)_$(prop).$(bld_trg)
|
---|
| 756 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
| 757 | $(target)_$(prop).$(bld_trg) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
[353] | 758 | endif
|
---|
| 759 | endif
|
---|
[481] | 760 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
| 761 | ifndef $(target)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
| 762 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg).$(bld_trg_arch)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
| 763 | $(target)_$(prop).$(bld_trg).$(bld_trg_arch) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
| 764 | endif
|
---|
| 765 | endif
|
---|
[455] | 766 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)
|
---|
| 767 | ifndef $(target)_$(prop).$(bld_trg_arch)
|
---|
| 768 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg_arch)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
| 769 | $(target)_$(prop).$(bld_trg_arch) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
| 770 | endif
|
---|
| 771 | endif
|
---|
| 772 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)
|
---|
| 773 | ifndef $(target)_$(prop).$(bld_trg_cpu)
|
---|
| 774 | #$ (warning dbgsource: $(target)_$(prop).$(bld_trg_cpu)="TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)" TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
| 775 | $(target)_$(prop).$(bld_trg_cpu) = $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
| 776 | endif
|
---|
| 777 | endif
|
---|
[353] | 778 | endef
|
---|
| 779 |
|
---|
[660] | 780 | ## Inherit one acculumlative template property where the 'most significant' items are at the left end.
|
---|
[78] | 781 | # @param $(prop) Property name
|
---|
| 782 | # @param $(target) Target name
|
---|
[660] | 783 | define def_inherit_template_one_accumulate_l
|
---|
[78] | 784 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
|
---|
[353] | 785 | #$ (warning dbgtype: TEMPLATE_$($(target)_TEMPLATE)_$(prop) $(target)_$(prop)=$($(target)_$(prop)) $(TEMPLATE_$($(target)_TEMPLATE)_$(prop)))
|
---|
[659] | 786 | $(target)_$(prop) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
[442] | 787 | #$ (warning dbgtype: $(target)_$(prop)=$($(target)_$(prop)))
|
---|
[78] | 788 | endif
|
---|
[243] | 789 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE)
|
---|
[353] | 790 | #$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE))
|
---|
[659] | 791 | $(target)_$(prop).$(BUILD_TYPE) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE))
|
---|
[243] | 792 | endif
|
---|
[447] | 793 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
|
---|
[659] | 794 | #$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
| 795 | $(target)_$(prop).$(bld_trg) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
[79] | 796 | endif
|
---|
[481] | 797 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
| 798 | #$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
[659] | 799 | $(target)_$(prop).$(bld_trg).$(bld_trg_arch) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
[481] | 800 | endif
|
---|
[447] | 801 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)
|
---|
| 802 | #$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
[659] | 803 | $(target)_$(prop).$(bld_trg_cpu) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
[79] | 804 | endif
|
---|
[447] | 805 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)
|
---|
| 806 | #$ (warning dbg6: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
[659] | 807 | $(target)_$(prop).$(bld_trg_arch) += $$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
[79] | 808 | endif
|
---|
[78] | 809 | endef
|
---|
| 810 |
|
---|
[660] | 811 | ## Inherit one acculumlative template property where the 'most significant' items are at the right end.
|
---|
| 812 | # @param $(prop) Property name
|
---|
| 813 | # @param $(target) Target name
|
---|
[981] | 814 | define def_inherit_template_one_accumulate_r
|
---|
[660] | 815 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop)
|
---|
[981] | 816 | #$ (warning dbgtype: TEMPLATE_$($(target)_TEMPLATE)_$(prop) $(target)_$(prop)=$($(target)_$(prop)) $(TEMPLATE_$($(target)_TEMPLATE)_$(prop)))
|
---|
| 817 | $(target)_$(prop) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop))
|
---|
| 818 | #$ (warning dbgtype: $(target)_$(prop)=$($(target)_$(prop)))
|
---|
[660] | 819 | endif
|
---|
| 820 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE)
|
---|
[981] | 821 | #$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE))
|
---|
| 822 | $(target)_$(prop).$(BUILD_TYPE) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(BUILD_TYPE))
|
---|
[660] | 823 | endif
|
---|
| 824 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg)
|
---|
[981] | 825 | #$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
| 826 | $(target)_$(prop).$(bld_trg) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg))
|
---|
[660] | 827 | endif
|
---|
| 828 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch)
|
---|
[981] | 829 | #$ (warning dbg4: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
| 830 | $(target)_$(prop).$(bld_trg).$(bld_trg_arch) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg).$(bld_trg_arch))
|
---|
[660] | 831 | endif
|
---|
| 832 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu)
|
---|
[981] | 833 | #$ (warning dbg5: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
| 834 | $(target)_$(prop).$(bld_trg_cpu) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_cpu))
|
---|
[660] | 835 | endif
|
---|
| 836 | ifdef TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch)
|
---|
[981] | 837 | #$ (warning dbg6: TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
| 838 | $(target)_$(prop).$(bld_trg_arch) <=$$(TEMPLATE_$($(target)_TEMPLATE)_$(prop).$(bld_trg_arch))
|
---|
[660] | 839 | endif
|
---|
| 840 | endef
|
---|
| 841 |
|
---|
| 842 |
|
---|
[72] | 843 | ## Inherit template properties for on target.
|
---|
| 844 | # @param $(target) Target name.
|
---|
| 845 | define def_inherit_template
|
---|
[745] | 846 | # sanity check.
|
---|
| 847 | ifdef _$(target)_ALREADY_PROCESSED
|
---|
| 848 | $(error kBuild: The target $(target) appears more than once in the target lists! Please correct the makefile(s))
|
---|
| 849 | endif
|
---|
| 850 | _$(target)_ALREADY_PROCESSED := 1
|
---|
| 851 |
|
---|
[447] | 852 | # Inherit any default template.
|
---|
| 853 | ifdef TEMPLATE
|
---|
| 854 | ifeq ($($(target)_TEMPLATE),)
|
---|
| 855 | $(eval $(target)_TEMPLATE:=$(TEMPLATE))
|
---|
| 856 | endif
|
---|
| 857 | endif
|
---|
| 858 | # Expand the template if specified.
|
---|
| 859 | ifneq ($($(target)_TEMPLATE),)
|
---|
[353] | 860 | $(foreach prop,$(PROPS_SINGLE),$(eval $(value def_inherit_template_one)))
|
---|
| 861 | $(foreach prop,$(PROPS_DEFERRED),$(eval $(def_inherit_template_one_deferred))) # exploits the 2 evaluation, so no value!
|
---|
[981] | 862 | $(foreach prop,$(PROPS_ACCUMULATE_L),$(eval $(def_inherit_template_one_accumulate_l))) # += works fine without value
|
---|
| 863 | $(foreach prop,$(PROPS_ACCUMULATE_R),$(eval $(def_inherit_template_one_accumulate_r))) # use <= (kmk addition)
|
---|
[447] | 864 | endif
|
---|
[72] | 865 | endef
|
---|
[353] | 866 |
|
---|
[72] | 867 | # Inherit template properties
|
---|
[447] | 868 | bld_trg := $(BUILD_TARGET)
|
---|
| 869 | bld_trg_arch := $(BUILD_TARGET_ARCH)
|
---|
| 870 | bld_trg_cpu := $(BUILD_TARGET_CPU)
|
---|
| 871 | $(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(eval $(value def_inherit_template)))
|
---|
[72] | 872 |
|
---|
[447] | 873 | bld_trg := $(BUILD_PLATFORM)
|
---|
| 874 | bld_trg_arch := $(BUILD_PLATFORM_ARCH)
|
---|
| 875 | bld_trg_cpu := $(BUILD_PLATFORM_CPU)
|
---|
| 876 | $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(eval $(value def_inherit_template)))
|
---|
[72] | 877 |
|
---|
[988] | 878 | ifdef KBUILD_PROFILE_SELF
|
---|
| 879 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 880 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done common inheritance)
|
---|
| 881 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 882 | endif
|
---|
[447] | 883 |
|
---|
[988] | 884 |
|
---|
[72] | 885 | #
|
---|
[460] | 886 | # Include tools & sdks
|
---|
[183] | 887 | #
|
---|
[985] | 888 | # The first part of this exercise is to figure out which TOOLS and SDKS
|
---|
| 889 | # that should be included.
|
---|
| 890 | #
|
---|
[592] | 891 | _TOOLS := $(TOOL.$(BUILD_TARGET)) $(TOOL.$(BUILD_TARGET_ARCH)) $(TOOL.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
|
---|
| 892 | $(TOOL.$(BUILD_PLATFORM)) $(TOOL.$(BUILD_PLATFORM_ARCH)) $(TOOL.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)) \
|
---|
| 893 | $(TOOL)
|
---|
| 894 | _SDKS := $(SDKS.$(BUILD_TARGET)) $(SDKS.$(BUILD_TARGET_ARCH)) $(SDKS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \
|
---|
| 895 | $(SDKS.$(BUILD_PLATFORM)) $(SDKS.$(BUILD_PLATFORM_ARCH)) $(SDKS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)) \
|
---|
| 896 | $(SDKS.$(BUILD_TYPE)) \
|
---|
| 897 | $(SDKS)
|
---|
[460] | 898 | define def_tools_sdks_target_source
|
---|
[353] | 899 | $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \
|
---|
[460] | 900 | $($(source)_$(prop).$(_bld_trg)) \
|
---|
| 901 | $($(target)_$(source)_$(prop).$(_bld_trg)) \
|
---|
[481] | 902 | $($(source)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 903 | $($(target)_$(source)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 904 | $($(source)_$(prop).$(_bld_trg_arch)) \
|
---|
| 905 | $($(target)_$(source)_$(prop).$(_bld_trg_arch)) \
|
---|
[353] | 906 | $($(source)_$(prop)) \
|
---|
| 907 | $($(target)_$(source)_$(prop))))
|
---|
[460] | 908 | $(eval _SDKS += \
|
---|
| 909 | $($(source)_SDKS.$(_bld_trg)) \
|
---|
| 910 | $($(target)_$(source)_SDKS.$(_bld_trg)) \
|
---|
[481] | 911 | $($(source)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 912 | $($(target)_$(source)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 913 | $($(source)_SDKS.$(_bld_trg_arch)) \
|
---|
| 914 | $($(target)_$(source)_SDKS.$(_bld_trg_arch)) \
|
---|
[592] | 915 | $($(source)_SDKS.$(BUILD_TYPE)) \
|
---|
| 916 | $($(target)_$(source)_SDKS.$(BUILD_TYPE)) \
|
---|
[460] | 917 | $($(source)_SDKS) \
|
---|
| 918 | $($(target)_$(source)_SDKS))
|
---|
[985] | 919 | endef # def_tools_sdks_target_source
|
---|
[353] | 920 |
|
---|
[460] | 921 | define def_tools_sdks_target
|
---|
[985] | 922 | _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
[460] | 923 | _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
|
---|
| 924 | _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
|
---|
| 925 | _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
|
---|
| 926 |
|
---|
[353] | 927 | $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \
|
---|
[460] | 928 | $($(target)_$(prop).$(_bld_trg)) \
|
---|
| 929 | $($(target)_$(prop).$(_bld_trg_arch)) \
|
---|
[481] | 930 | $($(target)_$(prop).$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[353] | 931 | $($(target)_$(prop))))
|
---|
[460] | 932 | $(eval _SDKS += \
|
---|
| 933 | $($(target)_SDKS.$(_bld_trg)) \
|
---|
| 934 | $($(target)_SDKS.$(_bld_trg_arch)) \
|
---|
[481] | 935 | $($(target)_SDKS.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 936 | $($(target)_SDKS))
|
---|
[353] | 937 | $(foreach source, \
|
---|
[460] | 938 | $($(target)_SOURCES.$(_bld_trg)) \
|
---|
| 939 | $($(target)_SOURCES.$(_bld_trg_arch)) \
|
---|
[481] | 940 | $($(target)_SOURCES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
[460] | 941 | $($(target)_SOURCES.$(_bld_trg_cpu)) \
|
---|
[985] | 942 | $($(target)_SOURCES.$(_bld_type)) \
|
---|
[353] | 943 | $($(target)_SOURCES) \
|
---|
[460] | 944 | , $(eval $(value def_tools_sdks_target_source)))
|
---|
[985] | 945 | endef # def_tools_sdks_target
|
---|
[353] | 946 |
|
---|
[640] | 947 | define def_tools_srcname_target
|
---|
[985] | 948 | _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
[640] | 949 | _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
|
---|
| 950 | _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
|
---|
| 951 | _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
|
---|
| 952 |
|
---|
| 953 | $(foreach source, $(notdir\
|
---|
| 954 | $($(target)_SOURCES.$(_bld_trg)) \
|
---|
| 955 | $($(target)_SOURCES.$(_bld_trg_arch)) \
|
---|
| 956 | $($(target)_SOURCES.$(_bld_trg).$(_bld_trg_arch)) \
|
---|
| 957 | $($(target)_SOURCES.$(_bld_trg_cpu)) \
|
---|
[985] | 958 | $($(target)_SOURCES.$(_bld_type)) \
|
---|
[640] | 959 | $($(target)_SOURCES) \
|
---|
| 960 | ), $(eval $(value def_tools_sdks_target_source)))
|
---|
[985] | 961 | endef # def_tools_srcname_target
|
---|
[640] | 962 |
|
---|
[460] | 963 | bld_trg := $(BUILD_TARGET)
|
---|
| 964 | bld_trg_arch := $(BUILD_TARGET_ARCH)
|
---|
| 965 | bld_trg_cpu := $(BUILD_TARGET_CPU)
|
---|
| 966 | $(foreach target, $(_ALL_BUILD_TARGET_TARGETS), $(eval $(value def_tools_sdks_target)))
|
---|
[640] | 967 | $(foreach target, $(_ALL_SRCNAME_TARGETS), $(eval $(value def_tools_srcname_target)))
|
---|
[72] | 968 |
|
---|
[460] | 969 | bld_trg := $(BUILD_PLATFORM)
|
---|
| 970 | bld_trg_arch := $(BUILD_PLATFORM_ARCH)
|
---|
| 971 | bld_trg_cpu := $(BUILD_PLATFORM_CPU)
|
---|
| 972 | $(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(eval $(value def_tools_sdks_target)))
|
---|
| 973 |
|
---|
| 974 |
|
---|
| 975 | # include TOOLS
|
---|
[72] | 976 | define def_tools_include
|
---|
| 977 | ifndef TOOL_$(tool)
|
---|
[985] | 978 | TOOL_$(tool)_KMK_FILE := $(firstword $(foreach path, $(TOOL_PATHS) $(PATH_KBUILD)/tools, $(wildcard $(path)/$(tool).kmk)))
|
---|
| 979 | ifeq ($(TOOL_$(tool)_KMK_FILE),)
|
---|
| 980 | $(error kBuild: Cannot find include file for the tool '$(tool)'! Searched: $(TOOL_PATHS) $(PATH_KBUILD)/tools)
|
---|
| 981 | endif
|
---|
| 982 | include $(TOOL_$(tool)_KMK_FILE)
|
---|
| 983 | ifndef TOOL_$(tool)
|
---|
| 984 | $(warning kBuild: TOOL_$(tool) was not by $(TOOL_$(tool)_KMK_FILE)!)
|
---|
| 985 | endif
|
---|
[72] | 986 | endif
|
---|
[985] | 987 | endef # def_tools_include
|
---|
[460] | 988 |
|
---|
| 989 | _TOOLS := $(sort $(_TOOLS))
|
---|
[353] | 990 | $(foreach tool, $(_TOOLS), $(eval $(value def_tools_include)))
|
---|
[72] | 991 |
|
---|
[1399] | 992 | ## @todo TOOL_X_EXTENDS
|
---|
[72] | 993 |
|
---|
[1399] | 994 |
|
---|
[460] | 995 | # include SDKS
|
---|
[122] | 996 | define def_sdks_include_one
|
---|
[72] | 997 | ifndef SDK_$(sdk)
|
---|
[985] | 998 | SDK_$(sdk)_KMK_FILE := $(firstword $(foreach path, $(SDK_PATHS) $(PATH_KBUILD)/sdks, $(wildcard $(path)/$(sdk).kmk)))
|
---|
| 999 | ifeq ($(SDK_$(sdk)_KMK_FILE),)
|
---|
| 1000 | $(error kBuild: Cannot find include file for the SDK '$(sdk)'! Searched: $(SDK_PATHS) $(PATH_KBUILD)/sdks)
|
---|
| 1001 | endif
|
---|
| 1002 | include $(SDK_$(sdk)_KMK_FILE)
|
---|
| 1003 | ifndef SDK_$(sdk)
|
---|
| 1004 | $(warning kBuild: SDK_$(sdk) was not defined by $(SDK_$(sdk)_KMK_FILE)!)
|
---|
| 1005 | endif
|
---|
[72] | 1006 | endif
|
---|
[985] | 1007 | endef # def_sdks_include_one
|
---|
[460] | 1008 |
|
---|
[859] | 1009 | _SDKS := $(sort $(_SDKS))
|
---|
[353] | 1010 | $(foreach sdk, $(_SDKS), $(eval $(value def_sdks_include_one)))
|
---|
[72] | 1011 |
|
---|
[985] | 1012 | ## @todo Execute SDKS and TOOL inhertiance.
|
---|
[380] | 1013 |
|
---|
[988] | 1014 | ifdef KBUILD_PROFILE_SELF
|
---|
| 1015 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 1016 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done tools and sdks)
|
---|
| 1017 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 1018 | endif
|
---|
[640] | 1019 |
|
---|
[1399] | 1020 | ## @todo SDK_X_EXTENDS
|
---|
[988] | 1021 |
|
---|
[828] | 1022 | #
|
---|
| 1023 | #
|
---|
| 1024 | # Target lists - Pass 1
|
---|
| 1025 | #
|
---|
| 1026 | # This pass is for defining variables that might be referenced in
|
---|
| 1027 | # properties of other targets.
|
---|
| 1028 | #
|
---|
| 1029 | #
|
---|
| 1030 |
|
---|
| 1031 | # Don't do anything for fetch targets (yet).
|
---|
| 1032 |
|
---|
| 1033 | ##
|
---|
| 1034 | # Link prolog for Pass 1.
|
---|
| 1035 | #
|
---|
| 1036 | # @param $(target) Normalized target name.
|
---|
| 1037 | # @param $(EXT) EXE,DLL,SYS,LIB.
|
---|
| 1038 | # @param $(EXTPRE) HOST or nothing.
|
---|
| 1039 | # @param $(definst) The default _INST value.
|
---|
| 1040 | # @param $(tool_prefix) LD or AR.
|
---|
| 1041 | # @param $(bld_trg_base_var) TARGET or PLATFORM.
|
---|
| 1042 | define def_pass1_link_common
|
---|
| 1043 |
|
---|
| 1044 | bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
| 1045 | bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var)))
|
---|
| 1046 | bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
|
---|
| 1047 | bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU))
|
---|
| 1048 |
|
---|
[889] | 1049 | tool := $(call _TARGET_TOOL,$(target),$(tool_prefix))
|
---|
| 1050 | name := $(firstword\
|
---|
| 1051 | $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
|
---|
| 1052 | $($(target)_NAME.$(bld_trg_arch))\
|
---|
| 1053 | $($(target)_NAME.$(bld_trg))\
|
---|
| 1054 | $($(target)_NAME.$(bld_type))\
|
---|
| 1055 | $($(target)_NAME)\
|
---|
| 1056 | $(target))
|
---|
| 1057 | outbase := $(call TARGET_BASE,$(name),$(target))
|
---|
[828] | 1058 | ifndef PATH_$(target)
|
---|
| 1059 | PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
|
---|
| 1060 | else ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
|
---|
| 1061 | $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase))))
|
---|
| 1062 | endif
|
---|
| 1063 | ifeq ($(tool_prefix),AR) ## @todo fix this mess!
|
---|
| 1064 | suff := $(firstword\
|
---|
| 1065 | $($(target)_$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\
|
---|
| 1066 | $($(target)_$(EXT)SUFF.$(bld_trg))\
|
---|
| 1067 | $($(target)_$(EXT)SUFF)\
|
---|
| 1068 | $(TOOL_$(tool)_$(tool_prefix)$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\
|
---|
| 1069 | $(TOOL_$(tool)_$(tool_prefix)$(EXT)SUFF.$(bld_trg))\
|
---|
| 1070 | $(TOOL_$(tool)_$(tool_prefix)$(EXT)SUFF)\
|
---|
| 1071 | $(SUFF_LIB))
|
---|
| 1072 | else
|
---|
| 1073 | suff := $(firstword \
|
---|
| 1074 | $($(target)_$(EXT)SUFF) \
|
---|
| 1075 | $($(target)_$(EXT)SUFF) \
|
---|
| 1076 | $(TOOL_$(tool)_$(tool_prefix)$(EXT)SUFF) \
|
---|
| 1077 | $($(EXTPRE)SUFF_$(EXT)))
|
---|
| 1078 | endif
|
---|
| 1079 | out := $(outbase)$(suff)
|
---|
| 1080 |
|
---|
| 1081 | # TARGET_*
|
---|
| 1082 | TARGET_$(target) := $(out)
|
---|
| 1083 |
|
---|
| 1084 | # INSTARGET_*
|
---|
| 1085 | ifndef $(target)_NOINST
|
---|
| 1086 | INSTARGET_$(target) := $(patsubst %/,%/$(notdir $(out)), \
|
---|
| 1087 | $(if $($(target)_INST), $(addprefix $(PATH_INS)/,$($(target)_INST)), $(definst)/))
|
---|
| 1088 |
|
---|
| 1089 | else # NOINST
|
---|
| 1090 | INSTARGET_$(target) :=
|
---|
| 1091 | endif # NOINST
|
---|
| 1092 |
|
---|
| 1093 | endef
|
---|
| 1094 |
|
---|
| 1095 |
|
---|
| 1096 | #
|
---|
| 1097 | # BLDPROGS (Pass 1)
|
---|
| 1098 | #
|
---|
| 1099 | define def_pass1_bldprog
|
---|
| 1100 | # set NOINST if not forced installation before doing the usual stuff.
|
---|
| 1101 | ifndef $(target)_INST
|
---|
| 1102 | $(target)_NOINST := 1
|
---|
| 1103 | endif
|
---|
| 1104 | $(eval $(value def_pass1_link_common))
|
---|
| 1105 | endef
|
---|
| 1106 |
|
---|
| 1107 | EXT := EXE
|
---|
| 1108 | EXTPRE := HOST
|
---|
| 1109 | definst := $(PATH_BIN)
|
---|
| 1110 | tool_prefix := LD
|
---|
| 1111 | bld_trg_base_var := PLATFORM
|
---|
| 1112 | $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), \
|
---|
| 1113 | $(eval $(value def_pass1_bldprog)))
|
---|
| 1114 |
|
---|
| 1115 |
|
---|
| 1116 | #
|
---|
| 1117 | # LIBRARIES (Pass 1)
|
---|
| 1118 | #
|
---|
| 1119 | EXT := LIB
|
---|
| 1120 | EXTPRE :=
|
---|
| 1121 | definst := $(PATH_LIB)
|
---|
| 1122 | tool_prefix := AR
|
---|
| 1123 | bld_trg_base_var := TARGET
|
---|
| 1124 | $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1125 | $(eval $(value def_pass1_link_common)))
|
---|
| 1126 |
|
---|
| 1127 |
|
---|
| 1128 | #
|
---|
| 1129 | # DLLS (Pass 1)
|
---|
| 1130 | #
|
---|
| 1131 | EXT := DLL
|
---|
| 1132 | EXTPRE :=
|
---|
| 1133 | definst := $(PATH_DLL)
|
---|
| 1134 | tool_prefix := LD
|
---|
| 1135 | bld_trg_base_var := TARGET
|
---|
| 1136 | $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1137 | $(eval $(value def_pass1_link_common)))
|
---|
| 1138 |
|
---|
| 1139 |
|
---|
| 1140 | #
|
---|
| 1141 | # IMPORT LIBRARIES (Pass 1)
|
---|
| 1142 | #
|
---|
| 1143 | # - On OS/2 and windows these are libraries.
|
---|
| 1144 | # - On other platforms they are fake DLLs.
|
---|
| 1145 | #
|
---|
[1260] | 1146 | if1of ($(BUILD_TARGET), nt os2 win win64 win32)
|
---|
[828] | 1147 | EXT := LIB
|
---|
| 1148 | EXTPRE :=
|
---|
| 1149 | definst := $(PATH_LIB)
|
---|
| 1150 | tool_prefix := AR
|
---|
| 1151 | bld_trg_base_var := TARGET
|
---|
| 1152 | $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
[1260] | 1153 | $(eval $(value def_pass1_link_common)))
|
---|
[828] | 1154 | else
|
---|
| 1155 | EXT := DLL
|
---|
| 1156 | EXTPRE :=
|
---|
| 1157 | definst := $(PATH_DLL)
|
---|
| 1158 | tool_prefix := LD
|
---|
| 1159 | bld_trg_base_var := TARGET
|
---|
| 1160 | $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1161 | $(eval $(value def_pass1_link_common)))
|
---|
| 1162 | endif
|
---|
| 1163 |
|
---|
| 1164 |
|
---|
| 1165 | #
|
---|
| 1166 | # PROGRAMS (Pass 1)
|
---|
| 1167 | #
|
---|
| 1168 | EXT := EXE
|
---|
| 1169 | EXTPRE :=
|
---|
| 1170 | definst := $(PATH_BIN)
|
---|
| 1171 | tool_prefix := LD
|
---|
| 1172 | bld_trg_base_var := TARGET
|
---|
| 1173 | $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1174 | $(eval $(value def_pass1_link_common)))
|
---|
| 1175 |
|
---|
| 1176 |
|
---|
| 1177 | #
|
---|
| 1178 | # SYSMODS (Pass 1)
|
---|
| 1179 | #
|
---|
| 1180 | EXT := SYS
|
---|
| 1181 | EXTPRE :=
|
---|
| 1182 | definst := $(PATH_SYS)
|
---|
| 1183 | tool_prefix := LD
|
---|
| 1184 | bld_trg_base_var := TARGET
|
---|
| 1185 | $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1186 | $(eval $(value def_pass1_link_common)))
|
---|
| 1187 |
|
---|
| 1188 |
|
---|
| 1189 | #
|
---|
| 1190 | # INSTALLS (Pass 1)
|
---|
| 1191 | # Note! INSTARGET_* for INSTALLS aren't available until later.
|
---|
| 1192 | #
|
---|
| 1193 | define def_pass1_install
|
---|
[985] | 1194 | bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
| 1195 | bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))
|
---|
[828] | 1196 | bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
|
---|
| 1197 | bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))
|
---|
| 1198 | # TARGET_*
|
---|
| 1199 | TARGET_$(target) := $(PATH_TARGET)/$(target).ins
|
---|
| 1200 | # INSTARGET_ later.
|
---|
| 1201 | endef
|
---|
| 1202 | $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1203 | $(eval $(value def_pass1_install)))
|
---|
| 1204 |
|
---|
[988] | 1205 | ifdef KBUILD_PROFILE_SELF
|
---|
| 1206 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 1207 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done pass 1)
|
---|
| 1208 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 1209 | endif
|
---|
[828] | 1210 |
|
---|
| 1211 |
|
---|
| 1212 |
|
---|
[988] | 1213 |
|
---|
[828] | 1214 | #
|
---|
| 1215 | #
|
---|
| 1216 | # Target lists - Pass 2
|
---|
| 1217 | #
|
---|
| 1218 | #
|
---|
| 1219 |
|
---|
| 1220 |
|
---|
[688] | 1221 | ## @page pg_fetches Fetching Tools, Sources and Similar.
|
---|
[73] | 1222 | #
|
---|
[688] | 1223 | # The targets listed in the the FETCHES target list have the following attributes:
|
---|
| 1224 | # SOURCES
|
---|
| 1225 | # INST
|
---|
| 1226 | # FETCHTOOL
|
---|
| 1227 | # FETCHFLAGS
|
---|
| 1228 | # FETCHDIR
|
---|
| 1229 | # UNPACKTOOL
|
---|
| 1230 | # UNPACKFLAGS
|
---|
[640] | 1231 | #
|
---|
[719] | 1232 | # As usual the target name is an alias for 'creating' the target. Other
|
---|
[688] | 1233 | # aliases are:
|
---|
| 1234 | # pass_fetches
|
---|
| 1235 | # fetch
|
---|
| 1236 | # unfetch
|
---|
| 1237 | # download
|
---|
| 1238 | # unpack
|
---|
| 1239 | #
|
---|
| 1240 | # @remark
|
---|
| 1241 | #
|
---|
| 1242 | # This is a little bit complex because we must guarantee that if a source file
|
---|
[719] | 1243 | # changes only sligtly we must refetch it and to a proper unpacking of it. It
|
---|
| 1244 | # is also a desire that fetched archives and unpacked files can be deleted to
|
---|
[688] | 1245 | # save space.
|
---|
| 1246 | #
|
---|
[719] | 1247 | # Thus, we must be able to cleanup what we've unpacked should any of the
|
---|
[688] | 1248 | # sources be removed. We do this by maintaining a file listing the files
|
---|
| 1249 | # and directories that was unpacked. This operation is named 'unfetch'.
|
---|
| 1250 | #
|
---|
[719] | 1251 | # We make use of the SIZE and MD5 attributes for each of the sources to
|
---|
[689] | 1252 | # create a digest that is stored in the primary target file. Subsequent
|
---|
| 1253 | # runswill compare their digest with it to decide if a refetch is required.
|
---|
[719] | 1254 | # When a refetch is found necessary, an 'unfetch' is performed first to
|
---|
[689] | 1255 | # clean out old files and directores. Note even changes in source order
|
---|
[719] | 1256 | # will cause a refetch due to the way the digest is constructed and
|
---|
[689] | 1257 | # evaluated.
|
---|
[688] | 1258 | #
|
---|
| 1259 | # By not depending directly on the archives (nor on any unpacked files)
|
---|
| 1260 | # but on a goal made up from the archive name, size and md5, we allow
|
---|
| 1261 | # the user to delete the archives. Naturally, this means we'll have to
|
---|
| 1262 | # check and fetch missing archives before attempting to unpack them.
|
---|
[689] | 1263 | #
|
---|
| 1264 | # @remark
|
---|
| 1265 | #
|
---|
[719] | 1266 | # This feature will *NOT* work correctly with vanilla GNU make becuase
|
---|
[689] | 1267 | # it makes use of includedep to avoid too many unnecessary files.
|
---|
[719] | 1268 | #
|
---|
[689] | 1269 | # @todo
|
---|
[1255] | 1270 | # 1. Download corruption / continuation.
|
---|
| 1271 | # 2. It's quite possible that there is one too many indirect dependency now...
|
---|
[688] | 1272 | #
|
---|
| 1273 |
|
---|
[640] | 1274 | ## generates the fetch rule
|
---|
| 1275 | define def_fetch_src_fetch_rule
|
---|
| 1276 | # Indirect goal for downloading something.
|
---|
[682] | 1277 | .PRECIOUS: $(out)
|
---|
[1030] | 1278 | $(out) + $($(target)_$(srcname)_FETCH_OUTPUT_) +| $($(target)_$(srcname)_FETCH_OUTPUT_MAYBE_) : \
|
---|
| 1279 | | $($(target)_$(srcname)_FETCH_DEPORD_)
|
---|
[776] | 1280 | $$(call MSG_FETCH_DL,$(target),$(source),$(out))
|
---|
[696] | 1281 | @## @todo do fancy stuff like download continuation.
|
---|
[1255] | 1282 | $$(QUIET)$$(RM) -f $(out)
|
---|
[640] | 1283 | $($(target)_$(srcname)_FETCH_CMDS_)
|
---|
[1255] | 1284 | $$(QUIET)$(if $(md5),$$(MD5SUM_EXT) -b -C $(md5) $(out))
|
---|
[640] | 1285 |
|
---|
| 1286 |
|
---|
[682] | 1287 |
|
---|
[640] | 1288 | # Intermediate goal for making sure the md5 and size matches. it will (re) fetch the archive if necessary.
|
---|
| 1289 | $(out).checked_$(md5)_$(size): $($(target)_$(srcname)_FETCH_DEPEND_) | $($(target)_$(srcname)_FETCH_DEPORD_)
|
---|
[776] | 1290 | $$(call MSG_FETCH_CHK,$(target),$(source),$(out))
|
---|
[1255] | 1291 | $$(QUIET)$$(RM) -f $$@
|
---|
[688] | 1292 | @# (re)fetch the file if it doesn't exist or if it doesn't matches the md5.
|
---|
[696] | 1293 | @## @todo do fancy stuff like download continuation.
|
---|
[1255] | 1294 | $$(QUIET)( test -f $(out) && $(if $(md5),$$(MD5SUM_EXT) -b -C $(md5) $(out), true) ) \
|
---|
[696] | 1295 | || ( $$(RM_EXT) -f $(out) \
|
---|
| 1296 | && $$(MAKE) $(out) -f $(MAKEFILE) --no-print-directory )
|
---|
| 1297 | $$(QUIET2)$$(APPEND) $$@
|
---|
[640] | 1298 |
|
---|
[719] | 1299 | _TARGET_$(target)_FETCHED += $(out) $(out).checked_$(md5)_$(size)
|
---|
[640] | 1300 |
|
---|
[688] | 1301 | # Just a little precaution.
|
---|
| 1302 | .NOTPARALLEL: $(out) $(out).checked_$(md5)_$(size)
|
---|
| 1303 |
|
---|
[640] | 1304 | endef
|
---|
| 1305 |
|
---|
| 1306 | ## generates the unpack rule
|
---|
| 1307 | define def_fetch_src_unpack_rule
|
---|
| 1308 | # This is the unpack rule. it has an order-only dependency on the download check.
|
---|
[1030] | 1309 | $(out) + $($(target)_$(srcname)_UNPACK_OUTPUT_) +| $($(target)_$(srcname)_UNPACK_OUTPUT_MAYBE_) : \
|
---|
| 1310 | $($(target)_$(srcname)_UNPACK_DEPEND_) \
|
---|
[640] | 1311 | | $($(target)_$(srcname)_UNPACK_DEPORD_) $(archive).checked_$(md5)_$(size)
|
---|
[776] | 1312 | $$(call MSG_FETCH_UP,$(target),$(archive),$(inst))
|
---|
[696] | 1313 | $$(QUIET)$$(RM) -f $(out)
|
---|
[688] | 1314 | @# if the source archive doesn't exist fetch it (can have been deleted to save space).
|
---|
[696] | 1315 | $$(QUIET)test -f $(archive) \
|
---|
| 1316 | || ( $$(RM_EXT) -f $(archive).checked_$(md5)_$(size) \
|
---|
| 1317 | && $$(MAKE) $(archive).checked_$(md5)_$(size) -f $(MAKEFILE) --no-print-directory )
|
---|
[640] | 1318 | $($(target)_$(srcname)_UNPACK_CMDS_)
|
---|
[696] | 1319 | $$(QUIET2)$$(APPEND) $(out) $(notdir $(archive).checked_$(md5)_$(size))
|
---|
| 1320 | $$(QUIET2)$$(APPEND) $(out) $(notdir $(out))
|
---|
[640] | 1321 |
|
---|
| 1322 | $(eval _TARGET_$(target)_UNPACKED += $(out))
|
---|
| 1323 | _TARGET_$(target)_DIGEST := $(_TARGET_$(target)_DIGEST)-$(srcname)_$(md5)_$(size)
|
---|
| 1324 |
|
---|
[688] | 1325 | .NOTPARALLEL: $(out)
|
---|
| 1326 |
|
---|
[719] | 1327 | endef
|
---|
[640] | 1328 |
|
---|
| 1329 | ## Processes a fetch source
|
---|
| 1330 | #
|
---|
| 1331 | define def_fetch_src
|
---|
| 1332 | #$ (warning dbg: def_fetch_src: source='$(source)' target='$(target)')
|
---|
| 1333 |
|
---|
| 1334 | # common
|
---|
| 1335 | srcname := $(notdir $(source))
|
---|
| 1336 | inst := $(firstword \
|
---|
| 1337 | $($(target)_$(source)_INST)\
|
---|
| 1338 | $($(target)_$(srcname)_INST)\
|
---|
| 1339 | $($(source)_INST)\
|
---|
| 1340 | $($(srcname)_INST)\
|
---|
| 1341 | $($(target)_INST)\
|
---|
| 1342 | )
|
---|
| 1343 | ifneq ($(patsubst %/,ok,$(inst)),ok)
|
---|
| 1344 | $(error kBuild: Bad or missing INST property for source '$(source)' in target '$(target)': $(inst))
|
---|
| 1345 | endif
|
---|
| 1346 | INSTARGET_$(target)_$(srcname) := $(inst)
|
---|
| 1347 | fetchdir := $(firstword \
|
---|
| 1348 | $($(target)_$(source)_FETCHDIR)\
|
---|
| 1349 | $($(target)_$(srcname)_FETCHDIR)\
|
---|
| 1350 | $($(source)_FETCHDIR)\
|
---|
| 1351 | $($(srcname)_FETCHDIR)\
|
---|
| 1352 | $($(target)_FETCHDIR)\
|
---|
| 1353 | $(FETCHDIR)\
|
---|
| 1354 | $(PATH_TARGET)\
|
---|
| 1355 | )
|
---|
| 1356 | deps := \
|
---|
| 1357 | $($(target)_$(source)_DEPS)\
|
---|
| 1358 | $($(target)_$(srcname)_DEPS)\
|
---|
| 1359 | $($(source)_DEPS)\
|
---|
| 1360 | $($(srcname)_DEPS)\
|
---|
| 1361 | $($(target)_DEPS)
|
---|
[827] | 1362 | orderdeps := \
|
---|
| 1363 | $($(target)_$(source)_ORDERDEPS)\
|
---|
| 1364 | $($(target)_$(srcname)_ORDERDEPS)\
|
---|
| 1365 | $($(source)_ORDERDEPS)\
|
---|
| 1366 | $($(srcname)_ORDERDEPS)\
|
---|
| 1367 | $($(target)_ORDERDEPS)
|
---|
[640] | 1368 | md5 := $(firstword \
|
---|
| 1369 | $($(target)_$(source)_MD5)\
|
---|
| 1370 | $($(target)_$(srcname)_MD5)\
|
---|
| 1371 | $($(source)_MD5)\
|
---|
| 1372 | $($(srcname)_MD5)\
|
---|
| 1373 | $($(target)_MD5)\
|
---|
| 1374 | )
|
---|
| 1375 | size := $(firstword \
|
---|
| 1376 | $($(target)_$(source)_SIZE)\
|
---|
| 1377 | $($(target)_$(srcname)_SIZE)\
|
---|
| 1378 | $($(source)_SIZE)\
|
---|
| 1379 | $($(srcname)_SIZE)\
|
---|
| 1380 | $($(target)_SIZE)\
|
---|
| 1381 | )
|
---|
| 1382 | dep := # not legal for fetch and unpack tools
|
---|
| 1383 |
|
---|
| 1384 |
|
---|
| 1385 | #
|
---|
| 1386 | # The fetching.
|
---|
| 1387 | #
|
---|
| 1388 | out := $(fetchdir)/$(srcname)
|
---|
| 1389 | archive := $(out)
|
---|
| 1390 | TARGET_$(target)_$(srcname) := $(out)
|
---|
| 1391 | dirdep := $(call DIRDEP,$(fetchdir))
|
---|
| 1392 | tool := $(firstword \
|
---|
| 1393 | $($(target)_$(source)_FETCHTOOL)\
|
---|
| 1394 | $($(target)_$(srcname)_FETCHTOOL)\
|
---|
| 1395 | $($(target)_$(source)_TOOL)\
|
---|
| 1396 | $($(target)_$(srcname)_TOOL)\
|
---|
| 1397 | $($(source)_FETCHTOOL)\
|
---|
| 1398 | $($(srcname)_FETCHTOOL)\
|
---|
| 1399 | $($(source)_TOOL)\
|
---|
| 1400 | $($(srcname)_TOOL)\
|
---|
| 1401 | $($(target)_FETCHTOOL)\
|
---|
| 1402 | $($(target)_TOOL)\
|
---|
| 1403 | )
|
---|
| 1404 | flags :=\
|
---|
| 1405 | $(TOOL_$(tool)_FETCHFLAGS)\
|
---|
| 1406 | $(FETCHFLAGS)\
|
---|
| 1407 | $($(target)_FETCHFLAGS)\
|
---|
| 1408 | $($(srcname)_FETCHFLAGS)\
|
---|
| 1409 | $($(source)_FETCHFLAGS)\
|
---|
| 1410 | $($(target)_$(srcname)_FETCHFLAGS)\
|
---|
| 1411 | $($(target)_$(source)_FETCHFLAGS)
|
---|
| 1412 |
|
---|
| 1413 | #$ (warning dbg: target=$(target) source=$(source) $(srcname)=$(srcname) tool=$(tool) out=$(out) flags=$(flags) dirdep=$(dirdep) fetchdir=$(fetchdir) md5=$(md5) size=$(size))
|
---|
| 1414 |
|
---|
| 1415 | ifndef TOOL_$(tool)_FETCH_CMDS
|
---|
| 1416 | $(warning kBuild: tools: \
|
---|
| 1417 | 1 $($(target)_$(source)_FETCHTOOL)\
|
---|
| 1418 | 2 $($(target)_$(srcname)_FETCHTOOL)\
|
---|
| 1419 | 3 $($(target)_$(source)_TOOL)\
|
---|
| 1420 | 4 $($(target)_$(srcname)_TOOL)\
|
---|
| 1421 | 5 $($(source)_FETCHTOOL)\
|
---|
| 1422 | 6 $($(srcname)_FETCHTOOL)\
|
---|
| 1423 | 7 $($(source)_TOOL)\
|
---|
| 1424 | 8 $($(srcname)_TOOL)\
|
---|
| 1425 | 9 $($(target)_FETCHTOOL)\
|
---|
| 1426 | 10 $($(target)_TOOL) )
|
---|
| 1427 | $(error kBuild: TOOL_$(tool)_FETCH_CMDS is not defined. source=$(source) target=$(target) )
|
---|
| 1428 | endif
|
---|
| 1429 |
|
---|
| 1430 | # call the tool
|
---|
| 1431 | $(target)_$(srcname)_FETCH_CMDS_ := $(TOOL_$(tool)_FETCH_CMDS)
|
---|
| 1432 | $(target)_$(srcname)_FETCH_OUTPUT_ := $(TOOL_$(tool)_FETCH_OUTPUT)
|
---|
[1030] | 1433 | $(target)_$(srcname)_FETCH_OUTPUT_MAYBE_ := $(TOOL_$(tool)_FETCH_OUTPUT_MAYBE)
|
---|
[640] | 1434 | $(target)_$(srcname)_FETCH_DEPEND_ := $(TOOL_$(tool)_FETCH_DEPEND) $(deps)
|
---|
[827] | 1435 | $(target)_$(srcname)_FETCH_DEPORD_ := $(TOOL_$(tool)_FETCH_DEPORD) $(dirdep) $(orderdeps)
|
---|
[640] | 1436 |
|
---|
| 1437 | # generate the fetch rule.
|
---|
| 1438 | $(eval $(def_fetch_src_fetch_rule))
|
---|
| 1439 |
|
---|
| 1440 |
|
---|
| 1441 | #
|
---|
| 1442 | # The unpacking / installing.
|
---|
| 1443 | #
|
---|
| 1444 | out := $(inst)_kBuild_$(target)_$(srcname)_unpacked.lst
|
---|
| 1445 | dirdep := $(call DIRDEP,$(inst))
|
---|
| 1446 | tool := $(firstword \
|
---|
| 1447 | $($(target)_$(source)_UNPACKTOOL)\
|
---|
| 1448 | $($(target)_$(srcname)_UNPACKTOOL)\
|
---|
| 1449 | $($(target)_$(source)_TOOL)\
|
---|
| 1450 | $($(target)_$(srcname)_TOOL)\
|
---|
| 1451 | $($(source)_UNPACKTOOL)\
|
---|
| 1452 | $($(srcname)_UNPACKTOOL)\
|
---|
| 1453 | $($(source)_TOOL)\
|
---|
| 1454 | $($(srcname)_TOOL)\
|
---|
| 1455 | $($(target)_UNPACKTOOL)\
|
---|
| 1456 | $($(target)_TOOL) \
|
---|
| 1457 | )
|
---|
| 1458 | ifeq ($(tool),)
|
---|
| 1459 | tool := $(toupper $(subst .,,$(suffix $(subst tar.,TAR,$(srcname)))))
|
---|
| 1460 | $(eval $(value def_tools_include))
|
---|
| 1461 | endif
|
---|
| 1462 | flags :=\
|
---|
| 1463 | $(TOOL_$(tool)_UNPACKFLAGS)\
|
---|
| 1464 | $(UNPACKFLAGS)\
|
---|
| 1465 | $($(target)_UNPACKFLAGS)\
|
---|
| 1466 | $($(srcname)_UNPACKFLAGS)\
|
---|
| 1467 | $($(source)_UNPACKFLAGS)\
|
---|
| 1468 | $($(target)_$(srcname)_UNPACKFLAGS)\
|
---|
| 1469 | $($(target)_$(source)_UNPACKFLAGS)
|
---|
| 1470 |
|
---|
| 1471 | #$ (warning dbg: target=$(target) source=$(source) $(srcname)=$(srcname) tool=$(tool) out=$(out) flags=$(flags) dirdep=$(dirdep) inst=$(inst) md5=$(md5) size=$(size))
|
---|
| 1472 | ifndef TOOL_$(tool)_UNPACK_CMDS
|
---|
| 1473 | $(warning kBuild: tools: \
|
---|
| 1474 | 1 $($(target)_$(source)_UNPACKTOOL)\
|
---|
| 1475 | 2 $($(target)_$(srcname)_UNPACKTOOL)\
|
---|
| 1476 | 3 $($(target)_$(source)_TOOL)\
|
---|
| 1477 | 4 $($(target)_$(srcname)_TOOL)\
|
---|
| 1478 | 5 $($(source)_UNPACKTOOL)\
|
---|
| 1479 | 6 $($(srcname)_UNPACKTOOL)\
|
---|
| 1480 | 7 $($(source)_TOOL)\
|
---|
| 1481 | 8 $($(srcname)_TOOL)\
|
---|
| 1482 | 9 $($(target)_UNPACKTOOL)\
|
---|
| 1483 | 10 $($(target)_TOOL) \
|
---|
| 1484 | 11 $(toupper $(subst tar.,TAR,$(ext $(srcname)))) \
|
---|
| 1485 | )
|
---|
| 1486 | $(error kBuild: TOOL_$(tool)_UNPACK_CMDS is not defined. source=$(source) target=$(target) )
|
---|
| 1487 | endif
|
---|
| 1488 |
|
---|
| 1489 | # call the tool
|
---|
| 1490 | $(target)_$(srcname)_UNPACK_CMDS_ := $(TOOL_$(tool)_UNPACK_CMDS)
|
---|
| 1491 | $(target)_$(srcname)_UNPACK_OUTPUT_ := $(TOOL_$(tool)_UNPACK_OUTPUT)
|
---|
[1030] | 1492 | $(target)_$(srcname)_UNPACK_OUTPUT_MAYBE_ := $(TOOL_$(tool)_UNPACK_OUTPUT_MAYBE)
|
---|
[640] | 1493 | $(target)_$(srcname)_UNPACK_DEPEND_ := $(TOOL_$(tool)_UNPACK_DEPEND) $(deps)
|
---|
[827] | 1494 | $(target)_$(srcname)_UNPACK_DEPORD_ := $(TOOL_$(tool)_UNPACK_DEPORD) $(dirdep) $(orderdeps)
|
---|
[640] | 1495 |
|
---|
| 1496 | # generate the fetch rule.
|
---|
| 1497 | $(eval $(def_fetch_src_unpack_rule))
|
---|
| 1498 |
|
---|
| 1499 | _DIRS += $(inst) $(fetchdir)
|
---|
| 1500 |
|
---|
| 1501 | endef
|
---|
| 1502 |
|
---|
| 1503 |
|
---|
| 1504 | ##
|
---|
| 1505 | # Define the target level rules for a fetch.
|
---|
| 1506 | # @param target
|
---|
| 1507 | # @param out
|
---|
| 1508 | # @param inst
|
---|
[688] | 1509 | # @param _TARGET_$(target)_UNPACKED
|
---|
| 1510 | # @param _TARGET_$(target)_DIGEST
|
---|
[640] | 1511 | # @param bld_trg
|
---|
| 1512 | # @param bld_trg_arch
|
---|
| 1513 | define def_fetch_rules
|
---|
| 1514 |
|
---|
[689] | 1515 | $(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
|
---|
[776] | 1516 | $$(call MSG_FETCH_OK,$(target))
|
---|
[696] | 1517 | $$(QUIET)$$(RM) -f $$@ $$@.tmp
|
---|
[1311] | 1518 | $$(QUIET2)$$(APPEND) $$@.tmp '$(notdir $(out))'
|
---|
[696] | 1519 | $$(QUIET)$(if $(_TARGET_$(target)_UNPACKED),$$(CAT_EXT) $(_TARGET_$(target)_UNPACKED) >> $$@.tmp)
|
---|
| 1520 | $$(QUIET)$$(MV) -f $$@.tmp $$@
|
---|
[640] | 1521 |
|
---|
| 1522 | $(out)_unfetched:
|
---|
[776] | 1523 | $$(call MSG_UNFETCH,$(target))
|
---|
[696] | 1524 | $$(QUIET)$$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out).lst 2> /dev/null | $$(SED) -e '/\/$$$$/d'))
|
---|
| 1525 | $$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@) \
|
---|
[689] | 1526 | $$(addprefix $(inst),$$(sort $$(dir $$(shell $$(CAT_EXT) $(out).lst 2> /dev/null))))
|
---|
[696] | 1527 | $$(QUIET)$$(RM) -f $(out).lst $(out)
|
---|
| 1528 | $$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@)
|
---|
[640] | 1529 |
|
---|
[689] | 1530 | $(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
|
---|
[696] | 1531 | $$(QUIET)$$(RM) -f $$@
|
---|
[776] | 1532 | $$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst)\
|
---|
| 1533 | ,$$(call MSG_REFETCH,$(target)),$$(call MSG_FETCH,$(target))),$$(call MSG_UNFETCH,$(target)))
|
---|
[696] | 1534 | $$(QUIET)$$(if $$(wildcard $(out).lst ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched)
|
---|
[701] | 1535 | $$(QUIET)$$(if $$(_TARGET_$(target)_DIGEST),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out).lst,$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@))
|
---|
[696] | 1536 | $$(QUIET2)$$(if $$(_TARGET_$(target)_DIGEST),$$(APPEND) $$@ "_TARGET_$(target)_DIGEST_PREV := $(_TARGET_$(target)_DIGEST)")
|
---|
[760] | 1537 |
|
---|
[689] | 1538 | .NOTPARALLEL: $(out).lst $(out)_unfetched $(out)
|
---|
[688] | 1539 |
|
---|
[640] | 1540 | endef
|
---|
| 1541 |
|
---|
| 1542 |
|
---|
| 1543 | ##
|
---|
| 1544 | # Deal with one fetch target.
|
---|
| 1545 | # @param target
|
---|
| 1546 | # @param bld_trg
|
---|
| 1547 | # @param bld_trg_arch
|
---|
| 1548 | define def_fetch
|
---|
| 1549 | # common
|
---|
| 1550 | INSTARGET_$(target) := $($(target)_INST)
|
---|
| 1551 | ifneq ($(patsubst %/,ok,$(INSTARGET_$(target))),ok)
|
---|
[679] | 1552 | $(error kBuild: Bad or missing INST property for target '$(target)'. \
|
---|
| 1553 | $(target)_INST='$($(target)_INST)' ($(origin $(target)_INST)))
|
---|
[640] | 1554 | endif
|
---|
| 1555 | _TARGET_$(target)_FETCHED :=
|
---|
| 1556 | _TARGET_$(target)_UNPACKED :=
|
---|
| 1557 | _TARGET_$(target)_DIGEST :=
|
---|
| 1558 |
|
---|
| 1559 | # The 'sources'.
|
---|
| 1560 | #$ (warning dbg fetch: target=$(target) sources=$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)))
|
---|
| 1561 | $(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\
|
---|
| 1562 | $(eval $(value def_fetch_src)))
|
---|
| 1563 |
|
---|
| 1564 | # The target.
|
---|
| 1565 | inst := $(INSTARGET_$(target))
|
---|
| 1566 | out := $(inst)_kBuild_fetch_$(target)
|
---|
| 1567 |
|
---|
[689] | 1568 | $(eval includedep $(out))
|
---|
[690] | 1569 |
|
---|
[640] | 1570 | $(eval $(def_fetch_rules))
|
---|
| 1571 |
|
---|
[690] | 1572 | # Define the aliases here (doesn't work if defined in def_fetch_rules, just like includedep).
|
---|
[749] | 1573 | $(target): $(out)
|
---|
| 1574 | $(target)_unfetch: $(out)_unfetched
|
---|
[690] | 1575 |
|
---|
[689] | 1576 | _FETCHES += $(out)
|
---|
[640] | 1577 | _DOWNLOADS += $(_TARGET_$(target)_FETCHED)
|
---|
| 1578 | _UNPACKS += $(_TARGET_$(target)_UNPACKED)
|
---|
| 1579 | _UNFETCHES += $(out)_unfetched
|
---|
| 1580 | _DIRS += $(inst)
|
---|
| 1581 |
|
---|
| 1582 | endef
|
---|
| 1583 |
|
---|
| 1584 | # Walk the FETCH target lists.
|
---|
| 1585 | bld_trg := $(BUILD_TARGET)
|
---|
| 1586 | bld_trg_arch := $(BUILD_TARGET_ARCH)
|
---|
| 1587 | $(foreach target, $(FETCHES) $(FETCHES.$(BUILD_TARGET)) $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1588 | $(eval $(value def_fetch)))
|
---|
| 1589 |
|
---|
| 1590 | # some aliases.
|
---|
| 1591 | download: $(_DOWNLOADS)
|
---|
[688] | 1592 | unpack: $(_UNPACKS)
|
---|
| 1593 | fetch: $(_FETCHES)
|
---|
| 1594 | unfetch: $(_UNFETCHES)
|
---|
[640] | 1595 |
|
---|
[988] | 1596 | ifdef KBUILD_PROFILE_SELF
|
---|
| 1597 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 1598 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done fetching targets)
|
---|
| 1599 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 1600 | endif
|
---|
[640] | 1601 |
|
---|
| 1602 |
|
---|
[988] | 1603 |
|
---|
[640] | 1604 | ##
|
---|
| 1605 | ## Patching.
|
---|
| 1606 | ##
|
---|
| 1607 | ##
|
---|
[688] | 1608 | #define def_patch_src
|
---|
[640] | 1609 | #
|
---|
| 1610 | #endef
|
---|
| 1611 | #
|
---|
| 1612 | #
|
---|
| 1613 | ## Deal with one patch target.
|
---|
| 1614 | #define def_patch
|
---|
| 1615 | #
|
---|
| 1616 | #$(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\
|
---|
[688] | 1617 | # $(eval $(value def_patch_src)))
|
---|
[640] | 1618 | #
|
---|
[719] | 1619 | #_PATCHES +=
|
---|
[640] | 1620 | #endef
|
---|
| 1621 | #
|
---|
| 1622 | #$(foreach target, $(PATCHES) $(PATCHES.$(BUILD_TARGET)) $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
| 1623 | # $(eval $(value def_patch)))
|
---|
| 1624 | #
|
---|
| 1625 |
|
---|
| 1626 |
|
---|
| 1627 | #
|
---|
[73] | 1628 | # Object processing.
|
---|
| 1629 | #
|
---|
[72] | 1630 |
|
---|
[380] | 1631 | ## wrapper the compile command dependency check.
|
---|
| 1632 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[741] | 1633 | _DEP_COMPILE_CMDS = $(comp-cmds $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)
|
---|
[380] | 1634 | else
|
---|
[730] | 1635 | _DEP_COMPILE_CMDS =
|
---|
[380] | 1636 | endif
|
---|
| 1637 |
|
---|
[749] | 1638 | ## Generates the rules for building a specific object, and the aliases
|
---|
[380] | 1639 | # for building a source file.
|
---|
[353] | 1640 | # @param $(obj) The object file.
|
---|
[380] | 1641 | define def_target_source_rule
|
---|
[1025] | 1642 |
|
---|
[1012] | 1643 | ifdef TOOL_$(tool)_COMPILE_$(type)_USES_KOBJCACHE
|
---|
[1030] | 1644 | $(outbase).koc +| $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_$(source)_OUTPUT_MAYBE_) : \
|
---|
[1007] | 1645 | $($(target)_$(source)_DEPEND_) \
|
---|
| 1646 | $(_DEP_COMPILE_CMDS) \
|
---|
| 1647 | | \
|
---|
| 1648 | $($(target)_$(source)_DEPORD_)
|
---|
| 1649 | $$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
|
---|
| 1650 | else
|
---|
[1030] | 1651 | $(obj) + $($(target)_$(source)_OUTPUT_) +| $($(target)_$(source)_OUTPUT_MAYBE_) : \
|
---|
[380] | 1652 | $($(target)_$(source)_DEPEND_) \
|
---|
| 1653 | $(_DEP_COMPILE_CMDS) \
|
---|
| 1654 | | \
|
---|
| 1655 | $($(target)_$(source)_DEPORD_)
|
---|
[776] | 1656 | $$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
|
---|
[1012] | 1657 | ifdef TOOL_$(tool)_COMPILE_$(type)_DONT_PURGE_OUTPUT
|
---|
[1030] | 1658 | $$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_OUTPUT_MAYBE_)
|
---|
[1007] | 1659 | endif
|
---|
[1012] | 1660 | endif
|
---|
[412] | 1661 |
|
---|
[380] | 1662 | $($(target)_$(source)_CMDS_)
|
---|
| 1663 |
|
---|
| 1664 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[1311] | 1665 | $$(QUIET2)$$(APPEND) '$(dep)'
|
---|
| 1666 | $$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(source)_CMDS_PREV_'
|
---|
| 1667 | $$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_$(source)_CMDS_'
|
---|
| 1668 | $$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
[770] | 1669 | endif
|
---|
[380] | 1670 |
|
---|
[749] | 1671 | $(basename $(notdir $(obj))).o: $(obj)
|
---|
| 1672 | $(basename $(notdir $(obj))).obj: $(obj)
|
---|
[353] | 1673 | endef
|
---|
[205] | 1674 |
|
---|
[353] | 1675 |
|
---|
[380] | 1676 | ## wrapper the link command dependency check.
|
---|
| 1677 | ifndef NO_COMPILE_CMDS_DEPS
|
---|
[741] | 1678 | _DEP_LINK_CMDS = $(comp-cmds $(target)_CMDS_PREV_,$(target)_CMDS_,FORCE)
|
---|
[380] | 1679 | else
|
---|
[730] | 1680 | _DEP_LINK_CMDS =
|
---|
[380] | 1681 | endif
|
---|
| 1682 |
|
---|
| 1683 | ## Generate the link rule for a target.
|
---|
| 1684 | # @param $(target) The normalized target name.
|
---|
| 1685 | # @param $(dirdep) Directories we depend upon begin created before linking.
|
---|
| 1686 | # @param $(dep) The name of the dependency file.
|
---|
| 1687 | # @param $(out)
|
---|
| 1688 | # @param $($(target)_OUTPUT_) Output files from the link.
|
---|
[1030] | 1689 | # @param $($(target)_OUTPUT_MAYBE_) Output files that the link may perhaps create.
|
---|
[380] | 1690 | # @param $($(target)_DEPEND_) Dependencies.
|
---|
| 1691 | # @param $($(target)_DEPORD_) Dependencies which should only affect build order.
|
---|
| 1692 | # @param $($(target)_CMDS_) The link commands.
|
---|
| 1693 | # @param $($(target)_CMDS_PREV_) The link commands from the previous run.
|
---|
| 1694 | define def_link_rule
|
---|
[1030] | 1695 | $(out) + $($(target)_OUTPUT_) +| $($(target)_OUTPUT_MAYBE_) : \
|
---|
[380] | 1696 | $($(target)_DEPEND_) \
|
---|
| 1697 | $(_DEP_LINK_CMDS) \
|
---|
| 1698 | | \
|
---|
| 1699 | $($(target)_DEPORD_)
|
---|
[776] | 1700 | $$(call MSG_LINK,$(target),$$@,$(tool_do))
|
---|
[1030] | 1701 | $$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_) $($(target)_OUTPUT_MAYBE_)
|
---|
[412] | 1702 |
|
---|
[380] | 1703 | $($(target)_CMDS_)
|
---|
| 1704 |
|
---|
[524] | 1705 | ifndef NO_LINK_CMDS_DEPS
|
---|
[1311] | 1706 | $$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_'
|
---|
| 1707 | $$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_CMDS_'
|
---|
| 1708 | $$(QUIET2)$$(APPEND) '$(dep)' 'endef'
|
---|
[770] | 1709 | endif
|
---|
[380] | 1710 |
|
---|
[749] | 1711 | $(basename $(notdir $(out))): $(out)
|
---|
[719] | 1712 |
|
---|
[380] | 1713 | endef
|
---|
| 1714 |
|
---|
| 1715 |
|
---|
| 1716 | ## Generate the link & lib install rule
|
---|
| 1717 | # @param $(target) Normalized target name.
|
---|
| 1718 | # @param $(out) The build target.
|
---|
| 1719 | # @param $(INSTARGET_$(target)) The installation targets.
|
---|
| 1720 | # @param $(mode) The file mode (optional)
|
---|
| 1721 | define def_link_install_rule
|
---|
| 1722 | $(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
|
---|
[776] | 1723 | $$(call MSG_INST_TRG,$(target),$(out),$$@)
|
---|
[696] | 1724 | $$(QUIET)$$(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
|
---|
[719] | 1725 |
|
---|
| 1726 | ifdef KBUILD_DO_AUTO_INSTALL
|
---|
[749] | 1727 | $(basename $(notdir $(out))): $(INSTARGET_$(target))
|
---|
[719] | 1728 | endif
|
---|
[380] | 1729 | endef
|
---|
| 1730 |
|
---|
| 1731 |
|
---|
[73] | 1732 | ## Generic macro for processing C, C++ and Assembly sources.
|
---|
| 1733 | # @param $(target) Normalized target name.
|
---|
| 1734 | # @param $(source) Source file name.
|
---|
[1256] | 1735 | # @param $(type) Source type. {C,CXX,AS,OBJC}
|
---|
[221] | 1736 | # @param bld_type Build type.
|
---|
| 1737 | # @param bld_trg Build target.
|
---|
| 1738 | # @param bld_trg_arch Build target arch.
|
---|
| 1739 | # @param bld_trg_cpu Build target cpu.
|
---|
[1256] | 1740 | def_target_source_c_cpp_objc_asm_rc_new = $(kb-src-one )
|
---|
[741] | 1741 | ifdef KMK_VERSION
|
---|
[1256] | 1742 | def_target_source_c_cpp_objc_asm_rc_var = def_target_source_c_cpp_objc_asm_rc_new
|
---|
[530] | 1743 | else
|
---|
[1256] | 1744 | def_target_source_c_cpp_objc_asm_rc_var = def_target_source_c_cpp_objc_asm_rc_old
|
---|
[530] | 1745 | endif
|
---|
| 1746 |
|
---|
[73] | 1747 | ## Generic macro for processing all target sources.
|
---|
[74] | 1748 | # @param $(target) Normalized target name.
|
---|
[725] | 1749 | # @param $(defpath)
|
---|
| 1750 | # @param much-more...
|
---|
[73] | 1751 | define def_target_sources
|
---|
| 1752 | #$ (warning def_target_sources)
|
---|
| 1753 | # C sources
|
---|
[353] | 1754 | type := C
|
---|
[481] | 1755 | $(foreach source, $(filter %.c , $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
|
---|
[1256] | 1756 | ,$(eval $(value $(def_target_source_c_cpp_objc_asm_rc_var))) )
|
---|
[73] | 1757 |
|
---|
| 1758 | # C++ sources
|
---|
[353] | 1759 | type := CXX
|
---|
[481] | 1760 | $(foreach source, $(filter %.cpp %.cxx %.xx, $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
|
---|
[1256] | 1761 | ,$(eval $(value $(def_target_source_c_cpp_objc_asm_rc_var))) )
|
---|
[73] | 1762 |
|
---|
[1256] | 1763 | # Objective-C sources
|
---|
| 1764 | type := OBJC
|
---|
| 1765 | $(foreach source, $(filter %.m, $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
|
---|
| 1766 | ,$(eval $(value $(def_target_source_c_cpp_objc_asm_rc_var))) )
|
---|
| 1767 |
|
---|
[73] | 1768 | # ASM sources
|
---|
[353] | 1769 | type := AS
|
---|
[481] | 1770 | $(foreach source, $(filter %.asm %.s %.S , $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
|
---|
[1256] | 1771 | ,$(eval $(value $(def_target_source_c_cpp_objc_asm_rc_var))) )
|
---|
[353] | 1772 |
|
---|
[641] | 1773 | # Resource sources
|
---|
| 1774 | type := RC
|
---|
| 1775 | $(foreach source, $(filter %.rc , $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
|
---|
[1256] | 1776 | ,$(eval $(value $(def_target_source_c_cpp_objc_asm_rc_var))) )
|
---|
[641] | 1777 |
|
---|
[73] | 1778 | endef
|
---|
| 1779 |
|
---|
| 1780 |
|
---|
[219] | 1781 |
|
---|
[353] | 1782 | ## Generic macro for generating the install rule(s) for a target
|
---|
| 1783 | # and update the globals with default out.
|
---|
[219] | 1784 | #
|
---|
[353] | 1785 | # @param $(target) Normalized target name.
|
---|
| 1786 | # @param $(out) The output file.
|
---|
| 1787 | # @param $(definst) The default _INST value.
|
---|
| 1788 | # @param $(typevar) The name of the variable with all the root targets of its type.
|
---|
[729] | 1789 | # @remark Only library uses this now.
|
---|
[353] | 1790 | define def_target_install_pluss
|
---|
| 1791 | ifndef $(target)_NOINST
|
---|
| 1792 | INSTARGET_$(target) := $(patsubst %/,%/$(notdir $(out)), \
|
---|
| 1793 | $(if $($(target)_INST), $(addprefix $(PATH_INS)/,$($(target)_INST)), $(definst)/))
|
---|
[219] | 1794 |
|
---|
[353] | 1795 | $(eval $(def_link_install_rule))
|
---|
[239] | 1796 |
|
---|
[827] | 1797 | _INSTALLS_FILES += $(INSTARGET_$(target))
|
---|
[272] | 1798 |
|
---|
[353] | 1799 | ifdef KBUILD_DO_AUTO_INSTALL
|
---|
[579] | 1800 | $(typevar) += $(INSTARGET_$(target))
|
---|
[219] | 1801 | else
|
---|
[579] | 1802 | $(typevar) += $(out)
|
---|
[219] | 1803 | endif
|
---|
[353] | 1804 | else # _NOINST
|
---|
[579] | 1805 | $(typevar) += $(out)
|
---|
[353] | 1806 | endif
|
---|
| 1807 |
|
---|
[1030] | 1808 | _OUT_FILES += $($(target)_OUTPUT_) $($(target)_OUTPUT_MAYBE_) $(out)
|
---|
[905] | 1809 | _CLEAN_FILES += $($(target)_CLEAN) $($(target)_CLEAN.$(bld_trg)) $($(target)_CLEAN.$(bld_trg).$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_cpu)) $($(target)_CLEAN.$(bld_type))
|
---|
| 1810 | _DIRS += $($(target)_BLDDIRS) $($(target)_BLDDIRS.$(bld_trg)) $($(target)_BLDDIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_cpu)) $($(target)_BLDDIRS.$(bld_type))
|
---|
[353] | 1811 | _OBJS += $($(target)_OBJS_)
|
---|
| 1812 |
|
---|
[219] | 1813 | endef
|
---|
| 1814 |
|
---|
| 1815 |
|
---|
| 1816 |
|
---|
| 1817 | #
|
---|
[72] | 1818 | # LIBRARIES
|
---|
[73] | 1819 | #
|
---|
[72] | 1820 |
|
---|
| 1821 | ## Library (one).
|
---|
[74] | 1822 | # @param $(target) Normalized library (target) name.
|
---|
[72] | 1823 | define def_lib
|
---|
[145] | 1824 | # library basics
|
---|
[222] | 1825 | ## @todo prefix
|
---|
[353] | 1826 | bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
| 1827 | bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))
|
---|
| 1828 | bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
|
---|
| 1829 | bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))
|
---|
| 1830 | tool := $(call _TARGET_TOOL,$(target),AR)
|
---|
[78] | 1831 | ifeq ($(tool),)
|
---|
[353] | 1832 | $(error kBuild: Library target $(target) does not have a tool defined!)
|
---|
[78] | 1833 | endif
|
---|
[889] | 1834 | name := $(firstword\
|
---|
| 1835 | $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
|
---|
| 1836 | $($(target)_NAME.$(bld_trg_arch))\
|
---|
| 1837 | $($(target)_NAME.$(bld_trg))\
|
---|
| 1838 | $($(target)_NAME.$(bld_type))\
|
---|
| 1839 | $($(target)_NAME)\
|
---|
| 1840 | $(target))
|
---|
| 1841 | outbase := $(call TARGET_BASE,$(name),$(target))
|
---|
[743] | 1842 | ifndef PATH_$(target)
|
---|
| 1843 | PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
|
---|
| 1844 | else
|
---|
| 1845 | ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
|
---|
| 1846 | $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase))))
|
---|
| 1847 | endif
|
---|
| 1848 | endif
|
---|
[353] | 1849 | suff := $(firstword\
|
---|
[481] | 1850 | $($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 1851 | $($(target)_LIBSUFF.$(bld_trg))\
|
---|
[126] | 1852 | $($(target)_LIBSUFF)\
|
---|
[481] | 1853 | $(TOOL_$(tool)_ARLIBSUFF.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 1854 | $(TOOL_$(tool)_ARLIBSUFF.$(bld_trg))\
|
---|
[126] | 1855 | $(TOOL_$(tool)_ARLIBSUFF)\
|
---|
[353] | 1856 | $(SUFF_LIB))
|
---|
| 1857 | out := $(outbase)$(suff)
|
---|
| 1858 | TARGET_$(target) := $(out)
|
---|
[719] | 1859 | $(target)_OBJS_ :=
|
---|
[725] | 1860 | defpath := $($(target)_PATH)
|
---|
[145] | 1861 |
|
---|
| 1862 | # source -> object
|
---|
[353] | 1863 | $(eval $(value def_target_sources))
|
---|
[145] | 1864 |
|
---|
| 1865 | # library linking
|
---|
[353] | 1866 | tool := $(call _TARGET_TOOL,$(target),AR)
|
---|
[889] | 1867 | name := $(firstword\
|
---|
| 1868 | $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
|
---|
| 1869 | $($(target)_NAME.$(bld_trg_arch))\
|
---|
| 1870 | $($(target)_NAME.$(bld_trg))\
|
---|
| 1871 | $($(target)_NAME.$(bld_type))\
|
---|
| 1872 | $($(target)_NAME)\
|
---|
| 1873 | $(target))
|
---|
| 1874 | outbase := $(call TARGET_BASE,$(name),$(target))
|
---|
[353] | 1875 | flags :=\
|
---|
[74] | 1876 | $(TOOL_$(tool)_ARFLAGS)\
|
---|
[221] | 1877 | $(TOOL_$(tool)_ARFLAGS.$(bld_type))\
|
---|
[74] | 1878 | $(ARFLAGS)\
|
---|
[221] | 1879 | $(ARFLAGS.$(bld_type))\
|
---|
[74] | 1880 | $($(target)_ARFLAGS)\
|
---|
[481] | 1881 | $($(target)_ARFLAGS.$(bld_type)) \
|
---|
| 1882 | $($(target)_ARFLAGS.$(bld_trg)) \
|
---|
| 1883 | $($(target)_ARFLAGS.$(bld_trg_arch)) \
|
---|
| 1884 | $($(target)_ARFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1885 | $($(target)_ARFLAGS.$(bld_trg_cpu))
|
---|
[1256] | 1886 | othersrc := $(filter-out %.c %.cpp %.cxx %.cc %.m %.s %.S %.asm %.rc %.o %.obj %.res,\
|
---|
[353] | 1887 | $($(target)_SOURCES) \
|
---|
| 1888 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 1889 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
[481] | 1890 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
[353] | 1891 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 1892 | $($(target)_SOURCES.$(bld_type)))
|
---|
[1148] | 1893 | objs = $(filter %.o %.obj %.res, \
|
---|
[643] | 1894 | $($(target)_SOURCES) \
|
---|
| 1895 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 1896 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
| 1897 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1898 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 1899 | $($(target)_SOURCES.$(bld_type))) \
|
---|
| 1900 | $($(target)_OBJS_)
|
---|
[353] | 1901 | dirdep := $(call DIRDEP,$(dir $(out)))
|
---|
| 1902 | deps := $($(target)_DEPS)
|
---|
[827] | 1903 | orderdeps := $($(target)_ORDERDEPS)
|
---|
[72] | 1904 |
|
---|
[725] | 1905 | # Adjust paths if we got a default path.
|
---|
| 1906 | ifneq ($(defpath),)
|
---|
[979] | 1907 | objs := $(abspathex $(objs),$(defpath))
|
---|
| 1908 | deps := $(abspathex $(deps),$(defpath))
|
---|
| 1909 | orderdeps := $(abspathex $(orderdeps),$(defpath))
|
---|
| 1910 | othersrc := $(abspathex $(othersrc),$(defpath))
|
---|
[725] | 1911 | endif
|
---|
| 1912 |
|
---|
[859] | 1913 |
|
---|
| 1914 | # Custom pre-link actions.
|
---|
| 1915 | ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 1916 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 1917 | else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 1918 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 1919 | else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
|
---|
| 1920 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
|
---|
| 1921 | else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
|
---|
| 1922 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
|
---|
| 1923 | else ifdef $(target)_PRE_CMDS.$(bld_trg)
|
---|
| 1924 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
|
---|
| 1925 | else ifdef $(target)_PRE_CMDS.$(bld_type)
|
---|
| 1926 | pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
|
---|
| 1927 | else ifdef $(target)_PRE_CMDS
|
---|
| 1928 | pre_cmds := $($(target)_PRE_CMDS)
|
---|
| 1929 | else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 1930 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 1931 | else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 1932 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 1933 | else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
|
---|
| 1934 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
|
---|
| 1935 | else ifdef PRE_CMDS.$(bld_trg_arch)
|
---|
| 1936 | pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
|
---|
| 1937 | else ifdef PRE_CMDS.$(bld_trg)
|
---|
| 1938 | pre_cmds := $(PRE_CMDS.$(bld_trg))
|
---|
| 1939 | else ifdef PRE_CMDS.$(bld_type)
|
---|
| 1940 | pre_cmds := $(PRE_CMDS.$(bld_type))
|
---|
| 1941 | else
|
---|
| 1942 | pre_cmds := $(PRE_CMDS)
|
---|
| 1943 | endif
|
---|
| 1944 |
|
---|
| 1945 | # Custom post-link actions.
|
---|
| 1946 | ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 1947 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 1948 | else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 1949 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 1950 | else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
|
---|
| 1951 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
|
---|
| 1952 | else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
|
---|
| 1953 | post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
|
---|
| 1954 | else ifdef $(target)_POST_CMDS.$(bld_trg)
|
---|
| 1955 | post_cmds := $($(target)_POST_CMDS.$(bld_trg))
|
---|
| 1956 | else ifdef $(target)_POST_CMDS.$(bld_type)
|
---|
| 1957 | post_cmds := $($(target)_POST_CMDS.$(bld_type))
|
---|
| 1958 | else ifdef $(target)_POST_CMDS
|
---|
| 1959 | post_cmds := $($(target)_POST_CMDS)
|
---|
| 1960 | else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 1961 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 1962 | else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 1963 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 1964 | else ifdef POST_CMDS.$(bld_trg).$(bld_type)
|
---|
| 1965 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
|
---|
| 1966 | else ifdef POST_CMDS.$(bld_trg_arch)
|
---|
| 1967 | post_cmds := $(POST_CMDS.$(bld_trg_arch))
|
---|
| 1968 | else ifdef POST_CMDS.$(bld_trg)
|
---|
| 1969 | post_cmds := $(POST_CMDS.$(bld_trg))
|
---|
| 1970 | else ifdef POST_CMDS.$(bld_type)
|
---|
| 1971 | post_cmds := $(POST_CMDS.$(bld_type))
|
---|
| 1972 | else
|
---|
| 1973 | post_cmds := $(POST_CMDS)
|
---|
| 1974 | endif
|
---|
| 1975 |
|
---|
[380] | 1976 | # dependency file
|
---|
| 1977 | dep := $(out)$(SUFF_DEP)
|
---|
[524] | 1978 | ifndef NO_LINK_CMDS_DEPS
|
---|
[893] | 1979 | _DEPFILES_INCLUDED += $(dep)
|
---|
| 1980 | $(eval includedep $(dep))
|
---|
[380] | 1981 | endif
|
---|
[72] | 1982 |
|
---|
[380] | 1983 | # check that the tool is defined.
|
---|
| 1984 | ifndef TOOL_$(tool)_LINK_LIBRARY_CMDS
|
---|
| 1985 | $(warning kBuild: tools: \
|
---|
[481] | 1986 | 1 $($(target)_$(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1987 | 2 $($(target)_$(source)TOOL.$(bld_trg)) \
|
---|
| 1988 | 3 $($(target)_$(source)TOOL) \
|
---|
| 1989 | 4 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1990 | 5 $($(target)_TOOL.$(bld_trg)) \
|
---|
| 1991 | 6 $($(target)_TOOL) \
|
---|
| 1992 | 7 $($(source)TOOL) \
|
---|
| 1993 | 8 $($(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1994 | 9 $($(source)TOOL.$(bld_trg)) \
|
---|
| 1995 | 10 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 1996 | 11 $(TOOL.$(bld_trg)) \
|
---|
| 1997 | 12 $(TOOL) )
|
---|
[380] | 1998 | $(error kBuild: TOOL_$(tool)_LINK_LIBRARY_CMDS isn't defined! target=$(target) )
|
---|
| 1999 | endif
|
---|
| 2000 |
|
---|
| 2001 | # call the tool
|
---|
| 2002 | $(target)_CMDS_ := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
|
---|
[859] | 2003 | ifneq ($(pre_cmds),)
|
---|
| 2004 | $(target)_CMDS_ := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
|
---|
| 2005 | endif
|
---|
| 2006 | ifneq ($(post_cmds),)
|
---|
| 2007 | $(target)_CMDS_ := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
|
---|
| 2008 | endif
|
---|
[380] | 2009 | $(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
|
---|
[1030] | 2010 | $(target)_OUTPUT_MAYBE_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT_MAYBE)
|
---|
[380] | 2011 | $(target)_DEPEND_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPEND) $(deps) $(objs)
|
---|
[827] | 2012 | $(target)_DEPORD_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep) $(orderdeps)
|
---|
[380] | 2013 |
|
---|
[412] | 2014 | # generate the link rule.
|
---|
[380] | 2015 | $(eval $(def_link_rule))
|
---|
| 2016 |
|
---|
[353] | 2017 | # installing and globals
|
---|
| 2018 | $(eval $(value def_target_install_pluss))
|
---|
[72] | 2019 | endef
|
---|
| 2020 |
|
---|
| 2021 | # Process libraries
|
---|
[859] | 2022 | definst := $(PATH_LIB)
|
---|
| 2023 | typevar := _LIBS
|
---|
[776] | 2024 | tool_do := LINK_LIBRARY
|
---|
[380] | 2025 | mode := 0644
|
---|
[481] | 2026 | $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))
|
---|
[72] | 2027 |
|
---|
[988] | 2028 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2029 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2030 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done library targets)
|
---|
| 2031 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2032 | endif
|
---|
[72] | 2033 |
|
---|
[988] | 2034 |
|
---|
[72] | 2035 | #
|
---|
[353] | 2036 | # Link operations.
|
---|
[72] | 2037 | #
|
---|
| 2038 |
|
---|
[353] | 2039 | ##
|
---|
| 2040 | # Link prolog
|
---|
| 2041 | #
|
---|
| 2042 | # @param $(target) Normalized target name.
|
---|
| 2043 | # @param $(EXT) EXE,DLL,SYS.
|
---|
| 2044 | # @param $(definst) The default _INST value.
|
---|
| 2045 | # @param $(typevar) The name of the variable with all the root targets of its type.
|
---|
[380] | 2046 | define def_link_common
|
---|
[353] | 2047 | # basics
|
---|
| 2048 | bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
| 2049 | bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_$(bld_trg_base_var)))
|
---|
| 2050 | bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
|
---|
| 2051 | bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_$(bld_trg_base_var)_CPU))
|
---|
[145] | 2052 |
|
---|
[353] | 2053 | tool := $(call _TARGET_TOOL,$(target),LD)
|
---|
[889] | 2054 | name := $(firstword\
|
---|
| 2055 | $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
|
---|
| 2056 | $($(target)_NAME.$(bld_trg_arch))\
|
---|
| 2057 | $($(target)_NAME.$(bld_trg))\
|
---|
| 2058 | $($(target)_NAME.$(bld_type))\
|
---|
| 2059 | $($(target)_NAME)\
|
---|
| 2060 | $(target))
|
---|
| 2061 | outbase := $(call TARGET_BASE,$(name),$(target))
|
---|
[743] | 2062 | ifndef PATH_$(target)
|
---|
| 2063 | PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
|
---|
| 2064 | else
|
---|
| 2065 | ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
|
---|
| 2066 | $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase))))
|
---|
| 2067 | endif
|
---|
| 2068 | endif
|
---|
[353] | 2069 | suff := $(firstword \
|
---|
| 2070 | $($(target)_$(EXT)SUFF) \
|
---|
| 2071 | $($(target)_$(EXT)SUFF) \
|
---|
| 2072 | $(TOOL_$(tool)_LD$(EXT)SUFF) \
|
---|
| 2073 | $($(EXTPRE)SUFF_$(EXT)))
|
---|
| 2074 | out := $(outbase)$(suff)
|
---|
| 2075 | TARGET_$(target) := $(out)
|
---|
[719] | 2076 | $(target)_OBJS_ :=
|
---|
[725] | 2077 | defpath := $($(target)_PATH)
|
---|
[353] | 2078 |
|
---|
[145] | 2079 | # source -> object
|
---|
[353] | 2080 | $(eval $(value def_target_sources))
|
---|
[145] | 2081 |
|
---|
[744] | 2082 | # more link stuff.
|
---|
[353] | 2083 | tool := $(call _TARGET_TOOL,$(target),LD)
|
---|
[889] | 2084 | name := $(firstword\
|
---|
| 2085 | $($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
|
---|
| 2086 | $($(target)_NAME.$(bld_trg_arch))\
|
---|
| 2087 | $($(target)_NAME.$(bld_trg))\
|
---|
| 2088 | $($(target)_NAME.$(bld_type))\
|
---|
| 2089 | $($(target)_NAME)\
|
---|
| 2090 | $(target))
|
---|
| 2091 | outbase := $(call TARGET_BASE,$(name),$(target))
|
---|
[353] | 2092 | flags :=\
|
---|
[74] | 2093 | $(TOOL_$(tool)_LDFLAGS)\
|
---|
[221] | 2094 | $(TOOL_$(tool)_LDFLAGS.$(bld_type))\
|
---|
| 2095 | $(TOOL_$(tool)_LDFLAGS.$(bld_trg))\
|
---|
| 2096 | $(TOOL_$(tool)_LDFLAGS.$(bld_trg_arch))\
|
---|
[481] | 2097 | $(TOOL_$(tool)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2098 | $(TOOL_$(tool)_LDFLAGS.$(bld_trg_cpu))\
|
---|
[1242] | 2099 | $(foreach sdk, $(SDKS) \
|
---|
| 2100 | $(SDKS.$(bld_type)) \
|
---|
| 2101 | $(SDKS.$(bld_trg)) \
|
---|
| 2102 | $(SDKS.$(bld_trg_arch)) \
|
---|
| 2103 | $(SDKS.$(bld_trg).$(bld_trg_arch)),\
|
---|
| 2104 | $(SDK_$(sdk)_LDFLAGS)\
|
---|
| 2105 | $(SDK_$(sdk)_LDFLAGS.$(bld_type))\
|
---|
| 2106 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg))\
|
---|
| 2107 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg_arch))\
|
---|
| 2108 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
|
---|
| 2109 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg_cpu)))\
|
---|
[74] | 2110 | $(LDFLAGS)\
|
---|
[221] | 2111 | $(LDFLAGS.$(bld_type))\
|
---|
| 2112 | $(LDFLAGS.$(bld_trg))\
|
---|
| 2113 | $(LDFLAGS.$(bld_trg_arch))\
|
---|
[481] | 2114 | $(LDFLAGS.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2115 | $(LDFLAGS.$(bld_trg_cpu))\
|
---|
[1242] | 2116 | $(foreach sdk, $($(target)_SDKS) \
|
---|
| 2117 | $($(target)_SDKS.$(bld_type)) \
|
---|
| 2118 | $($(target)_SDKS.$(bld_trg)) \
|
---|
| 2119 | $($(target)_SDKS.$(bld_trg_arch)) \
|
---|
| 2120 | $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)),\
|
---|
| 2121 | $(SDK_$(sdk)_LDFLAGS)\
|
---|
| 2122 | $(SDK_$(sdk)_LDFLAGS.$(bld_type))\
|
---|
| 2123 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg))\
|
---|
| 2124 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg_arch))\
|
---|
| 2125 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
|
---|
| 2126 | $(SDK_$(sdk)_LDFLAGS.$(bld_trg_cpu)))\
|
---|
[74] | 2127 | $($(target)_LDFLAGS)\
|
---|
[221] | 2128 | $($(target)_LDFLAGS.$(bld_type))\
|
---|
| 2129 | $($(target)_LDFLAGS.$(bld_trg))\
|
---|
| 2130 | $($(target)_LDFLAGS.$(bld_trg_arch))\
|
---|
[481] | 2131 | $($(target)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
|
---|
[353] | 2132 | $($(target)_LDFLAGS.$(bld_trg_cpu))
|
---|
[1256] | 2133 | othersrc := $(filter-out %.c %.cpp %.cxx %.cc %.m %.s %.S %.asm %.rc %.o %.obj %.res,\
|
---|
[353] | 2134 | $($(target)_SOURCES)\
|
---|
| 2135 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 2136 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
[481] | 2137 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
[353] | 2138 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 2139 | $($(target)_SOURCES.$(bld_type)))
|
---|
[1148] | 2140 | objs = $(filter %.o %.obj %.res, \
|
---|
[643] | 2141 | $($(target)_SOURCES) \
|
---|
| 2142 | $($(target)_SOURCES.$(bld_trg)) \
|
---|
| 2143 | $($(target)_SOURCES.$(bld_trg_arch)) \
|
---|
| 2144 | $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2145 | $($(target)_SOURCES.$(bld_trg_cpu)) \
|
---|
| 2146 | $($(target)_SOURCES.$(bld_type))) \
|
---|
| 2147 | $($(target)_OBJS_)
|
---|
[353] | 2148 | libs :=\
|
---|
[221] | 2149 | $($(target)_LIBS.$(bld_trg_cpu))\
|
---|
[481] | 2150 | $($(target)_LIBS.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2151 | $($(target)_LIBS.$(bld_trg_arch))\
|
---|
| 2152 | $($(target)_LIBS.$(bld_trg))\
|
---|
| 2153 | $($(target)_LIBS.$(bld_type))\
|
---|
[74] | 2154 | $($(target)_LIBS)\
|
---|
[592] | 2155 | $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2156 | $($(target)_SDKS.$(bld_trg_arch)) \
|
---|
| 2157 | $($(target)_SDKS.$(bld_trg)) \
|
---|
| 2158 | $($(target)_SDKS.$(bld_type)) \
|
---|
| 2159 | $($(target)_SDKS),\
|
---|
[353] | 2160 | $(SDK_$(sdk)_LIBS.$(bld_trg_cpu))\
|
---|
[481] | 2161 | $(SDK_$(sdk)_LIBS.$(bld_trg).$(bld_trg_arch))\
|
---|
[353] | 2162 | $(SDK_$(sdk)_LIBS.$(bld_trg_arch))\
|
---|
| 2163 | $(SDK_$(sdk)_LIBS.$(bld_trg))\
|
---|
| 2164 | $(SDK_$(sdk)_LIBS.$(bld_type))\
|
---|
| 2165 | $(SDK_$(sdk)_LIBS))\
|
---|
[221] | 2166 | $(LIBS.$(bld_trg_cpu))\
|
---|
[481] | 2167 | $(LIBS.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2168 | $(LIBS.$(bld_trg_arch))\
|
---|
| 2169 | $(LIBS.$(bld_trg))\
|
---|
| 2170 | $(LIBS.$(bld_type))\
|
---|
[74] | 2171 | $(LIBS)\
|
---|
[592] | 2172 | $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2173 | $(SDKS.$(bld_trg_arch)) \
|
---|
| 2174 | $(SDKS.$(bld_trg)) \
|
---|
| 2175 | $(SDKS.$(bld_type)) \
|
---|
| 2176 | $(SDKS),\
|
---|
[353] | 2177 | $(SDK_$(sdk)_LIBS.$(bld_trg_cpu))\
|
---|
[481] | 2178 | $(SDK_$(sdk)_LIBS.$(bld_trg).$(bld_trg_arch))\
|
---|
[353] | 2179 | $(SDK_$(sdk)_LIBS.$(bld_trg_arch))\
|
---|
| 2180 | $(SDK_$(sdk)_LIBS.$(bld_trg))\
|
---|
| 2181 | $(SDK_$(sdk)_LIBS.$(bld_type))\
|
---|
| 2182 | $(SDK_$(sdk)_LIBS))\
|
---|
[221] | 2183 | $(TOOL_$(tool)_LIBS.$(bld_trg_cpu))\
|
---|
[481] | 2184 | $(TOOL_$(tool)_LIBS.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2185 | $(TOOL_$(tool)_LIBS.$(bld_trg_arch))\
|
---|
| 2186 | $(TOOL_$(tool)_LIBS.$(bld_trg))\
|
---|
| 2187 | $(TOOL_$(tool)_LIBS.$(bld_type))\
|
---|
[353] | 2188 | $(TOOL_$(tool)_LIBS)
|
---|
| 2189 | libpath :=\
|
---|
[221] | 2190 | $($(target)_LIBPATH.$(bld_trg_cpu))\
|
---|
[481] | 2191 | $($(target)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2192 | $($(target)_LIBPATH.$(bld_trg_arch))\
|
---|
| 2193 | $($(target)_LIBPATH.$(bld_trg))\
|
---|
| 2194 | $($(target)_LIBPATH.$(bld_type))\
|
---|
[74] | 2195 | $($(target)_LIBPATH)\
|
---|
[592] | 2196 | $(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2197 | $($(target)_SDKS.$(bld_trg_arch)) \
|
---|
| 2198 | $($(target)_SDKS.$(bld_trg)) \
|
---|
| 2199 | $($(target)_SDKS.$(bld_type)) \
|
---|
| 2200 | $($(target)_SDKS),\
|
---|
[353] | 2201 | $(SDK_$(sdk)_LIBPATH.$(bld_trg_cpu))\
|
---|
[481] | 2202 | $(SDK_$(sdk)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
|
---|
[353] | 2203 | $(SDK_$(sdk)_LIBPATH.$(bld_trg_arch))\
|
---|
| 2204 | $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
|
---|
| 2205 | $(SDK_$(sdk)_LIBPATH.$(bld_type))\
|
---|
| 2206 | $(SDK_$(sdk)_LIBPATH))\
|
---|
[221] | 2207 | $(LIBPATH.$(bld_trg_cpu))\
|
---|
[481] | 2208 | $(LIBPATH.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2209 | $(LIBPATH.$(bld_trg_arch))\
|
---|
| 2210 | $(LIBPATH.$(bld_trg))\
|
---|
| 2211 | $(LIBPATH.$(bld_type))\
|
---|
[74] | 2212 | $(LIBPATH)\
|
---|
[592] | 2213 | $(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2214 | $(SDKS.$(bld_trg_arch)) \
|
---|
| 2215 | $(SDKS.$(bld_trg)) \
|
---|
| 2216 | $(SDKS.$(bld_type)) \
|
---|
| 2217 | $(SDKS),\
|
---|
[353] | 2218 | $(SDK_$(sdk)_LIBPATH.$(bld_trg_cpu))\
|
---|
[481] | 2219 | $(SDK_$(sdk)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
|
---|
[353] | 2220 | $(SDK_$(sdk)_LIBPATH.$(bld_trg_arch))\
|
---|
| 2221 | $(SDK_$(sdk)_LIBPATH.$(bld_trg))\
|
---|
| 2222 | $(SDK_$(sdk)_LIBPATH.$(bld_type))\
|
---|
| 2223 | $(SDK_$(sdk)_LIBPATH))\
|
---|
[221] | 2224 | $(TOOL_$(tool)_LIBPATH.$(bld_trg_cpu))\
|
---|
[481] | 2225 | $(TOOL_$(tool)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
|
---|
[221] | 2226 | $(TOOL_$(tool)_LIBPATH.$(bld_trg_arch))\
|
---|
| 2227 | $(TOOL_$(tool)_LIBPATH.$(bld_trg))\
|
---|
| 2228 | $(TOOL_$(tool)_LIBPATH.$(bld_type))\
|
---|
[353] | 2229 | $(TOOL_$(tool)_LIBPATH)
|
---|
| 2230 | dirdep := $(call DIRDEP,$(dir $(out)))
|
---|
| 2231 | deps := $($(target)_DEPS)
|
---|
[827] | 2232 | orderdeps := $($(target)_ORDERDEPS)
|
---|
[353] | 2233 |
|
---|
[725] | 2234 | # Adjust paths if we got a default path.
|
---|
| 2235 | ifneq ($(defpath),)
|
---|
[979] | 2236 | libpath := $(abspathex $(libpath),$(defpath))
|
---|
| 2237 | objs := $(abspathex $(objs),$(defpath))
|
---|
| 2238 | deps := $(abspathex $(deps),$(defpath))
|
---|
| 2239 | orderdeps := $(abspathex $(orderdeps),$(defpath))
|
---|
| 2240 | othersrc := $(abspathex $(othersrc),$(defpath))
|
---|
[725] | 2241 | # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_PATH)/lib if relative to current dir!
|
---|
| 2242 | endif
|
---|
| 2243 |
|
---|
[859] | 2244 | # Custom pre-link actions.
|
---|
| 2245 | ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 2246 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 2247 | else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 2248 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 2249 | else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
|
---|
| 2250 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
|
---|
| 2251 | else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
|
---|
| 2252 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
|
---|
| 2253 | else ifdef $(target)_PRE_CMDS.$(bld_trg)
|
---|
| 2254 | pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
|
---|
| 2255 | else ifdef $(target)_PRE_CMDS.$(bld_type)
|
---|
| 2256 | pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
|
---|
| 2257 | else ifdef $(target)_PRE_CMDS
|
---|
| 2258 | pre_cmds := $($(target)_PRE_CMDS)
|
---|
| 2259 | else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 2260 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 2261 | else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 2262 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 2263 | else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
|
---|
| 2264 | pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
|
---|
| 2265 | else ifdef PRE_CMDS.$(bld_trg_arch)
|
---|
| 2266 | pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
|
---|
| 2267 | else ifdef PRE_CMDS.$(bld_trg)
|
---|
| 2268 | pre_cmds := $(PRE_CMDS.$(bld_trg))
|
---|
| 2269 | else ifdef PRE_CMDS.$(bld_type)
|
---|
| 2270 | pre_cmds := $(PRE_CMDS.$(bld_type))
|
---|
| 2271 | else
|
---|
| 2272 | pre_cmds := $(PRE_CMDS)
|
---|
| 2273 | endif
|
---|
[72] | 2274 |
|
---|
[859] | 2275 | # Custom post-link actions.
|
---|
| 2276 | ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 2277 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 2278 | else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 2279 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 2280 | else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
|
---|
| 2281 | post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
|
---|
| 2282 | else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
|
---|
| 2283 | post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
|
---|
| 2284 | else ifdef $(target)_POST_CMDS.$(bld_trg)
|
---|
| 2285 | post_cmds := $($(target)_POST_CMDS.$(bld_trg))
|
---|
| 2286 | else ifdef $(target)_POST_CMDS.$(bld_type)
|
---|
| 2287 | post_cmds := $($(target)_POST_CMDS.$(bld_type))
|
---|
| 2288 | else ifdef $(target)_POST_CMDS
|
---|
| 2289 | post_cmds := $($(target)_POST_CMDS)
|
---|
| 2290 | else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
|
---|
| 2291 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
|
---|
| 2292 | else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
|
---|
| 2293 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
|
---|
| 2294 | else ifdef POST_CMDS.$(bld_trg).$(bld_type)
|
---|
| 2295 | post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
|
---|
| 2296 | else ifdef POST_CMDS.$(bld_trg_arch)
|
---|
| 2297 | post_cmds := $(POST_CMDS.$(bld_trg_arch))
|
---|
| 2298 | else ifdef POST_CMDS.$(bld_trg)
|
---|
| 2299 | post_cmds := $(POST_CMDS.$(bld_trg))
|
---|
| 2300 | else ifdef POST_CMDS.$(bld_type)
|
---|
| 2301 | post_cmds := $(POST_CMDS.$(bld_type))
|
---|
| 2302 | else
|
---|
| 2303 | post_cmds := $(POST_CMDS)
|
---|
| 2304 | endif
|
---|
| 2305 |
|
---|
[353] | 2306 | # installation targets
|
---|
| 2307 | ifndef $(target)_NOINST
|
---|
| 2308 | INSTARGET_$(target) := $(patsubst %/,%/$(notdir $(out)), \
|
---|
| 2309 | $(if $($(target)_INST), $(addprefix $(PATH_INS)/,$($(target)_INST)), $(definst)/))
|
---|
| 2310 | ifdef KBUILD_DO_AUTO_INSTALL
|
---|
| 2311 | $(typevar) += $(INSTARGET_$(target))
|
---|
| 2312 | else
|
---|
| 2313 | $(typevar) += $(out)
|
---|
| 2314 | endif
|
---|
| 2315 | # generate the install rule
|
---|
| 2316 | $(eval $(def_link_install_rule))
|
---|
| 2317 |
|
---|
| 2318 | else # NOINST
|
---|
| 2319 | INSTARGET_$(target) :=
|
---|
| 2320 | $(typevar) += $(out)
|
---|
| 2321 | endif # NOINST
|
---|
| 2322 |
|
---|
[380] | 2323 | # dependency file
|
---|
| 2324 | dep := $(outbase)$(SUFF_DEP)
|
---|
[524] | 2325 | ifndef NO_LINK_CMDS_DEPS
|
---|
[893] | 2326 | _DEPFILES_INCLUDED += $(dep)
|
---|
| 2327 | $(eval includedep $(dep))
|
---|
[380] | 2328 | endif
|
---|
[353] | 2329 |
|
---|
[380] | 2330 | # check that the tool is defined.
|
---|
| 2331 | ifndef TOOL_$(tool)_$(tool_do)_CMDS
|
---|
| 2332 | $(warning kBuild: tools: \
|
---|
[481] | 2333 | 1 $($(target)_$(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2334 | 2 $($(target)_$(source)TOOL.$(bld_trg)) \
|
---|
| 2335 | 3 $($(target)_$(source)TOOL) \
|
---|
| 2336 | 4 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2337 | 5 $($(target)_TOOL.$(bld_trg)) \
|
---|
| 2338 | 6 $($(target)_TOOL) \
|
---|
| 2339 | 7 $($(source)TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2340 | 8 $($(source)TOOL.$(bld_trg)) \
|
---|
| 2341 | 9 $($(source)TOOL) \
|
---|
| 2342 | 10 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2343 | 11 $(TOOL.$(bld_trg)) \
|
---|
| 2344 | 12 $(TOOL) )
|
---|
[380] | 2345 | $(error kBuild: TOOL_$(tool)_$(tool_do)_CMDS isn't defined! target=$(target) )
|
---|
| 2346 | endif
|
---|
[353] | 2347 |
|
---|
[380] | 2348 | # call the tool
|
---|
| 2349 | $(target)_CMDS_ := $(TOOL_$(tool)_$(tool_do)_CMDS)
|
---|
[859] | 2350 | ifneq ($(pre_cmds),)
|
---|
| 2351 | $(target)_CMDS_ := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
|
---|
| 2352 | endif
|
---|
| 2353 | ifneq ($(post_cmds),)
|
---|
| 2354 | $(target)_CMDS_ := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
|
---|
| 2355 | endif
|
---|
[380] | 2356 | $(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
|
---|
[1030] | 2357 | $(target)_OUTPUT_MAYBE_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT_MAYBE)
|
---|
[380] | 2358 | $(target)_DEPEND_ := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $(objs)
|
---|
[827] | 2359 | $(target)_DEPORD_ := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep) $(orderdeps)
|
---|
[353] | 2360 |
|
---|
[412] | 2361 | # generate the link rule.
|
---|
[380] | 2362 | $(eval $(def_link_rule))
|
---|
| 2363 |
|
---|
[412] | 2364 |
|
---|
[380] | 2365 | # Update globals.
|
---|
[579] | 2366 | _OBJS += $($(target)_OBJS_)
|
---|
| 2367 | _OUT_FILES += $($(target)_OUTPUT_) $(out)
|
---|
[905] | 2368 | _CLEAN_FILES += $($(target)_CLEAN) $($(target)_CLEAN.$(bld_trg)) $($(target)_CLEAN.$(bld_trg).$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_cpu)) $($(target)_CLEAN.$(bld_type))
|
---|
| 2369 | _DIRS += $($(target)_BLDDIRS) $($(target)_BLDDIRS.$(bld_trg)) $($(target)_BLDDIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_cpu)) $($(target)_BLDDIRS.$(bld_type))
|
---|
[827] | 2370 | _INSTALLS_FILES += $(INSTARGET_$(target))
|
---|
[353] | 2371 |
|
---|
| 2372 | endef
|
---|
| 2373 |
|
---|
| 2374 |
|
---|
| 2375 | #
|
---|
| 2376 | # BLDPROGS
|
---|
| 2377 | #
|
---|
| 2378 |
|
---|
| 2379 | ## Build program (one).
|
---|
| 2380 | # @param $(target) Normalized target (program) name.
|
---|
| 2381 | define def_bldprog
|
---|
| 2382 |
|
---|
| 2383 | # set NOINST if not forced installation.
|
---|
| 2384 | ifndef $(target)_INST
|
---|
| 2385 | $(target)_NOINST := 1
|
---|
| 2386 | endif
|
---|
| 2387 |
|
---|
[380] | 2388 | # do the usual stuff.
|
---|
| 2389 | $(eval $(value def_link_common))
|
---|
[353] | 2390 |
|
---|
| 2391 | endef
|
---|
| 2392 |
|
---|
| 2393 | # Process build programs.
|
---|
| 2394 | EXT := EXE
|
---|
| 2395 | EXTPRE := HOST
|
---|
[380] | 2396 | tool_do := LINK_PROGRAM
|
---|
[353] | 2397 | definst := $(PATH_BIN)
|
---|
| 2398 | typevar := _BLDPROGS
|
---|
[380] | 2399 | mode := 0755
|
---|
[353] | 2400 | bld_trg_base_var := PLATFORM
|
---|
[481] | 2401 | $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), $(eval $(value def_bldprog)))
|
---|
[353] | 2402 |
|
---|
[988] | 2403 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2404 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2405 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done build program targets)
|
---|
| 2406 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2407 | endif
|
---|
[353] | 2408 |
|
---|
| 2409 |
|
---|
| 2410 | #
|
---|
| 2411 | # DLLS
|
---|
| 2412 | #
|
---|
| 2413 |
|
---|
[189] | 2414 | # Process dlls
|
---|
[353] | 2415 | EXT := DLL
|
---|
| 2416 | EXTPRE :=
|
---|
[380] | 2417 | tool_do := LINK_DLL
|
---|
[353] | 2418 | definst := $(PATH_DLL)
|
---|
| 2419 | typevar := _DLLS
|
---|
[830] | 2420 | mode := 0644
|
---|
[353] | 2421 | bld_trg_base_var := TARGET
|
---|
[481] | 2422 | $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
|
---|
[74] | 2423 |
|
---|
[988] | 2424 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2425 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2426 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done dll targets)
|
---|
| 2427 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2428 | endif
|
---|
[74] | 2429 |
|
---|
[988] | 2430 |
|
---|
[72] | 2431 | #
|
---|
[830] | 2432 | # IMPORT LIBRARIES
|
---|
[72] | 2433 | #
|
---|
[219] | 2434 | # - On OS/2 and windows these are libraries.
|
---|
[189] | 2435 | # - On other platforms they are fake DLLs.
|
---|
[830] | 2436 | #
|
---|
| 2437 | EXTPRE :=
|
---|
| 2438 | typevar := _IMPORT_LIBS
|
---|
| 2439 | mode := 0644
|
---|
| 2440 | bld_trg_base_var := TARGET
|
---|
[481] | 2441 | ifeq ($(filter-out nt os2 win win64 win32,$(BUILD_TARGET)),)
|
---|
[830] | 2442 | EXT := LIB
|
---|
| 2443 | tool_do := LINK_LIBRARY
|
---|
| 2444 | definst := $(PATH_LIB)
|
---|
| 2445 | $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))
|
---|
[189] | 2446 | else
|
---|
[830] | 2447 | EXT := DLL
|
---|
| 2448 | tool_do := LINK_DLL
|
---|
| 2449 | definst := $(PATH_DLL)
|
---|
| 2450 | $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
|
---|
[189] | 2451 | endif
|
---|
[72] | 2452 |
|
---|
[988] | 2453 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2454 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2455 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done import library targets)
|
---|
| 2456 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2457 | endif
|
---|
[189] | 2458 |
|
---|
[988] | 2459 |
|
---|
[189] | 2460 | #
|
---|
| 2461 | # PROGRAMS
|
---|
| 2462 | #
|
---|
| 2463 |
|
---|
[353] | 2464 | # Process programs
|
---|
| 2465 | EXT := EXE
|
---|
| 2466 | EXTPRE :=
|
---|
[380] | 2467 | tool_do := LINK_PROGRAM
|
---|
[353] | 2468 | definst := $(PATH_BIN)
|
---|
| 2469 | typevar := _PROGRAMS
|
---|
[380] | 2470 | mode := 0755
|
---|
[353] | 2471 | bld_trg_base_var := TARGET
|
---|
[481] | 2472 | $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
|
---|
[130] | 2473 |
|
---|
[988] | 2474 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2475 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2476 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done program targets)
|
---|
| 2477 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2478 | endif
|
---|
[130] | 2479 |
|
---|
[189] | 2480 |
|
---|
[72] | 2481 | #
|
---|
[83] | 2482 | # SYSMODS
|
---|
[72] | 2483 | #
|
---|
| 2484 |
|
---|
[130] | 2485 | # Process sysmods
|
---|
[353] | 2486 | EXT := SYS
|
---|
| 2487 | EXTPRE :=
|
---|
[380] | 2488 | tool_do := LINK_SYSMOD
|
---|
[353] | 2489 | definst := $(PATH_SYS)
|
---|
| 2490 | typevar := _SYSMODS
|
---|
[380] | 2491 | mode := 0644
|
---|
[353] | 2492 | bld_trg_base_var := TARGET
|
---|
[481] | 2493 | $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
|
---|
[83] | 2494 |
|
---|
[988] | 2495 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2496 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2497 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done sysmod targets)
|
---|
| 2498 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2499 | endif
|
---|
[83] | 2500 |
|
---|
[988] | 2501 |
|
---|
[72] | 2502 | #
|
---|
| 2503 | # OTHERS
|
---|
| 2504 | #
|
---|
[481] | 2505 | _OTHERS = $(OTHERS) $(OTHERS.$(BUILD_TARGET)) $(OTHERS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
|
---|
[72] | 2506 |
|
---|
| 2507 |
|
---|
[353] | 2508 | #
|
---|
| 2509 | # INSTALLS
|
---|
| 2510 | #
|
---|
[72] | 2511 |
|
---|
[353] | 2512 | ## generate the install rule
|
---|
| 2513 | define def_install_src_rule
|
---|
| 2514 | # the install rule
|
---|
| 2515 | $(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst)))
|
---|
[776] | 2516 | $$(call MSG_INST_FILE,$(srcsrc),$(insdst))
|
---|
[696] | 2517 | $$(QUIET)$(inscmd)
|
---|
[353] | 2518 | endef
|
---|
| 2519 |
|
---|
| 2520 | ## install one file
|
---|
| 2521 | define def_install_src
|
---|
| 2522 |
|
---|
| 2523 | # deal with '=>' in the source file name.
|
---|
| 2524 | srcdst := $(subst =>, ,$(src))
|
---|
| 2525 | srcsrc := $(firstword $(srcdst))
|
---|
[424] | 2526 | srcdstdir := $(dir $(word 2,$(srcdst)))
|
---|
[353] | 2527 | srcdst := $(word $(words $(srcdst)),$(srcdst))
|
---|
| 2528 |
|
---|
| 2529 | # _INSTFUN
|
---|
| 2530 | ifdef $(srcsrc)_INSTFUN
|
---|
[725] | 2531 | instfun := $(srcsrc)_INSTFUN
|
---|
[1347] | 2532 | else ifdef $(target)_INSTFUN
|
---|
| 2533 | instfun := $(target)_INSTFUN
|
---|
[353] | 2534 | else
|
---|
[1347] | 2535 | instfun := _INSTALL_FILE
|
---|
[353] | 2536 | endif
|
---|
| 2537 |
|
---|
| 2538 | # _INST
|
---|
| 2539 | ifdef $(srcsrc)_INST
|
---|
[725] | 2540 | inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir))
|
---|
[1347] | 2541 | else ifdef $(target)_INST
|
---|
| 2542 | inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir))
|
---|
[353] | 2543 | else
|
---|
[1347] | 2544 | inst := $(dir $(srcdstdir))
|
---|
[353] | 2545 | endif
|
---|
| 2546 |
|
---|
| 2547 | # calc target
|
---|
[380] | 2548 | insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
|
---|
[424] | 2549 | #$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => insdst=$(insdst))
|
---|
[353] | 2550 |
|
---|
[414] | 2551 | # mode, uid and gid
|
---|
| 2552 | mode := $(firstword \
|
---|
[481] | 2553 | $($(target)_$(srcsrc)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2554 | $($(target)_$(srcsrc)_MODE.$(bld_trg)) \
|
---|
| 2555 | $($(target)_$(srcsrc)_MODE) \
|
---|
[481] | 2556 | $($(target)_$(srcdst)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2557 | $($(target)_$(srcdst)_MODE.$(bld_trg)) \
|
---|
| 2558 | $($(target)_$(srcdst)_MODE) \
|
---|
[481] | 2559 | $($(srcsrc)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2560 | $($(srcsrc)_MODE.$(bld_trg)) \
|
---|
| 2561 | $($(srcsrc)_MODE) \
|
---|
[481] | 2562 | $($(srcdst)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2563 | $($(srcdst)_MODE.$(bld_trg)) \
|
---|
| 2564 | $($(srcdst)_MODE) \
|
---|
[481] | 2565 | $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2566 | $($(target)_MODE.$(bld_trg)) \
|
---|
| 2567 | $($(target)_MODE))
|
---|
| 2568 | uid := $(firstword \
|
---|
[481] | 2569 | $($(target)_$(srcsrc)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2570 | $($(target)_$(srcsrc)_UID.$(bld_trg)) \
|
---|
| 2571 | $($(target)_$(srcsrc)_UID) \
|
---|
[481] | 2572 | $($(target)_$(srcdst)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2573 | $($(target)_$(srcdst)_UID.$(bld_trg)) \
|
---|
| 2574 | $($(target)_$(srcdst)_UID) \
|
---|
[481] | 2575 | $($(srcsrc)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2576 | $($(srcsrc)_UID.$(bld_trg)) \
|
---|
| 2577 | $($(srcsrc)_UID) \
|
---|
[481] | 2578 | $($(srcdst)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2579 | $($(srcdst)_UID.$(bld_trg)) \
|
---|
| 2580 | $($(srcdst)_UID) \
|
---|
[481] | 2581 | $($(target)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2582 | $($(target)_UID.$(bld_trg)) \
|
---|
| 2583 | $($(target)_UID))
|
---|
| 2584 | gid := $(firstword \
|
---|
[481] | 2585 | $($(target)_$(srcsrc)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2586 | $($(target)_$(srcsrc)_GID.$(bld_trg)) \
|
---|
| 2587 | $($(target)_$(srcsrc)_GID) \
|
---|
[481] | 2588 | $($(target)_$(srcdst)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2589 | $($(target)_$(srcdst)_GID.$(bld_trg)) \
|
---|
| 2590 | $($(target)_$(srcdst)_GID) \
|
---|
[481] | 2591 | $($(srcsrc)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2592 | $($(srcsrc)_GID.$(bld_trg)) \
|
---|
| 2593 | $($(srcsrc)_GID) \
|
---|
[481] | 2594 | $($(srcdst)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2595 | $($(srcdst)_GID.$(bld_trg)) \
|
---|
| 2596 | $($(srcdst)_GID) \
|
---|
[481] | 2597 | $($(target)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[414] | 2598 | $($(target)_GID.$(bld_trg)) \
|
---|
| 2599 | $($(target)_GID))
|
---|
[830] | 2600 | flags := \
|
---|
| 2601 | $($(target)_IFFLAGS) \
|
---|
| 2602 | $($(target)_IFFLAGS.$(bld_trg)) \
|
---|
| 2603 | $($(target)_IFFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2604 | $($(srcdst)_IFFLAGS) \
|
---|
| 2605 | $($(srcdst)_IFFLAGS.$(bld_trg)) \
|
---|
| 2606 | $($(srcdst)_IFFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2607 | $($(srcsrc)_IFFLAGS) \
|
---|
| 2608 | $($(srcsrc)_IFFLAGS.$(bld_trg)) \
|
---|
| 2609 | $($(srcsrc)_IFFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2610 | $($(target)_$(srcdst)_IFFLAGS) \
|
---|
| 2611 | $($(target)_$(srcdst)_IFFLAGS.$(bld_trg)) \
|
---|
| 2612 | $($(target)_$(srcdst)_IFFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2613 | $($(target)_$(srcsrc)_IFFLAGS) \
|
---|
| 2614 | $($(target)_$(srcsrc)_IFFLAGS.$(bld_trg)) \
|
---|
| 2615 | $($(target)_$(srcsrc)_IFFLAGS.$(bld_trg).$(bld_trg_arch))
|
---|
[414] | 2616 |
|
---|
[725] | 2617 |
|
---|
| 2618 | # Adjust the source if we got a default PATH. (This must be done this late!)
|
---|
| 2619 | ifdef $(target)_PATH
|
---|
[979] | 2620 | srcsrc := $(abspathex $(srcsrc),$($(target)_PATH))
|
---|
[725] | 2621 | endif
|
---|
| 2622 |
|
---|
[353] | 2623 | # create the command
|
---|
| 2624 | ifdef $(srcsrc)_INSTALLER
|
---|
[830] | 2625 | inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
|
---|
| 2626 | else ifdef $(target)_INSTALLER
|
---|
| 2627 | inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
|
---|
[353] | 2628 | else
|
---|
[830] | 2629 | inscmd := $$(INSTALL)\
|
---|
[414] | 2630 | $(if $(uid),-o $(uid))\
|
---|
| 2631 | $(if $(gid),-g $(gid))\
|
---|
| 2632 | $(if $(mode),-m $(mode))\
|
---|
[830] | 2633 | $(flags)\
|
---|
[414] | 2634 | $(srcsrc) $(insdst)
|
---|
[353] | 2635 | endif
|
---|
| 2636 |
|
---|
| 2637 | # generate the rule (need double evaluation here)
|
---|
| 2638 | $(eval $(def_install_src_rule))
|
---|
| 2639 |
|
---|
| 2640 | INSTARGET_$(target) += $(insdst)
|
---|
| 2641 | endef
|
---|
| 2642 |
|
---|
| 2643 |
|
---|
| 2644 | ## generate the symlink rule
|
---|
| 2645 | define def_install_symlink_rule
|
---|
| 2646 | # the install rule
|
---|
| 2647 | $(insdst) : | $(call DIRDEP,$(dir $(insdst)))
|
---|
[776] | 2648 | $$(call MSG_INST_SYM,$(insdst),$(symdst))
|
---|
[696] | 2649 | $$(QUIET)$$(RM) -f $$@
|
---|
| 2650 | $$(QUIET)$$(LN_SYMLINK) $(symdst) $(insdst)
|
---|
[353] | 2651 | endef
|
---|
| 2652 |
|
---|
| 2653 | ## create one symlink
|
---|
| 2654 | define def_install_symlink
|
---|
| 2655 |
|
---|
| 2656 | # deal with '=>' in the source file name.
|
---|
[380] | 2657 | symdst := $(subst =>, ,$(src))
|
---|
| 2658 | symlnk := $(firstword $(symdst))
|
---|
| 2659 | symdst := $(word $(words $(symdst)),$(symdst))
|
---|
[353] | 2660 |
|
---|
| 2661 | # _INSTFUN
|
---|
[380] | 2662 | ifdef $(symlnk)_INSTFUN
|
---|
[827] | 2663 | instfun := $(symlnk)_INSTFUN
|
---|
| 2664 | else ifdef $(target)_INSTFUN
|
---|
[830] | 2665 | instfun := $(target)_INSTFUN
|
---|
[353] | 2666 | else
|
---|
[827] | 2667 | instfun := _INSTALL_FILE
|
---|
[353] | 2668 | endif
|
---|
| 2669 |
|
---|
| 2670 | # _INST
|
---|
[380] | 2671 | ifdef $(symlnk)_INST
|
---|
[725] | 2672 | inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))
|
---|
[827] | 2673 | else ifdef $(target)_INST
|
---|
| 2674 | inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
|
---|
[353] | 2675 | else
|
---|
[827] | 2676 | inst := $(dir $(symlnk))
|
---|
[353] | 2677 | endif
|
---|
| 2678 |
|
---|
| 2679 | # calc target
|
---|
[380] | 2680 | insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))
|
---|
| 2681 | #$(warning symlnk=$(symlnk) symdst=$(symdst) insdst=$(insdst) instfun=$(instfun) inst='$(inst)')
|
---|
[353] | 2682 |
|
---|
| 2683 | # generate the rule (need double evaluation here)
|
---|
| 2684 | $(eval $(def_install_symlink_rule))
|
---|
| 2685 |
|
---|
| 2686 | INSTARGET_$(target) += $(insdst)
|
---|
| 2687 | endef
|
---|
| 2688 |
|
---|
[412] | 2689 |
|
---|
[380] | 2690 | ## generate the install rule
|
---|
| 2691 | define def_install_directory_rule
|
---|
| 2692 | # the install rule
|
---|
| 2693 | $(insdst):
|
---|
[776] | 2694 | $$(call MSG_INST_DIR,$(insdst))
|
---|
[696] | 2695 | $$(QUIET)$$(INSTALL) -d \
|
---|
[380] | 2696 | $(if $(uid),-o $(uid))\
|
---|
| 2697 | $(if $(gid),-g $(gid))\
|
---|
| 2698 | $(if $(mode),-m $(mode))\
|
---|
[830] | 2699 | $(flags)\
|
---|
[380] | 2700 | $(insdst)
|
---|
[412] | 2701 |
|
---|
| 2702 | .NOTPARALLEL: $(insdst)
|
---|
[380] | 2703 | endef
|
---|
| 2704 |
|
---|
[412] | 2705 |
|
---|
[380] | 2706 | ## create one directory
|
---|
| 2707 | define def_install_directory
|
---|
| 2708 |
|
---|
| 2709 | # _INST
|
---|
| 2710 | ifdef $(directory)_INST
|
---|
[725] | 2711 | inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))
|
---|
[827] | 2712 | else ifdef $(target)_INST
|
---|
| 2713 | inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
|
---|
[380] | 2714 | else
|
---|
[827] | 2715 | inst := $(PATH_INS)
|
---|
[380] | 2716 | endif
|
---|
| 2717 |
|
---|
| 2718 | mode := $(firstword \
|
---|
[481] | 2719 | $($(target)_$(directory)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2720 | $($(target)_$(directory)_MODE.$(bld_trg)) \
|
---|
| 2721 | $($(target)_$(directory)_MODE) \
|
---|
[481] | 2722 | $($(directory)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2723 | $($(directory)_MODE.$(bld_trg)) \
|
---|
| 2724 | $($(directory)_MODE) \
|
---|
[481] | 2725 | $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2726 | $($(target)_MODE.$(bld_trg)) \
|
---|
| 2727 | $($(target)_MODE))
|
---|
| 2728 | uid := $(firstword \
|
---|
[481] | 2729 | $($(target)_$(directory)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2730 | $($(target)_$(directory)_UID.$(bld_trg)) \
|
---|
| 2731 | $($(target)_$(directory)_UID) \
|
---|
[481] | 2732 | $($(directory)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2733 | $($(directory)_UID.$(bld_trg)) \
|
---|
| 2734 | $($(directory)_UID) \
|
---|
[481] | 2735 | $($(target)_UID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2736 | $($(target)_UID.$(bld_trg)) \
|
---|
| 2737 | $($(target)_UID))
|
---|
| 2738 | gid := $(firstword \
|
---|
[481] | 2739 | $($(target)_$(directory)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2740 | $($(target)_$(directory)_GID.$(bld_trg)) \
|
---|
| 2741 | $($(target)_$(directory)_GID) \
|
---|
[481] | 2742 | $($(directory)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2743 | $($(directory)_GID.$(bld_trg)) \
|
---|
| 2744 | $($(directory)_GID) \
|
---|
[481] | 2745 | $($(target)_GID.$(bld_trg).$(bld_trg_arch)) \
|
---|
[380] | 2746 | $($(target)_GID.$(bld_trg)) \
|
---|
| 2747 | $($(target)_GID))
|
---|
[830] | 2748 | flags := \
|
---|
| 2749 | $($(target)_IDFLAGS)\
|
---|
| 2750 | $($(target)_IDFLAGS.$(bld_trg)) \
|
---|
| 2751 | $($(target)_IDFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2752 | $($(directory)_IDFLAGS) \
|
---|
| 2753 | $($(directory)_IDFLAGS.$(bld_trg)) \
|
---|
| 2754 | $($(directory)_IDFLAGS.$(bld_trg).$(bld_trg_arch)) \
|
---|
| 2755 | $($(target)_$(directory)_IDFLAGS) \
|
---|
| 2756 | $($(target)_$(directory)_IDFLAGS.$(bld_trg)) \
|
---|
| 2757 | $($(target)_$(directory)_IDFLAGS.$(bld_trg).$(bld_trg_arch))
|
---|
[380] | 2758 |
|
---|
| 2759 | insdst := $(inst)/$(directory)/
|
---|
| 2760 | #$(warning directory=$(directory) inst=$(inst) insdst=$(insdst) mode=$(mode) gid=$(gid) uid=$(uid))
|
---|
| 2761 |
|
---|
| 2762 | # generate the rule (need double evaluation here)
|
---|
| 2763 | $(eval $(def_install_directory_rule))
|
---|
| 2764 |
|
---|
| 2765 | INSTARGET_DIRS_$(target) += $(insdst)
|
---|
| 2766 | endef
|
---|
| 2767 |
|
---|
| 2768 |
|
---|
[353] | 2769 | ## process one install target.
|
---|
| 2770 | define def_install
|
---|
[744] | 2771 | # the basics.
|
---|
[353] | 2772 | bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
|
---|
| 2773 | bld_trg := $(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))
|
---|
| 2774 | bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
|
---|
| 2775 | bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(BUILD_TARGET_CPU))
|
---|
| 2776 |
|
---|
[827] | 2777 | INSTARGET_$(target) := $($(target)_GOALS)
|
---|
[380] | 2778 | INSTARGET_DIRS_$(target) :=
|
---|
| 2779 |
|
---|
[481] | 2780 | $(foreach directory,$($(target)_DIRS) $($(target)_DIRS.$(bld_trg)) $($(target)_DIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_cpu)) $($(target)_DIRS.$(bld_type)), \
|
---|
[380] | 2781 | $(eval $(value def_install_directory)))
|
---|
| 2782 |
|
---|
[481] | 2783 | $(foreach src,$($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)), \
|
---|
[353] | 2784 | $(eval $(value def_install_src)))
|
---|
| 2785 |
|
---|
[481] | 2786 | $(foreach src,$($(target)_SYMLINKS) $($(target)_SYMLINKS.$(bld_trg)) $($(target)_SYMLINKS.$(bld_trg).$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_cpu)) $($(target)_SYMLINKS.$(bld_type)), \
|
---|
[353] | 2787 | $(eval $(value def_install_symlink)))
|
---|
| 2788 |
|
---|
[827] | 2789 | # the collection target
|
---|
| 2790 | TARGET_$(target) := $(PATH_TARGET)/$(target).ins
|
---|
[838] | 2791 | $(TARGET_$(target)): $(INSTARGET_$(target)) | $(INSTARGET_DIRS_$(target)) $(call DIRDEP,$(PATH_TARGET))
|
---|
[827] | 2792 | @$(QUIET2)$(APPEND) $@
|
---|
| 2793 |
|
---|
| 2794 | $(target): $(TARGET_$(target))
|
---|
| 2795 |
|
---|
| 2796 | _INSTALLS += $(TARGET_$(target))
|
---|
| 2797 | _INSTALLS_FILES += $(INSTARGET_$(target))
|
---|
[380] | 2798 | _INSTALLS_DIRS += $(INSTARGET_DIRS_$(target))
|
---|
[905] | 2799 | _CLEAN_FILES += $($(target)_CLEAN) $($(target)_CLEAN.$(bld_trg)) $($(target)_CLEAN.$(bld_trg).$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_arch)) $($(target)_CLEAN.$(bld_trg_cpu)) $($(target)_CLEAN.$(bld_type))
|
---|
| 2800 | _DIRS += $($(target)_BLDDIRS) $($(target)_BLDDIRS.$(bld_trg)) $($(target)_BLDDIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_arch)) $($(target)_BLDDIRS.$(bld_trg_cpu)) $($(target)_BLDDIRS.$(bld_type))
|
---|
[353] | 2801 | endef
|
---|
| 2802 |
|
---|
| 2803 | ## process all install targets
|
---|
[481] | 2804 | $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
|
---|
[353] | 2805 | $(eval $(value def_install)))
|
---|
| 2806 |
|
---|
[988] | 2807 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2808 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2809 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done install targets)
|
---|
| 2810 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2811 | endif
|
---|
[353] | 2812 |
|
---|
[988] | 2813 |
|
---|
[72] | 2814 | #
|
---|
[417] | 2815 | # PACKING
|
---|
| 2816 | #
|
---|
[481] | 2817 | _PACKING += $(PACKING) $(PACKING.$(BUILD_TARGET)) $(PACKING.$(BUILD_TARGET).$(BUILD_TARGET_ARCH))
|
---|
[417] | 2818 |
|
---|
| 2819 |
|
---|
| 2820 | #
|
---|
[72] | 2821 | # DOCS
|
---|
| 2822 | #
|
---|
| 2823 |
|
---|
| 2824 |
|
---|
| 2825 | #
|
---|
[353] | 2826 | # DIRECTORIES
|
---|
| 2827 | #
|
---|
[827] | 2828 | _DIR_ALL := $(sort $(addsuffix /,$(patsubst %/,%,$(_DIRS))) $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS_FILES)))
|
---|
[380] | 2829 | $(foreach directory,$(_INSTALLS_DIRS), $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL))))
|
---|
[353] | 2830 |
|
---|
[380] | 2831 |
|
---|
[353] | 2832 | define def_mkdir_rule
|
---|
| 2833 | $(directory):
|
---|
[776] | 2834 | $$(call MSG_MKDIR,$$@)
|
---|
[696] | 2835 | $$(QUIET)$$(MKDIR) -p $$@
|
---|
[72] | 2836 | endef
|
---|
| 2837 |
|
---|
[353] | 2838 | $(foreach directory,$(_DIR_ALL),$(eval $(def_mkdir_rule)))
|
---|
[72] | 2839 |
|
---|
[988] | 2840 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2841 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2842 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done directories)
|
---|
| 2843 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2844 | endif
|
---|
[183] | 2845 |
|
---|
[988] | 2846 |
|
---|
[72] | 2847 | #
|
---|
[353] | 2848 | # NOTHING
|
---|
[72] | 2849 | #
|
---|
[353] | 2850 | do-nothing:
|
---|
[988] | 2851 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2852 | @$(ECHO) 'prof: $(int-sub $(nanots ), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(nanots ), $(_KBUILD_TS_PREV)) - executing $@'
|
---|
| 2853 | endif
|
---|
[776] | 2854 | $(call MSG_NOTHING)
|
---|
[72] | 2855 |
|
---|
[183] | 2856 |
|
---|
[75] | 2857 | #
|
---|
[353] | 2858 | # CLEAN UP
|
---|
[75] | 2859 | #
|
---|
[353] | 2860 | do-clean:
|
---|
[776] | 2861 | $(call MSG_CLEAN)
|
---|
[701] | 2862 | $(QUIET)$(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)
|
---|
[966] | 2863 | $(QUIET)$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $(rsort $(dir $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)))
|
---|
[72] | 2864 |
|
---|
[98] | 2865 |
|
---|
[897] | 2866 |
|
---|
[353] | 2867 | #
|
---|
| 2868 | # PASSES (including directory and makefile walking)
|
---|
| 2869 | #
|
---|
[221] | 2870 |
|
---|
[75] | 2871 | ## Subdir
|
---|
| 2872 | # @param $(pass) Lowercase pass name.
|
---|
| 2873 | # @param $(PASS) Uppercase pass name.
|
---|
| 2874 | # @param $(subdir) Subdirectory
|
---|
| 2875 | # @param $(tag) tag to attach to the rule name.
|
---|
| 2876 | define def_pass_subdir
|
---|
[219] | 2877 | pass_$(pass)$(tag):: $(dep)
|
---|
[696] | 2878 | + $$(QUIET)$$(MAKE) -C $(subdir) -f $$(notdir $$(firstword $$(wildcard $$(addprefix $(subdir)/,$$(DEFAULT_MAKEFILE))))) pass_$(pass)
|
---|
[75] | 2879 | endef
|
---|
[72] | 2880 |
|
---|
[75] | 2881 | ## Submakefile
|
---|
| 2882 | # @param $(pass) Lowercase pass name.
|
---|
| 2883 | # @param $(PASS) Uppercase pass name.
|
---|
| 2884 | # @param $(makefile) Makefile.
|
---|
| 2885 | # @param $(tag) tag to attach to the rule name.
|
---|
| 2886 | define def_pass_makefile
|
---|
[219] | 2887 | pass_$(pass)$(tag):: $(dep)
|
---|
[696] | 2888 | + $$(QUIET)$$(MAKE) -C $(patsubst %/,%,$(dir $(makefile))) -f $(notdir $(makefile)) pass_$(pass)
|
---|
[75] | 2889 | endef
|
---|
[73] | 2890 |
|
---|
[75] | 2891 | ## Execute a pass.
|
---|
| 2892 | # @param $(pass) Lowercase pass name.
|
---|
| 2893 | # @param $(PASS) Uppercase pass name.
|
---|
[353] | 2894 | define def_pass_old
|
---|
[481] | 2895 | $(eval SUBDIRS_$(PASS) ?= $(SUBDIRS) $(SUBDIRS.$(BUILD_TARGET)) $(SUBDIRS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
| 2896 | $(eval SUBDIRS_AFTER_$(PASS) ?= $(SUBDIRS_AFTER) $(SUBDIRS_AFTER.$(BUILD_TARGET)) $(SUBDIRS_AFTER.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
| 2897 | $(eval MAKEFILES_BEFORE_$(PASS) ?= $(MAKEFILES_BEFORE) $(MAKEFILES_BEFORE.$(BUILD_TARGET)) $(MAKEFILES_BEFORE.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
| 2898 | $(eval MAKEFILES_AFTER_$(PASS) ?= $(MAKEFILES_AFTER) $(MAKEFILES_AFTER.$(BUILD_TARGET)) $(MAKEFILES_AFTER.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
[75] | 2899 |
|
---|
| 2900 | $(eval tag:=_before)
|
---|
[219] | 2901 | $(eval dep:=)
|
---|
[481] | 2902 | $(foreach subdir,$(SUBDIRS_$(PASS)) $(SUBDIRS_$(PASS).$(BUILD_TARGET)) $(SUBDIRS_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_subdir)))
|
---|
| 2903 | $(foreach makefile,$(MAKEFILES_BEFORE_$(PASS)) $(MAKEFILES_BEFORE_$(PASS).$(BUILD_TARGET)) $(MAKEFILES_BEFORE_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),$(eval $(def_pass_makefile)))
|
---|
[75] | 2904 |
|
---|
| 2905 | $(eval tag:=_after)
|
---|
[219] | 2906 | $(eval dep:=pass_$(pass)_doit)
|
---|
[481] | 2907 | $(foreach subdir,$(SUBDIRS_AFTER_$(PASS)) $(SUBDIRS_AFTER_$(PASS).$(BUILD_TARGET)) $(SUBDIRS_AFTER_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_subdir)))
|
---|
| 2908 | $(foreach makefile,$(MAKEFILES_AFTER_$(PASS)) $(MAKEFILES_AFTER_$(PASS).$(BUILD_TARGET)) $(MAKEFILES_AFTER_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_makefile)))
|
---|
[75] | 2909 |
|
---|
| 2910 | .NOTPARALLEL: pass_$(pass)_before pass_$(pass)_after
|
---|
| 2911 | .PHONY: pass_$(pass) pass_$(pass)_before pass_$(pass)_doit pass_$(pass)_after
|
---|
[353] | 2912 | pass_$(pass)_doit: $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$(var))
|
---|
[272] | 2913 | pass_$(pass)_this: pass_$(pass)_before
|
---|
[696] | 2914 | + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
|
---|
[220] | 2915 | pass_$(pass)_after:: pass_$(pass)_this
|
---|
[219] | 2916 | pass_$(pass): pass_$(pass)_after
|
---|
[75] | 2917 |
|
---|
[183] | 2918 | endef
|
---|
| 2919 |
|
---|
[353] | 2920 | define def_pass
|
---|
[481] | 2921 | $(eval SUBDIRS_$(PASS) ?= $(SUBDIRS) $(SUBDIRS.$(BUILD_TARGET)) $(SUBDIRS.$(BUILD_TARGET.$(BUILD_TARGET_ARCH))) )
|
---|
| 2922 | $(eval SUBDIRS_AFTER_$(PASS) ?= $(SUBDIRS_AFTER) $(SUBDIRS_AFTER.$(BUILD_TARGET)) $(SUBDIRS_AFTER.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
| 2923 | $(eval MAKEFILES_BEFORE_$(PASS) ?= $(MAKEFILES_BEFORE) $(MAKEFILES_BEFORE.$(BUILD_TARGET)) $(MAKEFILES_BEFORE.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
| 2924 | $(eval MAKEFILES_AFTER_$(PASS) ?= $(MAKEFILES_AFTER) $(MAKEFILES_AFTER.$(BUILD_TARGET)) $(MAKEFILES_AFTER.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) )
|
---|
[183] | 2925 |
|
---|
[353] | 2926 | $(eval tag:=_before)
|
---|
| 2927 | $(eval dep:=)
|
---|
[481] | 2928 | $(foreach subdir,$(SUBDIRS_$(PASS)) $(SUBDIRS_$(PASS).$(BUILD_TARGET)) $(SUBDIRS_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_subdir)))
|
---|
| 2929 | $(foreach makefile,$(MAKEFILES_BEFORE_$(PASS)) $(MAKEFILES_BEFORE_$(PASS).$(BUILD_TARGET)) $(MAKEFILES_BEFORE_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),$(eval $(def_pass_makefile)))
|
---|
[75] | 2930 |
|
---|
[353] | 2931 | $(eval tag:=_after)
|
---|
| 2932 | $(eval dep:=pass_$(pass)_doit)
|
---|
[481] | 2933 | $(foreach subdir,$(SUBDIRS_AFTER_$(PASS)) $(SUBDIRS_AFTER_$(PASS).$(BUILD_TARGET)) $(SUBDIRS_AFTER_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_subdir)))
|
---|
| 2934 | $(foreach makefile,$(MAKEFILES_AFTER_$(PASS)) $(MAKEFILES_AFTER_$(PASS).$(BUILD_TARGET)) $(MAKEFILES_AFTER_$(PASS).$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) ,$(eval $(def_pass_makefile)))
|
---|
[75] | 2935 |
|
---|
[380] | 2936 | ifdef KBUILD_SAFE_PARALLEL
|
---|
[353] | 2937 | .NOTPARALLEL: pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_this
|
---|
| 2938 | .PHONY: pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_this pass_$(pass)_doit
|
---|
| 2939 | pass_$(pass)_doit: $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$(var))
|
---|
| 2940 | pass_$(pass)_this: pass_$(pass)_before
|
---|
[696] | 2941 | + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)_doit
|
---|
[353] | 2942 | pass_$(pass)_after:: pass_$(pass)_this
|
---|
| 2943 | pass_$(pass): pass_$(pass)_after
|
---|
| 2944 | else
|
---|
[388] | 2945 | .NOTPARALLEL: pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_doit
|
---|
[353] | 2946 | .PHONY: pass_$(pass) pass_$(pass)_before pass_$(pass)_after pass_$(pass)_doit
|
---|
| 2947 | pass_$(pass)_doit: pass_$(pass)_before \
|
---|
| 2948 | $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$($(var)))
|
---|
| 2949 | pass_$(pass): \
|
---|
| 2950 | pass_$(pass)_before \
|
---|
| 2951 | pass_$(pass)_doit \
|
---|
[388] | 2952 | pass_$(pass)_after
|
---|
[353] | 2953 | endif
|
---|
[189] | 2954 |
|
---|
[353] | 2955 | #$ (warning pass=$(pass) PASS=$(PASS): $(PASS_$(PASS)_trgs) $(PASS_$(PASS)_trgs) $(foreach var,$(PASS_$(PASS)_vars),$($(var))))
|
---|
| 2956 | endef
|
---|
[75] | 2957 |
|
---|
[353] | 2958 | # Generate the defined passes.
|
---|
| 2959 | $(foreach PASS, $(PASSES), \
|
---|
| 2960 | $(eval pass := $(PASS_$(PASS)_pass)) \
|
---|
| 2961 | $(eval $(def_pass)))
|
---|
[75] | 2962 |
|
---|
[219] | 2963 | ## Pass order
|
---|
| 2964 | # @param $(pass) Current pass name.
|
---|
| 2965 | # @param $(prev_pass) The previous pass name.
|
---|
| 2966 | define def_pass_order
|
---|
[380] | 2967 | ifdef KBUILD_SAFE_PARALLEL
|
---|
[353] | 2968 | .NOTPARALLEL: pass_$(pass)_order
|
---|
| 2969 | .PHONY: pass_$(pass)_order
|
---|
[219] | 2970 | pass_$(pass)_order: $(pass_prev)
|
---|
[776] | 2971 | $$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
|
---|
[696] | 2972 | + $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)
|
---|
[353] | 2973 | else
|
---|
| 2974 | .NOTPARALLEL: pass_$(pass)_order pass_$(pass)_banner
|
---|
[388] | 2975 | .PHONY: pass_$(pass)_order pass_$(pass)_banner
|
---|
[353] | 2976 | pass_$(pass)_banner:
|
---|
[776] | 2977 | $$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
|
---|
[353] | 2978 | pass_$(pass)_order: \
|
---|
| 2979 | $(pass_prev) \
|
---|
| 2980 | pass_$(pass)_banner \
|
---|
| 2981 | pass_$(pass)
|
---|
| 2982 | endif
|
---|
[219] | 2983 | $(eval pass_prev := pass_$(pass)_order)
|
---|
| 2984 | endef
|
---|
[183] | 2985 |
|
---|
[219] | 2986 | ## PASS: order
|
---|
| 2987 | # Use dependencies to ensure correct pass order.
|
---|
| 2988 | pass_prev :=
|
---|
[353] | 2989 | $(foreach PASS,$(DEFAULT_PASSES),\
|
---|
| 2990 | $(eval pass := $(PASS_$(PASS)_pass)) \
|
---|
| 2991 | $(eval $(def_pass_order)))
|
---|
[219] | 2992 |
|
---|
[988] | 2993 | ifdef KBUILD_PROFILE_SELF
|
---|
| 2994 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 2995 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - done passes)
|
---|
| 2996 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 2997 | endif
|
---|
[272] | 2998 |
|
---|
[897] | 2999 |
|
---|
[75] | 3000 | #
|
---|
| 3001 | # THE MAIN RULES
|
---|
| 3002 | #
|
---|
[219] | 3003 | all_recursive: $(pass_prev)
|
---|
[75] | 3004 |
|
---|
[130] | 3005 | rebuild: clean
|
---|
[219] | 3006 | + $(MAKE) -f $(firstword $(MAKEFILE_LIST)) all_recursive
|
---|
[78] | 3007 |
|
---|
[412] | 3008 | # @todo make this a non-default pass!
|
---|
[353] | 3009 | uninstall:
|
---|
[827] | 3010 | $(RM) -f $(_INSTALLS_FILES)
|
---|
[412] | 3011 |
|
---|
[380] | 3012 | install: pass_installs
|
---|
[78] | 3013 |
|
---|
[75] | 3014 | # misc shortcuts.
|
---|
[380] | 3015 | targets: bldprogs libraries dlls programs sysmods others installs
|
---|
[75] | 3016 | objects: $(_OBJS)
|
---|
[222] | 3017 | bldprogs: $(_BLDPROGS)
|
---|
[189] | 3018 | libraries: $(_LIBS) $(_IMPORT_LIBS) $(_OTHER_LIBRARIES)
|
---|
[205] | 3019 | dlls: $(_DLLS)
|
---|
[219] | 3020 | programs: $(_PROGRAMS)
|
---|
[205] | 3021 | sysmods: $(_SYSMODS)
|
---|
[353] | 3022 | others: $(_OTHERS)
|
---|
[854] | 3023 | installs: $(_INSTALLS) $(_INSTALLS_DIRS) $(_INSTALLS_FILES)
|
---|
[75] | 3024 |
|
---|
| 3025 |
|
---|
[897] | 3026 |
|
---|
[353] | 3027 | #
|
---|
| 3028 | # kBuild debugging stuff.
|
---|
| 3029 | #
|
---|
| 3030 | show_targets:
|
---|
[984] | 3031 | @$(foreach target, $(_ALL_TARGETS),\
|
---|
[353] | 3032 | @$(ECHO) "target: $(target)" $(NLTAB)\
|
---|
| 3033 | @$(ECHO) " PATH_$(target)=$(PATH_$(target))" $(NLTAB)\
|
---|
| 3034 | @$(ECHO) " TARGET_$(target)=$(TARGET_$(target))" $(NLTAB)\
|
---|
| 3035 | @$(ECHO) " INSTARGET_$(target)=$(INSTARGET_$(target))" $(NLTAB)\
|
---|
[660] | 3036 | $(foreach prop,$(PROPS_SINGLE) $(PROPS_ACCUMULATE_L) $(PROPS_ACCUMULATE_R) OBJS_ CLEAN, \
|
---|
[353] | 3037 | $(eval _tmp:=$(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) \
|
---|
| 3038 | $(if $($(target)_$(prop).$(_tmp)),\
|
---|
| 3039 | @$(ECHO) " $(target)_$(prop).$(_tmp)=$($(target)_$(prop).$(_tmp))" $(NLTAB)) \
|
---|
| 3040 | $(if $($(target)_$(prop)), $(NLTAB)@$(ECHO) " $(target)_$(prop)=$($(target)_$(prop))" $(NLTAB)) \
|
---|
| 3041 | )\
|
---|
| 3042 | $(foreach prop,$(PROPS_DEFERRED), \
|
---|
| 3043 | $(eval _tmp:=$(firstword $($(target)_BLD_TRG) $(BUILD_TARGET))) \
|
---|
| 3044 | $(if $(value $(target)_$(prop).$(_tmp)),\
|
---|
| 3045 | @$(ECHO) ' $(target)_$(prop).$(_tmp)=$(value $(TARGET)_$(prop).$(_tmp))' $(NLTAB)) \
|
---|
| 3046 | $(if $(value $(target)_$(prop)), $(NLTAB)@$(ECHO) ' $(target)_$(prop)=$(value $(target)_$(prop))' $(NLTAB)) \
|
---|
| 3047 | ))
|
---|
| 3048 |
|
---|
| 3049 |
|
---|
| 3050 |
|
---|
| 3051 | #
|
---|
| 3052 | # Include dependency files.
|
---|
| 3053 | #
|
---|
[893] | 3054 | ifneq ($(_DEPFILES),)
|
---|
| 3055 | includedep $(_DEPFILES)
|
---|
| 3056 | endif
|
---|
[353] | 3057 |
|
---|
| 3058 |
|
---|
[988] | 3059 | ifdef KBUILD_PROFILE_SELF
|
---|
| 3060 | _KBUILD_TS_FOOTER_END := $(nanots )
|
---|
| 3061 | $(info prof: $(int-sub $(_KBUILD_TS_FOOTER_END), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_FOOTER_END), $(_KBUILD_TS_PREV)) - end of footer.kmk)
|
---|
| 3062 | $(info prof: footer.kmk: $(int-sub $(_KBUILD_TS_FOOTER_END), $(_KBUILD_TS_FOOTER_START)))
|
---|
| 3063 | _KBUILD_TS_PREV := $(_KBUILD_TS_FOOTER_END)
|
---|
| 3064 | endif
|
---|
| 3065 |
|
---|
[72] | 3066 | # end-of-file-content
|
---|
[106] | 3067 | __footer_kmk__ := target
|
---|
[72] | 3068 | endif # __footer_kmk__
|
---|
[438] | 3069 |
|
---|