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