[69] | 1 | # $Id: header.kmk 1441 2008-03-30 05:31:21Z bird $
|
---|
| 2 | ## @file
|
---|
| 3 | #
|
---|
[978] | 4 | # kBuild - File included at top of a makefile.
|
---|
[69] | 5 | #
|
---|
[782] | 6 | # Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
|
---|
[69] | 7 | #
|
---|
| 8 | #
|
---|
| 9 | # This file is part of kBuild.
|
---|
| 10 | #
|
---|
| 11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
| 12 | # it under the terms of the GNU General Public License as published by
|
---|
| 13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 14 | # (at your option) any later version.
|
---|
| 15 | #
|
---|
| 16 | # kBuild is distributed in the hope that it will be useful,
|
---|
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | # GNU General Public License for more details.
|
---|
| 20 | #
|
---|
| 21 | # You should have received a copy of the GNU General Public License
|
---|
| 22 | # along with kBuild; if not, write to the Free Software
|
---|
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 24 | #
|
---|
| 25 | #
|
---|
| 26 |
|
---|
| 27 | ifndef __header_kmk__
|
---|
| 28 | # start-of-file-content
|
---|
[988] | 29 | ifdef KBUILD_PROFILE_SELF
|
---|
| 30 | _KBUILD_TS_HEADER_START := $(nanots ) # just a dummy warm up query
|
---|
| 31 | $(info prof: since start - since previous - event description)
|
---|
[1441] | 32 | $(info stat: $(make-stats ))
|
---|
[988] | 33 | _KBUILD_TS_HEADER_START := $(nanots )
|
---|
| 34 | _KBUILD_TS_PREV := $(_KBUILD_TS_HEADER_START)
|
---|
| 35 | endif
|
---|
[69] | 36 |
|
---|
[978] | 37 |
|
---|
[69] | 38 | #
|
---|
[978] | 39 | # Check make version before we do anything else.
|
---|
[69] | 40 | #
|
---|
[978] | 41 | ifndef KMK_VERSION
|
---|
[984] | 42 | $(error kBuild: The kmk default variable KMK_VERSION isn't defined! Make sure you are using 'kmk' and not 'make', 'gmake', 'kmk_gmake', 'dmake' or any other make program)
|
---|
[978] | 43 | endif
|
---|
| 44 | ifneq ($(KBUILD_VERSION_MAJOR).$(KBUILD_VERSION_MINOR),0.1)
|
---|
| 45 | ifneq ($(KBUILD_VERSION_MAJOR),0)
|
---|
[1348] | 46 | $(warning kBuild: kmk major version mismatch! Expected '0' but found '$(KBUILD_VERSION_MAJOR)'!)
|
---|
[978] | 47 | else
|
---|
[1348] | 48 | $(warning kBuild: kmk minor version mismatch! Expected '1' but found '$(KBUILD_VERSION_MINOR)'!)
|
---|
[978] | 49 | endif
|
---|
[1348] | 50 | else
|
---|
| 51 | ifneq ($(int-ge $(KBUILD_VERSION_PATCH),2),1)
|
---|
| 52 | $(warning kBuild: kmk version mismatch! Expected 0.1.2 or later. Actual version is $(KBUILD_VERSION_MAJOR).$(KBUILD_VERSION_MINOR).$(KBUILD_VERSION_PATCH).)
|
---|
| 53 | endif
|
---|
[978] | 54 | endif
|
---|
[69] | 55 |
|
---|
| 56 | #
|
---|
[978] | 57 | # The revision in which this file was last modified.
|
---|
| 58 | # This can be useful when using development versions of kBuild.
|
---|
[380] | 59 | #
|
---|
[978] | 60 | KMK_REVISION := $(patsubst %:,, $Rev: 1441 $ )
|
---|
[414] | 61 |
|
---|
[978] | 62 |
|
---|
[380] | 63 | #
|
---|
[978] | 64 | # Define the default goal.
|
---|
[69] | 65 | #
|
---|
[978] | 66 | all: all_recursive
|
---|
[69] | 67 |
|
---|
[894] | 68 | #
|
---|
[978] | 69 | # The phony FORCE target.
|
---|
[894] | 70 | #
|
---|
[978] | 71 | FORCE:
|
---|
[72] | 72 |
|
---|
[978] | 73 |
|
---|
[69] | 74 | #
|
---|
[978] | 75 | # Enable delete on error and second expansion of prerequisites.
|
---|
[894] | 76 | #
|
---|
[978] | 77 | .DELETE_ON_ERROR:
|
---|
| 78 |
|
---|
[894] | 79 | .SECONDEXPANSION:
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | #
|
---|
[95] | 83 | # General purpose macros.
|
---|
| 84 | #
|
---|
[204] | 85 |
|
---|
[380] | 86 | ##
|
---|
| 87 | # Newline character(s).
|
---|
| 88 | define NL
|
---|
[95] | 89 |
|
---|
[380] | 90 |
|
---|
| 91 | endef
|
---|
| 92 |
|
---|
| 93 | ##
|
---|
| 94 | # Tab character.
|
---|
| 95 | TAB := $(subst ., ,.)
|
---|
| 96 |
|
---|
| 97 | ##
|
---|
[896] | 98 | # Newline + tab characters (for generating commands).
|
---|
| 99 | NLTAB = $(NL)$(TAB)
|
---|
| 100 |
|
---|
| 101 | ##
|
---|
[380] | 102 | # Space character.
|
---|
| 103 | SP := $(subst ., ,.)
|
---|
| 104 |
|
---|
| 105 | ##
|
---|
[895] | 106 | # Hash character.
|
---|
| 107 | define HASH
|
---|
| 108 | #
|
---|
| 109 | endef
|
---|
[380] | 110 |
|
---|
[895] | 111 | ##
|
---|
| 112 | # Colon character.
|
---|
| 113 | COLON := :
|
---|
| 114 |
|
---|
| 115 | ##
|
---|
| 116 | # Semicolon character.
|
---|
| 117 | SEMICOLON := ;
|
---|
| 118 |
|
---|
| 119 | ##
|
---|
| 120 | # Comma character.
|
---|
| 121 | COMMA := ,
|
---|
| 122 |
|
---|
| 123 | ##
|
---|
| 124 | # Dot character.
|
---|
| 125 | DOT := .
|
---|
| 126 |
|
---|
| 127 | ##
|
---|
| 128 | # Dollar character.
|
---|
| 129 | DOLLAR := $$
|
---|
| 130 |
|
---|
| 131 | ##
|
---|
| 132 | # Equal character.
|
---|
| 133 | EQUAL := =
|
---|
| 134 |
|
---|
| 135 |
|
---|
[95] | 136 | #
|
---|
[1403] | 137 | # The list of standard build types in kBuild.
|
---|
| 138 | #
|
---|
[1416] | 139 | # This list can be extended in Config.kmk and it's possible to extend
|
---|
[1403] | 140 | # (inherit) another build type.
|
---|
| 141 | #
|
---|
[1420] | 142 | KBUILD_BLD_TYPES := release profile debug
|
---|
[1403] | 143 |
|
---|
| 144 |
|
---|
| 145 | #
|
---|
[985] | 146 | # The OSes, Architectures and CPUs that kBuild recognizes.
|
---|
[978] | 147 | #
|
---|
| 148 | # When kBuild is ported to a new OS or architecture a unique keyword needs
|
---|
| 149 | # to be assigned to it and added here. This strictness is required because
|
---|
| 150 | # this keyword namespace is shared between OSes, architectures, cpus and
|
---|
[984] | 151 | # build types. (PORTME)
|
---|
[978] | 152 | #
|
---|
[985] | 153 | KBUILD_OSES := darwin freebsd l4 linux netbsd nt openbsd os2 solaris win
|
---|
[1381] | 154 | KBUILD_ARCHES := x86 amd64 sparc32 sparc64 s390 s390x ppc32 ppc64 mips32 mips64 ia64 hppa32 hppa64 arm alpha
|
---|
[978] | 155 |
|
---|
| 156 |
|
---|
| 157 | #
|
---|
[585] | 158 | # Set default build type.
|
---|
[69] | 159 | #
|
---|
| 160 | ifndef BUILD_TYPE
|
---|
[978] | 161 | BUILD_TYPE := release
|
---|
| 162 | else
|
---|
[1388] | 163 | if1of ($(BUILD_TYPE), $(KBUILD_OSES) $(KBUILD_ARCHES))
|
---|
[978] | 164 | $(error kBuild: The BUILD_TYPE value '$(BUILD_TYPE)' is an OS or architecture!)
|
---|
[585] | 165 | endif
|
---|
[978] | 166 | ifneq (.$(words $(BUILD_TYPE)).$(BUILD_TYPE).,.1.$(strip $(BUILD_TYPE)).)
|
---|
| 167 | $(error kBuild: The BUILD_TYPE value '$(BUILD_TYPE)' contains spaces/tabs!)
|
---|
| 168 | endif
|
---|
[72] | 169 | endif
|
---|
[69] | 170 |
|
---|
| 171 |
|
---|
| 172 | #
|
---|
[978] | 173 | # Assert valid build platform variables.
|
---|
[70] | 174 | #
|
---|
[978] | 175 | # All these are set by kmk so they shouldn't be any trouble
|
---|
| 176 | # unless the user starts messing about with environment variables.
|
---|
| 177 | #
|
---|
| 178 | ifneq (.$(words $(BUILD_PLATFORM)).$(BUILD_PLATFORM).,.1.$(strip $(BUILD_PLATFORM)).)
|
---|
| 179 | $(error kBuild: The BUILD_PLATFORM value '$(BUILD_PLATFORM)' contains spaces/tabs!)
|
---|
[72] | 180 | endif
|
---|
[978] | 181 | ifneq ($(words $(filter $(BUILD_PLATFORM),$(KBUILD_OSES))),1)
|
---|
| 182 | $(error kBuild: BUILD_PLATFORM value '$(BUILD_PLATFORM)' is not recognized (valid: $(KBUILD_OSES)))
|
---|
| 183 | endif
|
---|
[70] | 184 |
|
---|
[980] | 185 | ifneq (.$(words $(BUILD_PLATFORM_ARCH)).$(BUILD_PLATFORM_ARCH).,.1.$(strip $(BUILD_PLATFORM_ARCH)).)
|
---|
[978] | 186 | $(error kBuild: The BUILD_PLATFORM_ARCH value '$(BUILD_PLATFORM_ARCH)' contains spaces/tabs!)
|
---|
[329] | 187 | endif
|
---|
[978] | 188 | ifneq ($(words $(filter $(BUILD_PLATFORM_ARCH),$(KBUILD_ARCHES))),1)
|
---|
| 189 | $(error kBuild: BUILD_PLATFORM_ARCH value '$(BUILD_PLATFORM_ARCH)' is not recognized (valid: $(KBUILD_ARCHES)))
|
---|
[329] | 190 | endif
|
---|
[72] | 191 |
|
---|
[978] | 192 | ifeq ($(strip $(BUILD_PLATFORM_CPU)),)
|
---|
[994] | 193 | BUILD_PLATFORM_CPU := blend
|
---|
| 194 | else
|
---|
| 195 | ifneq (.$(words $(BUILD_PLATFORM_CPU)).$(BUILD_PLATFORM_CPU).,.1.$(strip $(BUILD_PLATFORM_CPU)).)
|
---|
| 196 | $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' contains spaces/tabs!)
|
---|
| 197 | endif
|
---|
[1348] | 198 | if1of ($(BUILD_PLATFORM_CPU), $(KBUILD_OSES) $(BUILD_ARCHES))
|
---|
[994] | 199 | $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' was found in the OS or architecture keywords!)
|
---|
| 200 | endif
|
---|
| 201 | ifeq ($(BUILD_PLATFORM_CPU),$(BUILD_TYPE))
|
---|
| 202 | $(error kBuild: The BUILD_PLATFORM_CPU value '$(BUILD_PLATFORM_CPU)' is the same as the BUILD_TYPE!)
|
---|
| 203 | endif
|
---|
[978] | 204 | endif
|
---|
[72] | 205 |
|
---|
[978] | 206 |
|
---|
[70] | 207 | #
|
---|
[978] | 208 | # Assert or set default target platform.
|
---|
| 209 | # When not defined use the corresponding BUILD_PLATFORM value.
|
---|
[72] | 210 | #
|
---|
| 211 | ifndef BUILD_TARGET
|
---|
[978] | 212 | BUILD_TARGET := $(BUILD_PLATFORM)
|
---|
[72] | 213 | else
|
---|
[980] | 214 | ifneq (.$(words $(BUILD_TARGET)).$(BUILD_TARGET).,.1.$(strip $(BUILD_TARGET)).)
|
---|
[978] | 215 | $(error kBuild: The BUILD_TARGET value '$(BUILD_TARGET)' contains spaces/tabs!)
|
---|
[478] | 216 | endif
|
---|
[978] | 217 | ifneq ($(words $(filter $(BUILD_TARGET),$(KBUILD_OSES))),1)
|
---|
| 218 | $(error kBuild: BUILD_TARGET value '$(BUILD_TARGET)' is not recognized (valid: $(KBUILD_OSES)))
|
---|
| 219 | endif
|
---|
[72] | 220 | endif
|
---|
| 221 |
|
---|
[329] | 222 | ifndef BUILD_TARGET_ARCH
|
---|
[978] | 223 | BUILD_TARGET_ARCH := $(BUILD_PLATFORM_ARCH)
|
---|
| 224 | else
|
---|
[980] | 225 | ifneq (.$(words $(BUILD_TARGET_ARCH)).$(BUILD_TARGET_ARCH).,.1.$(strip $(BUILD_TARGET_ARCH)).)
|
---|
[978] | 226 | $(error kBuild: The BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)' contains spaces/tabs!)
|
---|
| 227 | endif
|
---|
| 228 | ifneq ($(words $(filter $(BUILD_TARGET_ARCH),$(KBUILD_ARCHES))),1)
|
---|
| 229 | $(error kBuild: BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)' is not recognized (valid: $(KBUILD_ARCHES)))
|
---|
| 230 | endif
|
---|
[329] | 231 | endif
|
---|
[978] | 232 |
|
---|
[329] | 233 | ifndef BUILD_TARGET_CPU
|
---|
[978] | 234 | BUILD_TARGET_CPU := $(BUILD_PLATFORM_CPU)
|
---|
[994] | 235 | else ifeq ($(strip $(BUILD_TARGET_CPU)),)
|
---|
| 236 | ifeq ($(BUILD_TARGET_ARCH),$(BUILD_PLATFORM_ARCH))
|
---|
| 237 | BUILD_TARGET_CPU := $(BUILD_PLATFORM_CPU)
|
---|
| 238 | else
|
---|
| 239 | BUILD_TARGET_CPU := blend
|
---|
| 240 | endif
|
---|
[978] | 241 | else
|
---|
| 242 | ifneq (.$(words $(BUILD_TARGET_CPU)).$(BUILD_TARGET_CPU).,.1.$(strip $(BUILD_TARGET_CPU)).)
|
---|
| 243 | $(error kBuild: The BUILD_TARGET_CPU value '$(BUILD_TARGET_CPU)' contains spaces/tabs!)
|
---|
| 244 | endif
|
---|
[1348] | 245 | if1of ($(BUILD_TARGET_CPU), $(KBUILD_OSES) $(BUILD_ARCHES))
|
---|
[978] | 246 | $(error kBuild: The BUILD_TARGET_CPU value was found in the OS or architecture keywords!)
|
---|
| 247 | endif
|
---|
| 248 | ifeq ($(BUILD_TARGET_CPU),$(BUILD_TYPE))
|
---|
| 249 | $(error kBuild: The BUILD_TARGET_CPU value '$(BUILD_TARGET_CPU)' is the same as the BUILD_TYPE!)
|
---|
| 250 | endif
|
---|
[329] | 251 | endif
|
---|
[72] | 252 |
|
---|
| 253 |
|
---|
| 254 | #
|
---|
[978] | 255 | # Paths and stuff.
|
---|
[69] | 256 | #
|
---|
[978] | 257 |
|
---|
| 258 | # Adjust DEPTH first.
|
---|
| 259 | DEPTH := $(strip $(DEPTH))
|
---|
| 260 | ifeq ($(DEPTH),)
|
---|
| 261 | DEPTH := .
|
---|
| 262 | endif
|
---|
| 263 |
|
---|
[725] | 264 | ## PATH_CURRENT is the current directory (getcwd).
|
---|
[306] | 265 | PATH_CURRENT := $(abspath $(CURDIR))
|
---|
[725] | 266 | ## PATH_SUB_CURRENT points to current directory of the current makefile.
|
---|
| 267 | # Meaning that it will change value as we enter and exit sub-makefiles.
|
---|
| 268 | PATH_SUB_CURRENT := $(PATH_CURRENT)
|
---|
| 269 | ## PATH_ROOT points to the project root directory.
|
---|
| 270 | PATH_ROOT := $(abspath $(PATH_CURRENT)/$(DEPTH))
|
---|
| 271 | ## PATH_SUB_ROOT points to the directory of the top-level makefile.
|
---|
[472] | 272 | ifneq ($(strip $(SUB_DEPTH)),)
|
---|
[978] | 273 | SUB_DEPTH := $(strip $(SUB_DEPTH))
|
---|
[725] | 274 | PATH_SUB_ROOT := $(abspath $(PATH_CURRENT)/$(SUB_DEPTH))
|
---|
[472] | 275 | else
|
---|
[725] | 276 | PATH_SUB_ROOT := $(PATH_CURRENT)
|
---|
[472] | 277 | endif
|
---|
[306] | 278 |
|
---|
[748] | 279 | ## CURSUBDIR is PATH_SUB_ROOT described relative to PATH_ROOT.
|
---|
[725] | 280 | # This variable is used to determin where the object files and other output goes.
|
---|
[1390] | 281 | ifneq ($(PATH_ROOT),$(PATH_SUB_ROOT))
|
---|
| 282 | CURSUBDIR := $(patsubst $(PATH_ROOT)/%,%,$(PATH_SUB_ROOT))
|
---|
[266] | 283 | else
|
---|
[1390] | 284 | CURSUBDIR := .
|
---|
[266] | 285 | endif
|
---|
[306] | 286 |
|
---|
[70] | 287 | # Output directories.
|
---|
[242] | 288 | ifndef PATH_OUT_BASE
|
---|
[725] | 289 | PATH_OUT_BASE := $(PATH_ROOT)/out
|
---|
[242] | 290 | endif
|
---|
[240] | 291 | ifndef PATH_OUT
|
---|
[725] | 292 | ifdef BUILD_TARGET_SUB # (BUILD_TARGET_SUB is not currently recognized by kBuild in any other places.)
|
---|
| 293 | PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH).$(BUILD_TARGET_SUB)/$(BUILD_TYPE)
|
---|
| 294 | else
|
---|
| 295 | PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/$(BUILD_TYPE)
|
---|
| 296 | endif
|
---|
[329] | 297 | endif # !define PATH_OUT
|
---|
[1051] | 298 | PATH_OBJCACHE = $(PATH_OUT_BASE)/kObjCache
|
---|
[353] | 299 | PATH_OBJ = $(PATH_OUT)/obj
|
---|
| 300 | PATH_TARGET = $(PATH_OBJ)/$(CURSUBDIR)
|
---|
| 301 | PATH_INS = $(PATH_OUT)
|
---|
| 302 | PATH_BIN = $(PATH_INS)/bin
|
---|
| 303 | PATH_DLL = $(PATH_INS)/bin
|
---|
| 304 | PATH_SYS = $(PATH_INS)/bin
|
---|
| 305 | PATH_LIB = $(PATH_INS)/lib
|
---|
| 306 | PATH_DOC = $(PATH_INS)/doc
|
---|
[70] | 307 |
|
---|
[978] | 308 | # PATH_KBUILD is determined by kmk.
|
---|
| 309 | ifeq ($(strip $(PATH_KBUILD)),)
|
---|
| 310 | $(error kBuild: PATH_KBUILD is missing or empty! kmk is supposed to set it.)
|
---|
[70] | 311 | endif
|
---|
[978] | 312 | # PATH_KBUILD_BIN is determined by kmk.
|
---|
| 313 | ifeq ($(strip $(PATH_KBUILD_BIN)),)
|
---|
| 314 | $(error kBuild: PATH_KBUILD_BIN is missing or empty! kmk is supposed to set it.)
|
---|
| 315 | endif
|
---|
| 316 |
|
---|
[69] | 317 | # kBuild files which might be of interest.
|
---|
| 318 | FILE_KBUILD_HEADER := $(PATH_KBUILD)/header.kmk
|
---|
[725] | 319 | #FILE_KBUILD_CONFIG := $(PATH_KBUILD)/config.kmk
|
---|
[69] | 320 | FILE_KBUILD_FOOTER := $(PATH_KBUILD)/footer.kmk
|
---|
| 321 |
|
---|
[725] | 322 | ## MAKEFILE is the name of the main makefile.
|
---|
[204] | 323 | MAKEFILE := $(firstword $(MAKEFILE_LIST))
|
---|
[748] | 324 | ## MAKEFILE_CURRENT is the name of the current makefile.
|
---|
[725] | 325 | # This is updated everything a sub-makefile is included.
|
---|
| 326 | MAKEFILE_CURRENT := $(MAKEFILE)
|
---|
[69] | 327 |
|
---|
[72] | 328 |
|
---|
[69] | 329 | #
|
---|
[72] | 330 | # Build platform setup.
|
---|
[984] | 331 | # (PORTME)
|
---|
[69] | 332 | #
|
---|
[984] | 333 |
|
---|
[69] | 334 | # OS/2
|
---|
[72] | 335 | ifeq ($(BUILD_PLATFORM),os2)
|
---|
[83] | 336 | EXEC_X86_WIN32 := innopec.exe
|
---|
[69] | 337 | HOSTSUFF_EXE := .exe
|
---|
| 338 | endif
|
---|
| 339 |
|
---|
| 340 | # Linux
|
---|
[72] | 341 | ifeq ($(BUILD_PLATFORM),linux)
|
---|
[135] | 342 | EXEC_X86_WIN32 := wine
|
---|
[69] | 343 | HOSTSUFF_EXE :=
|
---|
| 344 | endif
|
---|
[70] | 345 |
|
---|
[547] | 346 | # Win, Win32, Win64, NT.
|
---|
[1388] | 347 | if1of ($(BUILD_PLATFORM), win nt)
|
---|
[69] | 348 | EXEC_X86_WIN32 :=
|
---|
| 349 | HOSTSUFF_EXE := .exe
|
---|
| 350 | endif
|
---|
| 351 |
|
---|
[299] | 352 | # FreeBSD
|
---|
| 353 | ifeq ($(BUILD_PLATFORM),freebsd)
|
---|
| 354 | EXEC_X86_WIN32 := wine
|
---|
| 355 | HOSTSUFF_EXE :=
|
---|
| 356 | endif
|
---|
[125] | 357 |
|
---|
[557] | 358 | # Darwin / Mac OS X
|
---|
| 359 | ifeq ($(BUILD_PLATFORM),darwin)
|
---|
| 360 | EXEC_X86_WIN32 := false
|
---|
| 361 | HOSTSUFF_EXE :=
|
---|
| 362 | endif
|
---|
| 363 |
|
---|
[811] | 364 | # Solaris
|
---|
| 365 | ifeq ($(BUILD_PLATFORM),solaris)
|
---|
| 366 | EXEC_X86_WIN32 := false
|
---|
| 367 | HOSTSUFF_EXE :=
|
---|
| 368 | endif
|
---|
| 369 |
|
---|
[299] | 370 |
|
---|
[73] | 371 | #
|
---|
| 372 | # Build target setup.
|
---|
[984] | 373 | # (PORTME)
|
---|
[73] | 374 | #
|
---|
[1388] | 375 | SUFF_DEP := .dep
|
---|
| 376 | if1of ($(BUILD_TARGET), win nt os2)
|
---|
| 377 | SUFF_OBJ := .obj
|
---|
| 378 | SUFF_LIB := .lib
|
---|
| 379 | SUFF_DLL := .dll
|
---|
| 380 | SUFF_EXE := .exe
|
---|
| 381 | SUFF_SYS := .sys
|
---|
| 382 | SUFF_RES := .res
|
---|
| 383 | else ifeq ($(BUILD_TARGET),l4)
|
---|
| 384 | SUFF_OBJ := .o
|
---|
| 385 | SUFF_LIB := .a
|
---|
| 386 | SUFF_DLL := .s.so
|
---|
| 387 | SUFF_EXE :=
|
---|
| 388 | SUFF_SYS := .a
|
---|
| 389 | SUFF_RES :=
|
---|
| 390 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
| 391 | SUFF_OBJ := .o
|
---|
| 392 | SUFF_LIB := .a
|
---|
| 393 | SUFF_DLL := .dylib
|
---|
| 394 | SUFF_EXE :=
|
---|
| 395 | SUFF_SYS :=
|
---|
| 396 | SUFF_RES :=
|
---|
| 397 | else
|
---|
| 398 | SUFF_OBJ := .o
|
---|
| 399 | SUFF_LIB := .a
|
---|
| 400 | SUFF_DLL := .so
|
---|
| 401 | SUFF_EXE :=
|
---|
| 402 | if1of ($(BUILD_TARGET), freebsd linux netbsd openbsd) ## @todo check netbsd and openbsd.
|
---|
[1389] | 403 | SUFF_SYS := .ko
|
---|
[1388] | 404 | else
|
---|
[1389] | 405 | SUFF_SYS :=
|
---|
| 406 | endif
|
---|
[1388] | 407 | SUFF_RES :=
|
---|
[73] | 408 | endif
|
---|
[69] | 409 |
|
---|
| 410 | #
|
---|
| 411 | # Standard kBuild tools.
|
---|
| 412 | #
|
---|
[978] | 413 | ifeq ($(KMK),kmk)
|
---|
| 414 | KMK := $(PATH_KBUILD_BIN)/kmk$(HOSTSUFF_EXE)
|
---|
[233] | 415 | endif
|
---|
[978] | 416 | MAKE := $(KMK)
|
---|
[233] | 417 |
|
---|
[1378] | 418 | GMAKE := $(PATH_KBUILD_BIN)/kmk_gmake$(HOSTSUFF_EXE)
|
---|
| 419 |
|
---|
[578] | 420 | DEP_EXT := $(PATH_KBUILD_BIN)/kDep$(HOSTSUFF_EXE)
|
---|
[1388] | 421 | if1of (kDep, $(KMK_BUILTIN))
|
---|
[397] | 422 | DEP := kmk_builtin_kDep
|
---|
[230] | 423 | else
|
---|
[380] | 424 | DEP := $(DEP_EXT)
|
---|
[230] | 425 | endif
|
---|
[69] | 426 |
|
---|
[578] | 427 | DEP_IDB_EXT := $(PATH_KBUILD_BIN)/kDepIDB$(HOSTSUFF_EXE)
|
---|
[1388] | 428 | if1of (kDepIDB, $(KMK_BUILTIN))
|
---|
[1004] | 429 | DEP_IDB := kmk_builtin_kDepIDB
|
---|
[397] | 430 | else
|
---|
| 431 | DEP_IDB := $(DEP_IDB_EXT)
|
---|
| 432 | endif
|
---|
| 433 |
|
---|
[578] | 434 | DEP_PRE_EXT := $(PATH_KBUILD_BIN)/kDepPre$(HOSTSUFF_EXE)
|
---|
[1388] | 435 | if1of (kDepPre, $(KMK_BUILTIN))
|
---|
[1004] | 436 | DEP_PRE := kmk_builtin_kDepPre
|
---|
[380] | 437 | else
|
---|
| 438 | DEP_PRE := $(DEP_PRE_EXT)
|
---|
| 439 | endif
|
---|
| 440 |
|
---|
[1004] | 441 | KOBJCACHE_EXT := $(PATH_KBUILD_BIN)/kObjCache$(HOSTSUFF_EXE)
|
---|
[1388] | 442 | if1of (kObjCache, $(KMK_BUILTIN))
|
---|
[1004] | 443 | KOBJCACHE := kmk_builtin_kObjCache
|
---|
| 444 | else
|
---|
| 445 | KOBJCACHE := $(KOBJCACHE_EXT)
|
---|
| 446 | endif
|
---|
| 447 |
|
---|
[578] | 448 | APPEND_EXT := $(PATH_KBUILD_BIN)/kmk_append$(HOSTSUFF_EXE)
|
---|
[380] | 449 | APPEND := kmk_builtin_append
|
---|
[69] | 450 |
|
---|
[578] | 451 | CAT_EXT := $(PATH_KBUILD_BIN)/kmk_cat$(HOSTSUFF_EXE)
|
---|
[380] | 452 | CAT := kmk_builtin_cat
|
---|
[353] | 453 |
|
---|
[1118] | 454 | CMP_EXT := $(PATH_KBUILD_BIN)/kmk_cmp$(HOSTSUFF_EXE)
|
---|
| 455 | CMP := kmk_builtin_cmp
|
---|
| 456 |
|
---|
[1119] | 457 | CP_EXT := $(PATH_KBUILD_BIN)/kmk_cp$(HOSTSUFF_EXE)
|
---|
| 458 | CP := kmk_builtin_cp
|
---|
| 459 |
|
---|
[578] | 460 | ECHO_EXT := $(PATH_KBUILD_BIN)/kmk_echo$(HOSTSUFF_EXE)
|
---|
[380] | 461 | ECHO := kmk_builtin_echo
|
---|
| 462 |
|
---|
[578] | 463 | INSTALL_EXT := $(PATH_KBUILD_BIN)/kmk_install$(HOSTSUFF_EXE)
|
---|
[380] | 464 | INSTALL := kmk_builtin_install
|
---|
| 465 |
|
---|
[578] | 466 | LN_EXT := $(PATH_KBUILD_BIN)/kmk_ln$(HOSTSUFF_EXE)
|
---|
[380] | 467 | LN := kmk_builtin_ln
|
---|
| 468 |
|
---|
[1118] | 469 | MD5SUM_EXT := $(PATH_KBUILD_BIN)/kmk_md5sum$(HOSTSUFF_EXE)
|
---|
| 470 | MD5SUM := kmk_builtin_md5sum
|
---|
| 471 |
|
---|
[578] | 472 | MKDIR_EXT := $(PATH_KBUILD_BIN)/kmk_mkdir$(HOSTSUFF_EXE)
|
---|
[380] | 473 | MKDIR := kmk_builtin_mkdir
|
---|
| 474 |
|
---|
[578] | 475 | MV_EXT := $(PATH_KBUILD_BIN)/kmk_mv$(HOSTSUFF_EXE)
|
---|
[380] | 476 | MV := kmk_builtin_mv
|
---|
| 477 |
|
---|
[776] | 478 | PRINTF_EXT := $(PATH_KBUILD_BIN)/kmk_printf$(HOSTSUFF_EXE)
|
---|
| 479 | PRINTF := kmk_builtin_printf
|
---|
| 480 |
|
---|
[1272] | 481 | REDIRECT_EXT:= $(PATH_KBUILD_BIN)/kmk_redirect$(HOSTSUFF_EXE)
|
---|
[1388] | 482 | if1of (redirect, $(KMK_BUILTIN))
|
---|
[1272] | 483 | REDIRECT := kmk_builtin_redirect
|
---|
| 484 | else
|
---|
| 485 | REDIRECT := $(REDIRECT_EXT)
|
---|
| 486 | endif
|
---|
| 487 |
|
---|
[578] | 488 | RM_EXT := $(PATH_KBUILD_BIN)/kmk_rm$(HOSTSUFF_EXE)
|
---|
[380] | 489 | RM := kmk_builtin_rm
|
---|
| 490 |
|
---|
[601] | 491 | RMDIR_EXT := $(PATH_KBUILD_BIN)/kmk_rmdir$(HOSTSUFF_EXE)
|
---|
| 492 | RMDIR := kmk_builtin_rmdir
|
---|
| 493 |
|
---|
[578] | 494 | SED_EXT := $(PATH_KBUILD_BIN)/kmk_sed$(HOSTSUFF_EXE)
|
---|
[1272] | 495 | if1of (sed, $(KMK_BUILTIN))
|
---|
[978] | 496 | SED_INT := kmk_builtin_sed
|
---|
[380] | 497 | else
|
---|
[978] | 498 | SED_INT := $(SED_EXT)
|
---|
| 499 | endif
|
---|
[380] | 500 | SED := $(SED_EXT)
|
---|
| 501 |
|
---|
[1296] | 502 | TEST_EXT := $(PATH_KBUILD_BIN)/kmk_test$(HOSTSUFF_EXE)
|
---|
| 503 | TEST := kmk_builtin_test
|
---|
| 504 |
|
---|
[380] | 505 | # Our default shell is the Almquist shell from *BSD.
|
---|
[578] | 506 | ASH := $(PATH_KBUILD_BIN)/kmk_ash$(HOSTSUFF_EXE)
|
---|
[380] | 507 | MAKESHELL := $(ASH)
|
---|
| 508 | SHELL := $(ASH)
|
---|
| 509 | export SHELL MAKESHELL
|
---|
| 510 |
|
---|
[414] | 511 | # Symlinking is problematic on some platforms...
|
---|
[380] | 512 | LN_SYMLINK := $(LN) -s
|
---|
| 513 |
|
---|
[743] | 514 |
|
---|
| 515 | #
|
---|
| 516 | # Some Functions.
|
---|
[748] | 517 | # The lower cased ones are either fallbacks or candidates for functions.c.
|
---|
[743] | 518 | #
|
---|
| 519 |
|
---|
[130] | 520 | ## ABSPATH - make paths absolute.
|
---|
[129] | 521 | # This implementation is clumsy and doesn't resolve '..' and '.' components.
|
---|
[73] | 522 | #
|
---|
[129] | 523 | # @param $1 The paths to make absolute.
|
---|
[696] | 524 | # @obsolete Use the GNU make function $(abspath) directly now.
|
---|
[984] | 525 | ABSPATH = $(abspath $(1))$(warning ABSPATH is deprecated, use abspath directly!)
|
---|
[353] | 526 |
|
---|
[130] | 527 | ## DIRDEP - make create directory dependencies.
|
---|
| 528 | #
|
---|
| 529 | # @param $1 The paths to the directories which must be created.
|
---|
[353] | 530 | DIRDEP = $(foreach path,$(patsubst %/,%,$(1)),$(path)/)
|
---|
[129] | 531 |
|
---|
| 532 | ## Cygwin kludge.
|
---|
| 533 | # This converts /cygdrive/x/% to x:%.
|
---|
| 534 | #
|
---|
| 535 | # @param $1 The paths to make native.
|
---|
| 536 | # @remark This macro is pretty much obsolete since we don't use cygwin base make.
|
---|
| 537 | ifneq ($(patsubst /cygdrive/%,%,$(CURDIR)),$(CURDIR))
|
---|
[743] | 538 | CYGPATHMIXED = $(foreach path,$(1)\
|
---|
[129] | 539 | ,$(if $(patsubst /cygdrive/%,,$(path)),$(path),$(patsubst $(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path)))))/%,$(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path))))):/%,$(patsubst /cygdrive/%,%,$(path)))))
|
---|
| 540 | else
|
---|
[743] | 541 | CYGPATHMIXED = $(1)
|
---|
[129] | 542 | endif
|
---|
| 543 |
|
---|
[743] | 544 | ## Removes the drive letter from a path (if it has one)
|
---|
| 545 | # @param $1 the path
|
---|
| 546 | no-drive = $(word $(words $(subst :, ,$(1))),$(subst :, ,$(1)))
|
---|
[723] | 547 |
|
---|
[743] | 548 | ## Removes the root slash from a path (if it has one)
|
---|
| 549 | # @param $1 the path
|
---|
| 550 | no-root-slash = $(patsubst /%,%,$(1))
|
---|
[723] | 551 |
|
---|
[743] | 552 | ## Figure out where to put object files.
|
---|
| 553 | # @param $1 real target name.
|
---|
| 554 | # @param $2 normalized main target
|
---|
[748] | 555 | TARGET_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(1)))
|
---|
[723] | 556 |
|
---|
[743] | 557 | ## Figure out where to put object files.
|
---|
| 558 | # @param $1 normalized main target
|
---|
| 559 | TARGET_PATH = $(PATH_TARGET)/$(1)
|
---|
[723] | 560 |
|
---|
| 561 |
|
---|
[129] | 562 | #
|
---|
[353] | 563 | # Initialize some of the globals which the Config.kmk and
|
---|
| 564 | # others can add stuff to if they like for processing in the footer.
|
---|
| 565 | #
|
---|
| 566 |
|
---|
[1416] | 567 | ## KBUILD_TEMPLATE_PATHS
|
---|
[353] | 568 | # List a paths (separated by space) where templates can be found.
|
---|
[1416] | 569 | KBUILD_TEMPLATE_PATHS :=
|
---|
[353] | 570 |
|
---|
[1416] | 571 | ## KBUILD_TOOL_PATHS
|
---|
[353] | 572 | # List of paths (separated by space) where tools can be found.
|
---|
[1416] | 573 | KBUILD_TOOL_PATHS :=
|
---|
[353] | 574 |
|
---|
[1416] | 575 | ## KBUILD_SDK_PATHS
|
---|
[353] | 576 | # List of paths (separated by space) where SDKs can be found.
|
---|
[1416] | 577 | KBUILD_SDK_PATHS :=
|
---|
[353] | 578 |
|
---|
[1416] | 579 | ## KBUILD_DEFAULT_PATHS
|
---|
| 580 | # List of paths (separated by space) to search for stuff as a last resort.
|
---|
| 581 | KBUILD_DEFAULT_PATHS :=
|
---|
| 582 |
|
---|
[353] | 583 | ## Proritized list of the default makefile when walking subdirectories.
|
---|
| 584 | # The user can overload this list.
|
---|
| 585 | DEFAULT_MAKEFILE := Makefile.kmk makefile.kmk Makefile makefile
|
---|
| 586 |
|
---|
[1424] | 587 | ## KBUILD_SRC_HANDLERS
|
---|
| 588 | # The list of source handlers, pair of extension and handler.
|
---|
| 589 | # The user can overload this list to provide additional or custom
|
---|
| 590 | # handlers. On a per-target/template see SRC_HANDLERS.
|
---|
| 591 | KBUILD_SRC_HANDLERS := \
|
---|
| 592 | .c:def_src_handler_c \
|
---|
| 593 | .C:def_src_handler_c \
|
---|
| 594 | .cxx:def_src_handler_cxx \
|
---|
| 595 | .CXX:def_src_handler_cxx \
|
---|
| 596 | .cpp:def_src_handler_cxx \
|
---|
| 597 | .CPP:def_src_handler_cxx \
|
---|
| 598 | .cc:def_src_handler_cxx \
|
---|
| 599 | .CC:def_src_handler_cxx \
|
---|
| 600 | .m:def_src_handler_objc \
|
---|
| 601 | .asm:def_src_handler_asm \
|
---|
| 602 | .ASM:def_src_handler_asm \
|
---|
| 603 | .s:def_src_handler_asm \
|
---|
| 604 | .S:def_src_handler_asm \
|
---|
| 605 | .rc:def_src_handler_rc \
|
---|
| 606 | .obj:def_src_handler_obj \
|
---|
| 607 | .o:def_src_handler_obj \
|
---|
[1435] | 608 | .res:def_src_handler_obj
|
---|
[980] | 609 |
|
---|
[640] | 610 | ## PROPS_TOOLS
|
---|
[985] | 611 | # This is a subset of PROPS_SINGLE.
|
---|
[1256] | 612 | PROPS_TOOLS := TOOL CTOOL CXXTOOL OBJCTOOL ASTOOL RCTOOL ARTOOL LDTOOL FETCHTOOL UNPACKTOOL PATCHTOOL
|
---|
[640] | 613 |
|
---|
[353] | 614 | ## PROPS_SINGLE
|
---|
| 615 | # The list of non-accumulative target properties.
|
---|
| 616 | # A Config.kmk file can add it's own properties to this list and kBuild
|
---|
[1400] | 617 | # will do the necessary inheritance for templates, sdks, tools and targets.
|
---|
| 618 | PROPS_SINGLE := $(PROPS_TOOLS) TEMPLATE INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU FETCHDIR \
|
---|
[1256] | 619 | OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF ASOBJSUFF RCOBJSUFF SYSSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF
|
---|
[985] | 620 | ## PROPS_SINGLE_LNK
|
---|
| 621 | # Subset of PROPS_SINGLE which applies to all linkable targets.
|
---|
[1400] | 622 | PROPS_SINGLE_LNK := TOOL TEMPLATE CTOOL CXXTOOL OBJCTOOL ASTOOL RCTOOL \
|
---|
[985] | 623 | INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \
|
---|
[1256] | 624 | OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF ASOBJSUFF RCOBJSUFF
|
---|
[353] | 625 |
|
---|
| 626 | ## PROPS_DEFERRED
|
---|
[889] | 627 | # This list of non-accumulative target properties which are or may be
|
---|
| 628 | # functions, and thus should not be expanded until the very last moment.
|
---|
[985] | 629 | PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS NAME SONAME
|
---|
[353] | 630 |
|
---|
[660] | 631 | ## PROPS_ACCUMULATE_R
|
---|
[748] | 632 | # The list of accumulative target properties where the right most value/flag
|
---|
[660] | 633 | # is the 'most significant'.
|
---|
[353] | 634 | # A Config.kmk file can add it's own properties to this list and kBuild
|
---|
| 635 | # will do the necessary inheritance from templates to targets.
|
---|
[660] | 636 | PROPS_ACCUMULATE_R := \
|
---|
[985] | 637 | DEPS ORDERDEPS DEFS \
|
---|
| 638 | ARFLAGS \
|
---|
[660] | 639 | CFLAGS CDEFS \
|
---|
| 640 | CXXFLAGS CXXDEFS \
|
---|
[1256] | 641 | OBJCFLAGS OBJCDEFS \
|
---|
[660] | 642 | ASFLAGS ASDEFS \
|
---|
| 643 | RCFLAGS RCDEFS \
|
---|
| 644 | LDFLAGS \
|
---|
[830] | 645 | IDFLAGS IFDLAGS ISFLAGS \
|
---|
[640] | 646 | FETCHFLAGS UNPACKFLAGS PATCHFLAGS
|
---|
[985] | 647 | ## PROPS_ACCUMULATE_R_LNK
|
---|
| 648 | # Subset of PROPS_ACCUMULATE_R which applies to all linkable targets.
|
---|
| 649 | PROPS_ACCUMULATE_R_LNK := \
|
---|
| 650 | DEPS ORDERDEPS DEFS \
|
---|
| 651 | CFLAGS CDEFS \
|
---|
| 652 | CXXFLAGS CXXDEFS \
|
---|
[1256] | 653 | OBJCFLAGS OBJCDEFS \
|
---|
[985] | 654 | ASFLAGS ASDEFS \
|
---|
| 655 | RCFLAGS RCDEFS \
|
---|
| 656 | IDFLAGS IFDLAGS ISFLAGS
|
---|
[353] | 657 |
|
---|
[660] | 658 | ## PROPS_ACCUMULATE
|
---|
[748] | 659 | # The list of accumulative target properties where the left most value/flag
|
---|
[660] | 660 | # is the 'most significant'.
|
---|
| 661 | # A Config.kmk file can add it's own properties to this list and kBuild
|
---|
| 662 | # will do the necessary inheritance from templates to targets.
|
---|
| 663 | PROPS_ACCUMULATE_L := \
|
---|
[1426] | 664 | SDKS SOURCES SRC_HANDLERS INTERMEDIATES \
|
---|
[1256] | 665 | INCS CINCS CXXINCS OBJCINCS ASINCS RCINCS \
|
---|
[897] | 666 | LIBS LIBPATH \
|
---|
[985] | 667 | DIRS BLDDIRS CLEAN
|
---|
| 668 | ## PROPS_ACCUMULATE_L_LNK
|
---|
| 669 | # Subset of PROPS_ACCUMULATE_L which applies to all linkable targets.
|
---|
| 670 | PROPS_ACCUMULATE_L_LNK := \
|
---|
[1424] | 671 | SDKS SOURCES SRC_HANDLERS \
|
---|
[1256] | 672 | INCS CINCS CXXINCS OBJCINCS ASINCS RCINCS \
|
---|
[985] | 673 | BLDDIRS CLEAN
|
---|
[353] | 674 |
|
---|
[662] | 675 | ## PROPS_ALL
|
---|
| 676 | # List of all the properties.
|
---|
| 677 | PROPS_ALL = $(PROPS_SINGLE) $(PROPS_DEFERRED) $(PROPS_ACCUMULATE_L) $(PROPS_ACCUMULATE_R)
|
---|
[660] | 678 |
|
---|
[662] | 679 |
|
---|
[985] | 680 | ## @name Properties valid on programs (BLDPROGS and PROGRAMS)
|
---|
| 681 | ## @{
|
---|
| 682 | PROPS_PROGRAMS_SINGLE := $(PROPS_SINGLE_LNK) LDTOOL EXESUFF
|
---|
| 683 | PROPS_PROGRAMS_DEFERRED := $(PROPS_DEFERRED)
|
---|
| 684 | PROPS_PROGRAMS_ACCUMULATE_R := $(PROPS_ACCUMULATE_R_LNK) LDFLAGS
|
---|
| 685 | PROPS_PROGRAMS_ACCUMULATE_L := $(PROPS_ACCUMULATE_L_LNK) LIBS LIBPATH
|
---|
| 686 | ## @}
|
---|
| 687 |
|
---|
| 688 | ## @name Properties valid on libraries (LIBRARIES and IMPORT_LIBS)
|
---|
| 689 | ## @{
|
---|
[989] | 690 | PROPS_LIBRARIES_SINGLE := $(PROPS_SINGLE_LNK) ARTOOL LIBSUFF ARLIBSUFF LIBSUFF
|
---|
[985] | 691 | PROPS_LIBRARIES_DEFERRED := $(filter-out SONAME,$(PROPS_DEFERRED))
|
---|
| 692 | PROPS_LIBRARIES_ACCUMULATE_R := $(PROPS_ACCUMULATE_R_LNK) ARFLAGS
|
---|
| 693 | PROPS_LIBRARIES_ACCUMULATE_L := $(PROPS_ACCUMULATE_L_LNK)
|
---|
| 694 | ## @}
|
---|
| 695 |
|
---|
| 696 | ## @name Properties valid on dlls (DLLS)
|
---|
| 697 | ## @{
|
---|
| 698 | PROPS_DLLS_SINGLE := $(PROPS_SINGLE_LNK) LDTOOL DLLSUFF LIBSUFF
|
---|
| 699 | PROPS_DLLS_DEFERRED := $(PROPS_DEFERRED)
|
---|
| 700 | PROPS_DLLS_ACCUMULATE_R := $(PROPS_ACCUMULATE_R_LNK) LDFLAGS
|
---|
| 701 | PROPS_DLLS_ACCUMULATE_L := $(PROPS_ACCUMULATE_L_LNK) LIBS LIBPATH
|
---|
| 702 | ## @}
|
---|
| 703 |
|
---|
[989] | 704 | ## @name Properties valid on system modules (SYSMODS)
|
---|
| 705 | ## @{
|
---|
| 706 | PROPS_SYSMODS_SINGLE := $(PROPS_SINGLE_LNK) LDTOOL SYSSUFF
|
---|
| 707 | PROPS_SYSMODS_DEFERRED := $(PROPS_DEFERRED)
|
---|
| 708 | PROPS_SYSMODS_ACCUMULATE_R := $(PROPS_ACCUMULATE_R_LNK) LDFLAGS
|
---|
| 709 | PROPS_SYSMODS_ACCUMULATE_L := $(PROPS_ACCUMULATE_L_LNK) LIBS LIBPATH
|
---|
| 710 | ## @}
|
---|
| 711 |
|
---|
[985] | 712 | ## @name Properties valid on installs (INSTALLS)
|
---|
| 713 | ## @{
|
---|
[1400] | 714 | PROPS_INSTALLS_SINGLE := TOOL TEMPLATE INST NOINST
|
---|
[985] | 715 | PROPS_INSTALLS_DEFERRED := INSTFUN INSTALLER
|
---|
| 716 | PROPS_INSTALLS_ACCUMULATE_R := DEPS ORDERDEPS
|
---|
| 717 | PROPS_INSTALLS_ACCUMULATE_L := SOURCES DIRS CLEAN
|
---|
| 718 | ## @}
|
---|
| 719 |
|
---|
| 720 | ## @name Properties valid on fetches (INSTALLS)
|
---|
| 721 | ## @{
|
---|
[1400] | 722 | PROPS_FETCHES_SINGLE := TOOL TEMPLATE FETCHTOOL UNPACKTOOL PATCHTOOL INST FETCHDIR
|
---|
[985] | 723 | PROPS_FETCHES_DEFERRED :=
|
---|
| 724 | PROPS_FETCHES_ACCUMULATE_R := FETCHFLAGS UNPACKFLAGS PATCHFLAGS
|
---|
| 725 | PROPS_FETCHES_ACCUMULATE_L := SOURCES
|
---|
| 726 | ## @}
|
---|
| 727 |
|
---|
| 728 |
|
---|
[353] | 729 | #
|
---|
[748] | 730 | # Here is a special 'hack' to prevent innocent environment variables being
|
---|
| 731 | # picked up and treated as properties. (The most annoying example of why
|
---|
[662] | 732 | # this is necessary is the Visual C++ commandline with it's LIBPATH.)
|
---|
| 733 | #
|
---|
[748] | 734 | # Define KBUILD_DONT_KILL_ENV_PROPS in the env. or on the commandline to
|
---|
[662] | 735 | # disable this 'hack'.
|
---|
| 736 | #
|
---|
| 737 | ifndef KBUILD_DONT_KILL_ENV_PROPS
|
---|
| 738 |
|
---|
| 739 | define def_nuke_environment_prop
|
---|
| 740 | ifeq ($(origin $(prop)),environment)
|
---|
| 741 | $(prop) =
|
---|
| 742 | endif
|
---|
| 743 | endef
|
---|
[762] | 744 | $(foreach prop, $(PROPS_ALL) \
|
---|
| 745 | FETCHES PATCHES BLDPROGS LIBRARIES IMPORT_LIBS DLLS PROGRAMS SYSMODS INSTALLS OTHERS \
|
---|
[897] | 746 | SUBDIRS MAKEFILES BLDDIRS \
|
---|
[762] | 747 | ,$(eval $(value def_nuke_environment_prop)))
|
---|
[662] | 748 |
|
---|
[897] | 749 | endif # KBUILD_DONT_KILL_ENV_PROPS
|
---|
[662] | 750 |
|
---|
| 751 |
|
---|
| 752 | #
|
---|
[353] | 753 | # Pass configuration.
|
---|
| 754 | #
|
---|
| 755 | # The PASS_<passname>_trgs variable is listing the targets.
|
---|
| 756 | # The PASS_<passname>_vars variable is listing the target variables.
|
---|
| 757 | # The PASS_<passname>_pass variable is the lowercased passname.
|
---|
| 758 | #
|
---|
| 759 |
|
---|
[640] | 760 | ## PASS: fetches
|
---|
| 761 | # This pass fetches and unpacks things needed to complete the build.
|
---|
| 762 | PASS_FETCHES := Fetches
|
---|
| 763 | PASS_FETCHES_trgs :=
|
---|
| 764 | PASS_FETCHES_vars := _FETCHES
|
---|
| 765 | PASS_FETCHES_pass := fetches
|
---|
| 766 |
|
---|
| 767 | ## PASS: patches
|
---|
| 768 | # This pass applies patches.
|
---|
| 769 | PASS_PATCHES := Patches
|
---|
| 770 | PASS_PATCHES_trgs :=
|
---|
| 771 | PASS_PATCHES_vars := _PATCHES
|
---|
| 772 | PASS_PATCHES_pass := patches
|
---|
| 773 |
|
---|
[353] | 774 | ## PASS: bldprogs
|
---|
| 775 | # This pass builds targets which are required for building the rest.
|
---|
| 776 | PASS_BLDPROGS := Build Programs
|
---|
| 777 | PASS_BLDPROGS_trgs :=
|
---|
| 778 | PASS_BLDPROGS_vars := _BLDPROGS
|
---|
| 779 | PASS_BLDPROGS_pass := bldprogs
|
---|
| 780 |
|
---|
| 781 | ## PASS: libraries
|
---|
| 782 | # This pass builds library targets.
|
---|
| 783 | PASS_LIBRARIES := Libraries
|
---|
| 784 | PASS_LIBRARIES_trgs :=
|
---|
| 785 | PASS_LIBRARIES_vars := _LIBS _IMPORT_LIBS _OTHER_LIBRARIES
|
---|
| 786 | PASS_LIBRARIES_pass := libraries
|
---|
| 787 |
|
---|
| 788 | ## PASS: binaries
|
---|
| 789 | # This pass builds dll targets.
|
---|
| 790 | PASS_DLLS := DLLs
|
---|
| 791 | PASS_DLLS_trgs :=
|
---|
| 792 | PASS_DLLS_vars := _DLLS _OTHER_DLLS
|
---|
| 793 | PASS_DLLS_pass := dlls
|
---|
| 794 |
|
---|
| 795 | ## PASS: binaries
|
---|
| 796 | # This pass builds binary targets, i.e. programs, system modules and stuff.
|
---|
| 797 | PASS_BINARIES := Programs
|
---|
| 798 | PASS_BINARIES_trgs :=
|
---|
| 799 | PASS_BINARIES_vars := _PROGRAMS _SYSMODS _OTHER_BINARIES
|
---|
| 800 | PASS_BINARIES_pass := binaries
|
---|
| 801 |
|
---|
| 802 | ## PASS: others
|
---|
| 803 | # This pass builds other targets.
|
---|
| 804 | PASS_OTHERS := Other Stuff
|
---|
| 805 | PASS_OTHERS_trgs :=
|
---|
| 806 | PASS_OTHERS_vars := _OTHERS
|
---|
| 807 | PASS_OTHERS_pass := others
|
---|
| 808 |
|
---|
| 809 | ## PASS: install
|
---|
| 810 | # This pass installs the built entities to a sandbox area.
|
---|
| 811 | PASS_INSTALLS := Install
|
---|
| 812 | PASS_INSTALLS_trgs :=
|
---|
[854] | 813 | PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS _INSTALLS_FILES
|
---|
[353] | 814 | PASS_INSTALLS_pass := installs
|
---|
| 815 |
|
---|
| 816 | ## PASS: packing
|
---|
| 817 | # This pass processes custom packing rules.
|
---|
| 818 | PASS_PACKING := Packing
|
---|
[414] | 819 | PASS_PACKING_trgs :=
|
---|
[417] | 820 | PASS_PACKING_vars := _PACKING
|
---|
[353] | 821 | PASS_PACKING_pass := packing
|
---|
[414] | 822 | #alias
|
---|
| 823 | packing: pass_packing
|
---|
[353] | 824 |
|
---|
| 825 | ## PASS: clean
|
---|
| 826 | # This pass removes all generated files.
|
---|
| 827 | PASS_CLEAN := Clean
|
---|
| 828 | PASS_CLEAN_trgs := do-clean
|
---|
| 829 | PASS_CLEAN_vars :=
|
---|
| 830 | PASS_CLEAN_pass := clean
|
---|
| 831 | # alias
|
---|
| 832 | clean: pass_clean
|
---|
| 833 |
|
---|
| 834 | ## PASS: nothing
|
---|
| 835 | # This pass just walks the tree.
|
---|
| 836 | PASS_NOTHING := Nothing
|
---|
| 837 | PASS_NOTHING_trgs := do-nothing
|
---|
| 838 | PASS_NOTHING_vars :=
|
---|
| 839 | PASS_NOTHING_pass := nothing
|
---|
| 840 | # alias
|
---|
| 841 | nothing: pass_nothing
|
---|
| 842 |
|
---|
| 843 | ## DEFAULT_PASSES
|
---|
| 844 | # The default passes and their order.
|
---|
| 845 | DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
|
---|
| 846 |
|
---|
| 847 | ## PASSES
|
---|
| 848 | # The passes that should be defined. This must include
|
---|
| 849 | # all passes mentioned by DEFAULT_PASSES.
|
---|
[723] | 850 | PASSES := FETCHES PATCHES $(DEFAULT_PASSES) NOTHING CLEAN
|
---|
[353] | 851 |
|
---|
| 852 |
|
---|
| 853 | #
|
---|
[984] | 854 | # Check for --pretty-command-printing before including the Config.kmk
|
---|
| 855 | # so that anyone overriding the message macros can take the implied
|
---|
| 856 | # verbosity level change into account.
|
---|
| 857 | #
|
---|
| 858 | ifndef KBUILD_VERBOSE
|
---|
| 859 | ifndef KBUILD_QUIET
|
---|
| 860 | ifneq ($(filter --pretty-command-printing,$(MAKEFLAGS)),)
|
---|
| 861 | export KBUILD_VERBOSE := 2
|
---|
| 862 | endif
|
---|
| 863 | endif
|
---|
| 864 | endif
|
---|
| 865 |
|
---|
| 866 |
|
---|
| 867 | #
|
---|
[1418] | 868 | # Legacy variable translation.
|
---|
| 869 | # These will be eliminated when switching to the next version.
|
---|
| 870 | #
|
---|
| 871 | ifdef USE_KOBJCACHE
|
---|
| 872 | ifndef KBUILD_USE_KOBJCACHE
|
---|
| 873 | export KBUILD_USE_KOBJCACHE := $(USE_KOBJCACHE)
|
---|
| 874 | endif
|
---|
| 875 | endif
|
---|
| 876 |
|
---|
| 877 |
|
---|
| 878 | #
|
---|
[69] | 879 | # This is how we find the closest config.kmk.
|
---|
| 880 | # It's a little hacky but I think it works fine.
|
---|
[70] | 881 | #
|
---|
| 882 | _CFGDIR := .
|
---|
[78] | 883 | _CFGFILES := ./Config.kmk ./config.kmk
|
---|
[69] | 884 | define def_include_config
|
---|
[78] | 885 | $(eval _CFGDIR := $(_CFGDIR)/$(dir))
|
---|
| 886 | _CFGFILES += $(_CFGDIR)/Config.kmk $(_CFGDIR)/config.kmk
|
---|
[69] | 887 | endef
|
---|
| 888 | # walk down the _RELATIVE_ path specified by DEPTH.
|
---|
[78] | 889 | $(foreach dir,$(subst /, ,$(DEPTH)), $(eval $(def_include_config)) )
|
---|
[69] | 890 | # add the default config file.
|
---|
[78] | 891 | _CFGFILE := $(firstword $(wildcard $(_CFGFILES) $(FILE_KBUILD_CONFIG)))
|
---|
[69] | 892 | _CFGFILES :=
|
---|
| 893 | _CFGDIR :=
|
---|
[416] | 894 | ifeq ($(_CFGFILE),)
|
---|
| 895 | $(error kBuild: no Config.kmk file found! Check the DEPTH: DEPTH='$(DEPTH)' PATH_CURRENT='$(PATH_CURRENT)')
|
---|
| 896 | endif
|
---|
[69] | 897 |
|
---|
| 898 | # Include the config.kmk we found file (or the default one).
|
---|
[988] | 899 | ifdef KBUILD_PROFILE_SELF
|
---|
| 900 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 901 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - including $(_CFGFILE))
|
---|
[1441] | 902 | $(info stat: $(make-stats ))
|
---|
[988] | 903 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
[69] | 904 |
|
---|
[988] | 905 | include $(_CFGFILE)
|
---|
[69] | 906 |
|
---|
[988] | 907 | _KBUILD_TS_NOW := $(nanots )
|
---|
| 908 | $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - included $(_CFGFILE))
|
---|
[1441] | 909 | $(info stat: $(make-stats ))
|
---|
[988] | 910 | _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
|
---|
| 911 | else
|
---|
| 912 | include $(_CFGFILE)
|
---|
| 913 | endif
|
---|
| 914 |
|
---|
| 915 |
|
---|
| 916 |
|
---|
[696] | 917 | #
|
---|
[874] | 918 | # Finalize a the central path variables now that we've included the Config.kmk file.
|
---|
| 919 | #
|
---|
| 920 | # This prevents some trouble when users override the defaults for these
|
---|
| 921 | # variables and uses relative paths or paths with incorrect case.
|
---|
| 922 | #
|
---|
| 923 | PATH_OUT := $(abspath $(PATH_OUT))
|
---|
| 924 | PATH_OBJ := $(abspath $(PATH_OBJ))
|
---|
| 925 | PATH_TARGET := $(abspath $(PATH_TARGET))
|
---|
| 926 | PATH_INS := $(abspath $(PATH_INS))
|
---|
| 927 | PATH_BIN := $(abspath $(PATH_BIN))
|
---|
| 928 | PATH_DLL := $(abspath $(PATH_DLL))
|
---|
| 929 | PATH_SYS := $(abspath $(PATH_SYS))
|
---|
| 930 | PATH_LIB := $(abspath $(PATH_LIB))
|
---|
| 931 | PATH_DOC := $(abspath $(PATH_DOC))
|
---|
| 932 |
|
---|
| 933 |
|
---|
| 934 | #
|
---|
[788] | 935 | # Setup the message style. The default one is inlined.
|
---|
[776] | 936 | #
|
---|
[788] | 937 | # See kBuild/msgstyles for more styles or use KBUILD_MSG_STYLE_PATHS
|
---|
| 938 | # to create your own message style.
|
---|
| 939 | #
|
---|
[776] | 940 | KBUILD_MSG_STYLE ?= default
|
---|
| 941 | ifeq ($(KBUILD_MSG_STYLE),default)
|
---|
| 942 | #
|
---|
| 943 | # The 'default' style.
|
---|
| 944 | #
|
---|
| 945 |
|
---|
| 946 | ## Fetch starting.
|
---|
| 947 | # @param 1 Target name.
|
---|
| 948 | MSG_FETCH ?= $(call MSG_L1,Fetching $1...)
|
---|
| 949 | ## Re-fetch starting.
|
---|
| 950 | # @param 1 Target name.
|
---|
| 951 | MSG_REFETCH ?= $(call MSG_L1,Re-fetching $1...)
|
---|
| 952 | ## Downloading a fetch component.
|
---|
| 953 | # @param 1 Target name.
|
---|
| 954 | # @param 2 The source URL.
|
---|
| 955 | # @param 3 The destination file name.
|
---|
| 956 | MSG_FETCH_DL ?= $(call MSG_L1,Downloading $1 - $2,=> $3)
|
---|
| 957 | ## Checking a fetch component.
|
---|
| 958 | # @param 1 Target name.
|
---|
| 959 | # @param 2 The source URL.
|
---|
| 960 | # @param 3 The destination file name.
|
---|
| 961 | MSG_FETCH_CHK?= $(call MSG_L1,Checking $1 - $3, ($2))
|
---|
| 962 | ## Unpacking a fetch component.
|
---|
| 963 | # @param 1 Target name.
|
---|
| 964 | # @param 2 The archive file name.
|
---|
| 965 | # @param 3 The target directory.
|
---|
| 966 | MSG_FETCH_UP ?= $(call MSG_L1,Unpacking $1 - $2 => $3)
|
---|
| 967 | ## Fetch completed.
|
---|
| 968 | # @param 1 Target name.
|
---|
| 969 | MSG_FETCH_OK ?= $(call MSG_L1,Successfully fetched $1)
|
---|
| 970 | ## Unfetch a fetch target.
|
---|
| 971 | # @param 1 Target name.
|
---|
| 972 | MSG_UNFETCH ?= $(call MSG_L1,Unfetching $1...)
|
---|
| 973 | ## Compiling a source file.
|
---|
| 974 | # @param 1 Target name.
|
---|
| 975 | # @param 2 The source filename.
|
---|
| 976 | # @param 3 The primary link output file name.
|
---|
[1256] | 977 | # @param 4 The source type (C,CXX,OBJC,AS,RC,++).
|
---|
[776] | 978 | MSG_COMPILE ?= $(call MSG_L1,Compiling $1 - $2,=> $3)
|
---|
[890] | 979 | ## Tool
|
---|
| 980 | # @param 1 The tool name (bin2c,...)
|
---|
| 981 | # @param 2 Target name.
|
---|
| 982 | # @param 3 The source filename.
|
---|
| 983 | # @param 4 The primary output file name.
|
---|
| 984 | MSG_TOOL ?= $(call MSG_L1,$1 $2 - $3,=> $4)
|
---|
| 985 | ## Generate a file, typically a source file.
|
---|
| 986 | # @param 1 Target name if applicable.
|
---|
| 987 | # @param 2 Output file name.
|
---|
| 988 | # @param 3 What it's generated from
|
---|
| 989 | MSG_GENERATE ?= $(call MSG_L1,Generating $(if $1,$1 - )$2,$(if $3,from $3))
|
---|
[776] | 990 | ## Linking a bldprog/dll/program/sysmod target.
|
---|
| 991 | # @param 1 Target name.
|
---|
| 992 | # @param 2 The primary link output file name.
|
---|
| 993 | # @param 3 The link tool operation (LINK_LIBRARY,LINK_PROGRAM,LINK_DLL,LINK_SYSMOD,++).
|
---|
| 994 | MSG_LINK ?= $(call MSG_L1,Linking $1,=> $2)
|
---|
[844] | 995 | ## Merging a library into the target (during library linking).
|
---|
| 996 | # @param 1 Target name.
|
---|
| 997 | # @param 2 The output library name.
|
---|
| 998 | # @param 3 The input library name.
|
---|
[845] | 999 | MSG_AR_MERGE ?= $(call MSG_L1,Merging $3 into $1, ($2))
|
---|
[776] | 1000 | ## Creating a directory (build).
|
---|
| 1001 | # @param 1 Directory name.
|
---|
| 1002 | MSG_MKDIR ?= $(call MSG_L2,Creating directory $1)
|
---|
| 1003 | ## Cleaning.
|
---|
| 1004 | MSG_CLEAN ?= $(call MSG_L1,Cleaning...)
|
---|
| 1005 | ## Nothing.
|
---|
| 1006 | MSG_NOTHING ?= $(call MSG_L1,Did nothing in $(CURDIR))
|
---|
| 1007 | ## Pass
|
---|
| 1008 | # @param 1 The pass name.
|
---|
| 1009 | MSG_PASS ?= $(call MSG_L1,Pass - $1)
|
---|
| 1010 | ## Installing a bldprog/lib/dll/program/sysmod target.
|
---|
| 1011 | # @param 1 Target name.
|
---|
| 1012 | # @param 2 The source filename.
|
---|
| 1013 | # @param 3 The destination file name.
|
---|
| 1014 | MSG_INST_TRG ?= $(call MSG_L1,Installing $1 => $3)
|
---|
| 1015 | ## Installing a file (install target).
|
---|
| 1016 | # @param 1 The source filename.
|
---|
| 1017 | # @param 2 The destination filename.
|
---|
| 1018 | MSG_INST_FILE?= $(call MSG_L1,Installing $2,(<= $1))
|
---|
| 1019 | ## Installing a symlink.
|
---|
| 1020 | # @param 1 Symlink
|
---|
| 1021 | # @param 2 Link target
|
---|
| 1022 | MSG_INST_SYM ?= $(call MSG_L1,Installing symlink $1,=> $2)
|
---|
| 1023 | ## Installing a directory.
|
---|
| 1024 | # @param 1 Directory name.
|
---|
| 1025 | MSG_INST_DIR ?= $(call MSG_L1,Installing directory $1)
|
---|
| 1026 |
|
---|
[788] | 1027 | else
|
---|
| 1028 | _KBUILD_MSG_STYLE_FILE := $(firstword $(foreach path, $(KBUILD_MSG_STYLE_PATHS) $(PATH_KBUILD)/msgstyles, $(wildcard $(path)/$(KBUILD_MSG_STYLE).kmk)))
|
---|
| 1029 | ifneq ($(_KBUILD_MSG_STYLE_FILE),)
|
---|
| 1030 | include $(_KBUILD_MSG_STYLE_FILE)
|
---|
[776] | 1031 | else
|
---|
[788] | 1032 | $(error kBuild: Can't find the style setup file for KBUILD_MSG_STYLE '$(KBUILD_MSG_STYLE)')
|
---|
[776] | 1033 | endif
|
---|
| 1034 | endif
|
---|
| 1035 |
|
---|
| 1036 |
|
---|
| 1037 | #
|
---|
[696] | 1038 | # Message macros.
|
---|
| 1039 | #
|
---|
[748] | 1040 | # This is done after including Config.kmk as to allow for
|
---|
[696] | 1041 | # KBUILD_QUIET and KBUILD_VERBOSE to be configurable.
|
---|
| 1042 | #
|
---|
| 1043 | ifdef KBUILD_QUIET
|
---|
[776] | 1044 | # No output
|
---|
[696] | 1045 | QUIET := @
|
---|
| 1046 | QUIET2:= @
|
---|
| 1047 | MSG_L1 =
|
---|
| 1048 | MSG_L2 =
|
---|
| 1049 | else
|
---|
| 1050 | ifndef KBUILD_VERBOSE
|
---|
[776] | 1051 | # Default output level.
|
---|
| 1052 | QUIET := @
|
---|
| 1053 | QUIET2 := @
|
---|
| 1054 | MSG_L1 ?= @$(ECHO) "kBuild: $1"
|
---|
| 1055 | MSG_L2 =
|
---|
| 1056 | else ifeq ($(KBUILD_VERBOSE),1)
|
---|
| 1057 | # A bit more output
|
---|
| 1058 | QUIET := @
|
---|
| 1059 | QUIET2 := @
|
---|
| 1060 | MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
|
---|
| 1061 | MSG_L2 =
|
---|
| 1062 | else ifeq ($(KBUILD_VERBOSE),2)
|
---|
| 1063 | # Lot more output
|
---|
| 1064 | QUIET :=
|
---|
| 1065 | QUIET2 := @
|
---|
| 1066 | MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
|
---|
| 1067 | MSG_L2 ?= @$(ECHO) "kBuild: $1"
|
---|
[696] | 1068 | else
|
---|
| 1069 | # maximal output.
|
---|
[776] | 1070 | QUIET :=
|
---|
| 1071 | QUIET2 :=
|
---|
| 1072 | MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
|
---|
| 1073 | MSG_L2 ?= @$(ECHO) "kBuild: $1"
|
---|
[696] | 1074 | endif
|
---|
| 1075 | endif
|
---|
| 1076 |
|
---|
[776] | 1077 |
|
---|
[1403] | 1078 | #
|
---|
| 1079 | # Validate any KBUILD_BLD_TYPES additions and finally the BUILD_TYPE.
|
---|
| 1080 | #
|
---|
| 1081 | if1of ($(KBUILD_BLD_TYPES), $(KBUILD_OSES))
|
---|
| 1082 | $(error kBuild: found KBUILD_BLD_TYPES in KBUILD_OSES!)
|
---|
| 1083 | endif
|
---|
| 1084 | if1of ($(KBUILD_BLD_TYPES), $(KBUILD_ARCHES))
|
---|
| 1085 | $(error kBuild: found KBUILD_BLD_TYPES in KBUILD_ARCHES!)
|
---|
| 1086 | endif
|
---|
| 1087 | if1of ($(KBUILD_OSES), $(KBUILD_ARCHES))
|
---|
| 1088 | $(error kBuild: found KBUILD_OSES in KBUILD_ARCHES!)
|
---|
| 1089 | endif
|
---|
| 1090 | ifn1of ($(BUILD_TYPE), $(KBUILD_BLD_TYPES))
|
---|
| 1091 | $(error kBuild: BUILD_TYPE(=$(BUILD_TYPE)) is not found in KBUILD_BLD_TYPES(=$(KBUILD_BLD_TYPES))!)
|
---|
| 1092 | endif
|
---|
| 1093 |
|
---|
| 1094 |
|
---|
| 1095 |
|
---|
[988] | 1096 | ifdef KBUILD_PROFILE_SELF
|
---|
| 1097 | _KBUILD_TS_HEADER_END := $(nanots )
|
---|
| 1098 | $(info prof: $(int-sub $(_KBUILD_TS_HEADER_END), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_HEADER_END), $(_KBUILD_TS_PREV)) - end of header.kmk)
|
---|
[1441] | 1099 | $(info stat: $(make-stats ))
|
---|
[988] | 1100 | _KBUILD_TS_PREV := $(_KBUILD_TS_HEADER_END)
|
---|
| 1101 | endif
|
---|
| 1102 |
|
---|
[69] | 1103 | # end-of-file-content
|
---|
[72] | 1104 | __header_kmk__ := 1
|
---|
[69] | 1105 | endif # __header_kmk__
|
---|
[479] | 1106 |
|
---|