source: trunk/kBuild/header.kmk@ 465

Last change on this file since 465 was 464, checked in by bird, 19 years ago

Changed the default output directory structure with respect to build target + arch + target sub. [Blast x86 output compatibility].

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.7 KB
Line 
1# $Id: header.kmk 464 2006-07-10 01:33:50Z bird $
2## @file
3#
4# kBuild - File included at top of makefile.
5#
6# Copyright (c) 2004-2005 knut st. osmundsen <bird-srcspam@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
27ifndef __header_kmk__
28# start-of-file-content
29
30#
31# default rule
32#
33all: all_recursive
34
35#
36# The FORCE rule.
37#
38FORCE:
39
40#
41# Try avoid inference rules.
42#
43.SUFFIXES:
44SUFFIXES :=
45
46
47#
48# General purpose macros.
49#
50
51## get last word in a list.
52# @returns last word in $1.
53# @param $1 Word list.
54lastword = $(word $(words $(1)), $(1))
55
56##
57# Newline character(s).
58define NL
59
60
61endef
62
63##
64# Tab character.
65TAB := $(subst ., ,.)
66
67##
68# Space character.
69SP := $(subst ., ,.)
70
71##
72# Checks if two strings are equal.
73# @returns blank if equal
74# @returns non-blank if not equal.
75# @param $1 String 1.
76# @param $2 String 2
77STRCMP = $(
78
79#
80# Assert build type.
81#
82ifndef BUILD_TYPE
83ifndef BUILD_MODE
84$(error kBuild: You must define BUILD_TYPE!)
85endif
86BUILD_TYPE := $(BUILD_MODE)
87endif
88ifeq ($(BUILD_TYPE),DEBUG)
89BUILD_TYPE := debug
90endif
91ifeq ($(BUILD_TYPE),RELEASE)
92BUILD_TYPE := release
93endif
94ifeq ($(BUILD_TYPE),PROFILE)
95BUILD_TYPE := profile
96endif
97
98
99#
100# Assert build platform.
101#
102_BUILD_PLATFORM_OK := 0
103# OS/2 (have uppercase legacy)
104ifeq ($(BUILD_PLATFORM),OS2)
105override BUILD_PLATFORM := os2
106endif
107ifeq ($(BUILD_PLATFORM),os2)
108_BUILD_PLATFORM_OK := 1
109endif
110
111# Linux
112ifeq ($(BUILD_PLATFORM),LINUX)
113$(error kBuild: BUILD_PLATFORM must be all lowercase!)
114endif
115ifeq ($(BUILD_PLATFORM),linux)
116_BUILD_PLATFORM_OK := 1
117endif
118
119# Win32
120ifeq ($(BUILD_PLATFORM),WIN32)
121$(error kBuild: BUILD_PLATFORM must be all lowercase!)
122endif
123ifeq ($(BUILD_PLATFORM),win32)
124_BUILD_PLATFORM_OK := 1
125endif
126
127# Win64
128ifeq ($(BUILD_PLATFORM),WIN64)
129$(error kBuild: BUILD_PLATFORM must be all lowercase!)
130endif
131ifeq ($(BUILD_PLATFORM),win64)
132_BUILD_PLATFORM_OK := 1
133endif
134
135# L4
136ifeq ($(BUILD_PLATFORM),L4)
137$(error kBuild: BUILD_PLATFORM must be all lowercase!)
138endif
139ifeq ($(BUILD_PLATFORM),l4)
140_BUILD_PLATFORM_OK := 1
141endif
142
143# FreeBSD
144ifeq ($(BUILD_PLATFORM),FreeBSD)
145$(error kBuild: BUILD_PLATFORM must be all lowercase!)
146endif
147ifeq ($(BUILD_PLATFORM),freebsd)
148_BUILD_PLATFORM_OK := 1
149endif
150
151ifeq ($(_BUILD_PLATFORM_OK),0)
152$(error kBuild: BUILD_PLATFORM value '$(BUILD_PLATFORM)' was not recongized!)
153endif
154
155# Fill in defaults if needed.
156ifndef BUILD_PLATFORM_ARCH
157ifeq ($(filter-out win64,$(BUILD_PLATFORM)),)
158BUILD_PLATFORM_ARCH := amd64
159else
160BUILD_PLATFORM_ARCH := x86
161endif
162endif
163ifndef BUILD_PLATFORM_CPU
164ifeq ($(filter-out amd64,$(BUILD_PLATFORM_ARCH)),)
165BUILD_PLATFORM_CPU := k8
166else
167BUILD_PLATFORM_CPU := i586
168endif
169endif
170
171
172#
173# Assert target platform.
174#
175ifndef BUILD_TARGET
176# not defined, set to the same as build platform
177BUILD_TARGET := $(BUILD_PLATFORM)
178else
179_BUILD_TARGET_OK := 0
180# OS/2
181ifeq ($(BUILD_TARGET),OS2)
182$(error kBuild: BUILD_TARGET must be all lowercase!)
183endif
184ifeq ($(BUILD_TARGET),os2)
185_BUILD_TARGET_OK := 1
186endif
187
188# Linux
189ifeq ($(BUILD_TARGET),LINUX)
190$(error kBuild: BUILD_TARGET must be all lowercase!)
191endif
192ifeq ($(BUILD_TARGET),linux)
193_BUILD_TARGET_OK := 1
194endif
195
196# Win32
197ifeq ($(BUILD_TARGET),WIN32)
198$(error kBuild: BUILD_TARGET must be all lowercase!)
199endif
200ifeq ($(BUILD_TARGET),win32)
201_BUILD_TARGET_OK := 1
202endif
203
204# Win64
205ifeq ($(BUILD_TARGET),WIN64)
206$(error kBuild: BUILD_TARGET must be all lowercase!)
207endif
208ifeq ($(BUILD_TARGET),win64)
209_BUILD_TARGET_OK := 1
210endif
211
212# L4
213ifeq ($(BUILD_TARGET),L4)
214$(error kBuild: BUILD_TARGET must be all lowercase!)
215endif
216ifeq ($(BUILD_TARGET),l4)
217_BUILD_TARGET_OK := 1
218endif
219
220# FreeBSD
221ifeq ($(BUILD_TARGET),FreeBSD)
222$(error kBuild: BUILD_TARGET must be all lowercase!)
223endif
224ifeq ($(BUILD_TARGET),freebsd)
225_BUILD_TARGET_OK := 1
226endif
227
228ifeq ($(_BUILD_TARGET_OK),0)
229$(error kBuild: BUILD_TARGET value '$(BUILD_TARGET)' was not recongized!)
230endif
231endif
232
233# Fill in defaults if needed.
234ifndef BUILD_TARGET_ARCH
235BUILD_TARGET_ARCH := x86
236endif
237ifndef BUILD_TARGET_CPU
238BUILD_TARGET_CPU := i586
239endif
240
241# Adjust the DEPTH definition first
242ifeq ($(strip $(DEPTH)),)
243DEPTH := .
244endif
245
246#
247# Common definitions.
248#
249ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
250PATH_CURRENT := $(abspath $(CURDIR))
251PATH_ROOT := $(abspath $(PATH_CURRENT)/$(DEPTH))
252
253else
254
255PATH_CURRENT := $(CURDIR)
256# Get the real root path.
257PATH_ROOT := $(PATH_CURRENT)
258ifneq ($(DEPTH),.)
259$(foreach d,$(subst /, ,$(DEPTH)), $(eval PATH_ROOT := $(patsubst %/,%,$(dir $(PATH_ROOT)))) )
260endif
261
262endif
263# Subdirectory relative to the root.
264ifneq ($(PATH_ROOT),$(PATH_CURRENT))
265CURSUBDIR := $(patsubst $(PATH_ROOT)/%,%,$(PATH_CURRENT))
266else
267CURSUBDIR := .
268endif
269
270# Output directories.
271ifndef PATH_OUT_BASE
272PATH_OUT_BASE := $(PATH_ROOT)/out
273endif
274ifndef PATH_OUT
275ifdef BUILD_TARGET_SUB # (BUILD_TARGET_SUB is not currently recognized by kBuild in any other places.)
276PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH).$(BUILD_TARGET_SUB)/$(BUILD_TYPE)
277else
278PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)/$(BUILD_TYPE)
279endif
280endif # !define PATH_OUT
281PATH_OBJ = $(PATH_OUT)/obj
282PATH_TARGET = $(PATH_OBJ)/$(CURSUBDIR)
283PATH_INS = $(PATH_OUT)
284PATH_BIN = $(PATH_INS)/bin
285PATH_DLL = $(PATH_INS)/bin
286PATH_SYS = $(PATH_INS)/bin
287PATH_LIB = $(PATH_INS)/lib
288PATH_DOC = $(PATH_INS)/doc
289
290# Usually kBuild is external to the source tree.
291ifndef PATH_KBUILD
292PATH_KBUILD := $(PATH_ROOT)/kBuild
293endif
294ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
295PATH_KBUILD := $(abspath $(PATH_KBUILD))
296endif
297# kBuild files which might be of interest.
298FILE_KBUILD_HEADER := $(PATH_KBUILD)/header.kmk
299FILE_KBUILD_CONFIG := $(PATH_KBUILD)/config.kmk
300FILE_KBUILD_FOOTER := $(PATH_KBUILD)/footer.kmk
301
302SUFF_DEP := .dep
303MAKEFILE := $(firstword $(MAKEFILE_LIST))
304
305
306#
307# Get rid of the GNU Make default stuff
308#
309ifndef KMK_VERSION
310include $(PATH_KBUILD)/StampOutPredefines.kmk
311endif
312
313#
314# Build platform setup.
315#
316PATH_TOOLS := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
317
318# OS/2
319ifeq ($(BUILD_PLATFORM),os2)
320EXEC_X86_WIN32 := innopec.exe
321HOSTSUFF_EXE := .exe
322endif
323
324# Linux
325ifeq ($(BUILD_PLATFORM),linux)
326EXEC_X86_WIN32 := wine
327HOSTSUFF_EXE :=
328endif
329
330# Win32 & Win64
331ifeq ($(filter-out win32 win64,$(BUILD_TARGET)),)
332EXEC_X86_WIN32 :=
333HOSTSUFF_EXE := .exe
334endif
335
336# FreeBSD
337ifeq ($(BUILD_PLATFORM),freebsd)
338EXEC_X86_WIN32 := wine
339HOSTSUFF_EXE :=
340endif
341
342
343#
344# Build target setup.
345#
346ifeq ($(BUILD_TARGET),os2)
347SUFF_OBJ := .obj
348SUFF_LIB := .lib
349SUFF_DLL := .dll
350SUFF_EXE := .exe
351SUFF_SYS := .sys
352SUFF_RES := .res
353endif
354ifeq ($(filter-out win32 win64,$(BUILD_TARGET)),)
355SUFF_OBJ := .obj
356SUFF_LIB := .lib
357SUFF_DLL := .dll
358SUFF_EXE := .exe
359SUFF_SYS := .sys
360SUFF_RES := .res
361endif
362ifeq ($(BUILD_TARGET),linux)
363SUFF_OBJ := .o
364SUFF_LIB := .a
365SUFF_DLL := .so
366SUFF_EXE :=
367SUFF_SYS := .a
368SUFF_RES :=
369endif
370ifeq ($(BUILD_TARGET),l4)
371SUFF_OBJ := .o
372SUFF_LIB := .a
373SUFF_DLL := .s.so
374SUFF_EXE :=
375SUFF_SYS := .a
376SUFF_RES :=
377endif
378
379#
380# Standard kBuild tools.
381#
382ifeq ($(MAKE),kmk)
383MAKE := $(PATH_TOOLS)/kmk$(HOSTSUFF_EXE)
384endif
385
386DEP_EXT := $(PATH_TOOLS)/kDep$(HOSTSUFF_EXE)
387ifeq ($(filter kDep,$(KMK_BUILTIN)),kDep)
388DEP := kmk_builtin_kDep
389else
390DEP := $(DEP_EXT)
391endif
392
393DEP_IDB_EXT := $(PATH_TOOLS)/kDepIDB$(HOSTSUFF_EXE)
394ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepIDB)
395DEP_IDB := $(if kmk_builtin_kDepIDB
396else
397DEP_IDB := $(DEP_IDB_EXT)
398endif
399
400DEP_PRE_EXT := $(PATH_TOOLS)/kDepPre$(HOSTSUFF_EXE)
401ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepPre)
402DEP_PRE := $(if kmk_builtin_kDepPre
403else
404DEP_PRE := $(DEP_PRE_EXT)
405endif
406
407APPEND_EXT := $(PATH_TOOLS)/kmk_append$(HOSTSUFF_EXE)
408ifeq ($(filter append,$(KMK_BUILTIN)),append)
409APPEND := kmk_builtin_append
410else
411APPEND := $(APPEND_EXT)
412endif
413
414CAT_EXT := $(PATH_TOOLS)/kmk_cat$(HOSTSUFF_EXE)
415ifeq ($(filter cat,$(KMK_BUILTIN)),cat)
416CAT := kmk_builtin_cat
417else
418CAT := $(CAT_EXT)
419endif
420
421CP_EXT := $(PATH_TOOLS)/kmk_cp$(HOSTSUFF_EXE)
422ifeq ($(filter cp,$(KMK_BUILTIN)),cp)
423CP := kmk_builtin_cp
424else
425CP := $(CP_EXT)
426endif
427
428ECHO_EXT := $(PATH_TOOLS)/kmk_echo$(HOSTSUFF_EXE)
429ifeq ($(filter echo,$(KMK_BUILTIN)),echo)
430ECHO := kmk_builtin_echo
431else
432ECHO := $(ECHO_EXT)
433endif
434
435INSTALL_EXT := $(PATH_TOOLS)/kmk_install$(HOSTSUFF_EXE)
436ifeq ($(filter install,$(KMK_BUILTIN)),install)
437INSTALL := kmk_builtin_install
438else
439INSTALL := $(INSTALL_EXT)
440endif
441
442LN_EXT := $(PATH_TOOLS)/kmk_ln$(HOSTSUFF_EXE)
443ifeq ($(filter ln,$(KMK_BUILTIN)),ln)
444LN := kmk_builtin_ln
445else
446LN := $(LN_EXT)
447endif
448
449MKDIR_EXT := $(PATH_TOOLS)/kmk_mkdir$(HOSTSUFF_EXE)
450ifeq ($(filter mkdir,$(KMK_BUILTIN)),mkdir)
451MKDIR := kmk_builtin_mkdir
452else
453MKDIR := $(MKDIR_EXT)
454endif
455
456MV_EXT := $(PATH_TOOLS)/kmk_mv$(HOSTSUFF_EXE)
457ifeq ($(filter mv,$(KMK_BUILTIN)),mv)
458MV := kmk_builtin_mv
459else
460MV := $(MV_EXT)
461endif
462
463RM_EXT := $(PATH_TOOLS)/kmk_rm$(HOSTSUFF_EXE)
464ifeq ($(filter rm,$(KMK_BUILTIN)),rm)
465RM := kmk_builtin_rm
466else
467RM := $(RM_EXT)
468endif
469
470SED_EXT := $(PATH_TOOLS)/kmk_sed$(HOSTSUFF_EXE)
471ifeq ($(filter sed,$(KMK_BUILTIN)),sed)
472SED := kmk_builtin_sed
473else
474SED := $(SED_EXT)
475endif
476
477# Our default shell is the Almquist shell from *BSD.
478ASH := $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)
479MAKESHELL := $(ASH)
480SHELL := $(ASH)
481export SHELL MAKESHELL
482
483# Symlinking is problematic on some platforms...
484LN_SYMLINK := $(LN) -s
485
486
487
488#
489# Message macros.
490#
491
492ifndef BUILD_QUIET
493ifdef BUILD_DEBUG
494BUILD_VERBOSE := 9
495endif
496MSG_L1 = @$(ECHO) "kBuild: $1"
497ifdef BUILD_VERBOSE
498MSG_L2 = @$(ECHO) "kBuild: $1"
499QUIET :=
500else
501QUIET := @
502MSG_L2 =
503endif
504ifdef BUILD_DEBUG
505MSG_L3 = @$(ECHO) "kBuild: $1"
506else
507MSG_L3 =
508endif
509else
510QUIET :=
511MSG_L1 =
512MSG_L2 =
513MSG_L3 =
514endif
515
516## ABSPATH - make paths absolute.
517# This implementation is clumsy and doesn't resolve '..' and '.' components.
518#
519# @param $1 The paths to make absolute.
520ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
521ABSPATH = $(abspath $(1))
522else
523ABSPATH = $(foreach path,$(1)\
524 ,$(strip $(if $(subst <,,$(firstword $(subst /, ,<$(path)))),\
525 $(if $(patsubst %:,,$(firstword $(subst :,: ,$(path)))),$(PATH_CURRENT)/$(path),$(path)),\
526 $(path))))
527endif
528
529## DIRDEP - make create directory dependencies.
530#
531# @param $1 The paths to the directories which must be created.
532ifeq ($(filter-out win32 win64,$(BUILD_PLATFORM)),)
533DIRDEP = $(patsubst %/,%,$(1))
534else
535DIRDEP = $(foreach path,$(patsubst %/,%,$(1)),$(path)/)
536endif
537
538
539## Cygwin kludge.
540# This converts /cygdrive/x/% to x:%.
541#
542# @param $1 The paths to make native.
543# @remark This macro is pretty much obsolete since we don't use cygwin base make.
544ifneq ($(patsubst /cygdrive/%,%,$(CURDIR)),$(CURDIR))
545CYGPATHMIXED = $(foreach path,$(1)\
546 ,$(if $(patsubst /cygdrive/%,,$(path)),$(path),$(patsubst $(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path)))))/%,$(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path))))):/%,$(patsubst /cygdrive/%,%,$(path)))))
547else
548CYGPATHMIXED = $(1)
549endif
550
551#
552# Initialize some of the globals which the Config.kmk and
553# others can add stuff to if they like for processing in the footer.
554#
555
556## ALL_TARGET
557# This is the list of all targets.
558ALL_TARGETS :=
559
560## TEMPLATE_PATHS
561# List a paths (separated by space) where templates can be found.
562TEMPLATE_PATHS :=
563
564## TOOL_PATHS
565# List of paths (separated by space) where tools can be found.
566TOOL_PATHS :=
567
568## SDK_PATHS
569# List of paths (separated by space) where SDKs can be found.
570SDK_PATHS :=
571
572## Proritized list of the default makefile when walking subdirectories.
573# The user can overload this list.
574DEFAULT_MAKEFILE := Makefile.kmk makefile.kmk Makefile makefile
575
576## PROPS_SINGLE
577# The list of non-accumulative target properties.
578# A Config.kmk file can add it's own properties to this list and kBuild
579# will do the necessary inheritance from templates to targets.
580PROPS_SINGLE := TOOL ARTOOL CTOOL CXXTOOL ASTOOL LDTOOL INST NOINST
581
582## PROPS_DEFERRED
583# This list of non-accumulative target properties which are functions,
584# and thus should not be expanded until the very last moment.
585PROPS_DEFERRED := INSTFUN INSTALLER
586
587## PROPS_ACCUMULATE
588# The list of accumulative target properties.
589# A Config.kmk file can add it's own properties to this list and kBuild
590# will do the necessary inheritance from templates to targets.
591PROPS_ACCUMULATE := \
592 SDKS DEFS DEPS INCS SOURCES \
593 COPTS CFLAGS CDEFS CINCS CXXOPTS CXXFLAGS CXXDEFS CXXINCS \
594 ASOPTS ASFLAGS ASDEFS ASINCS \
595 LDFLAGS LIBS LIBPATH \
596 BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \
597 SYSSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \
598
599
600## PROPS_TOOLS
601# This is a subset of the other PROPS
602PROPS_TOOLS := TOOL CTOOL CXXTOOL ASTOOL ARTOOL LDTOOL
603
604
605#
606# Pass configuration.
607#
608# The PASS_<passname>_trgs variable is listing the targets.
609# The PASS_<passname>_vars variable is listing the target variables.
610# The PASS_<passname>_pass variable is the lowercased passname.
611#
612
613## PASS: bldprogs
614# This pass builds targets which are required for building the rest.
615PASS_BLDPROGS := Build Programs
616PASS_BLDPROGS_trgs :=
617PASS_BLDPROGS_vars := _BLDPROGS
618PASS_BLDPROGS_pass := bldprogs
619
620## PASS: libraries
621# This pass builds library targets.
622PASS_LIBRARIES := Libraries
623PASS_LIBRARIES_trgs :=
624PASS_LIBRARIES_vars := _LIBS _IMPORT_LIBS _OTHER_LIBRARIES
625PASS_LIBRARIES_pass := libraries
626
627## PASS: binaries
628# This pass builds dll targets.
629PASS_DLLS := DLLs
630PASS_DLLS_trgs :=
631PASS_DLLS_vars := _DLLS _OTHER_DLLS
632PASS_DLLS_pass := dlls
633
634## PASS: binaries
635# This pass builds binary targets, i.e. programs, system modules and stuff.
636PASS_BINARIES := Programs
637PASS_BINARIES_trgs :=
638PASS_BINARIES_vars := _PROGRAMS _SYSMODS _OTHER_BINARIES
639PASS_BINARIES_pass := binaries
640
641## PASS: others
642# This pass builds other targets.
643PASS_OTHERS := Other Stuff
644PASS_OTHERS_trgs :=
645PASS_OTHERS_vars := _OTHERS
646PASS_OTHERS_pass := others
647
648## PASS: install
649# This pass installs the built entities to a sandbox area.
650PASS_INSTALLS := Install
651PASS_INSTALLS_trgs :=
652PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS
653PASS_INSTALLS_pass := installs
654
655## PASS: packing
656# This pass processes custom packing rules.
657PASS_PACKING := Packing
658PASS_PACKING_trgs :=
659PASS_PACKING_vars := _PACKING
660PASS_PACKING_pass := packing
661#alias
662packing: pass_packing
663
664## PASS: clean
665# This pass removes all generated files.
666PASS_CLEAN := Clean
667PASS_CLEAN_trgs := do-clean
668PASS_CLEAN_vars :=
669PASS_CLEAN_pass := clean
670# alias
671clean: pass_clean
672
673## PASS: nothing
674# This pass just walks the tree.
675PASS_NOTHING := Nothing
676PASS_NOTHING_trgs := do-nothing
677PASS_NOTHING_vars :=
678PASS_NOTHING_pass := nothing
679# alias
680nothing: pass_nothing
681
682## DEFAULT_PASSES
683# The default passes and their order.
684DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
685
686## PASSES
687# The passes that should be defined. This must include
688# all passes mentioned by DEFAULT_PASSES.
689PASSES := $(DEFAULT_PASSES) NOTHING CLEAN
690
691
692#
693# This is how we find the closest config.kmk.
694# It's a little hacky but I think it works fine.
695#
696_CFGDIR := .
697_CFGFILES := ./Config.kmk ./config.kmk
698define def_include_config
699$(eval _CFGDIR := $(_CFGDIR)/$(dir))
700_CFGFILES += $(_CFGDIR)/Config.kmk $(_CFGDIR)/config.kmk
701endef
702# walk down the _RELATIVE_ path specified by DEPTH.
703$(foreach dir,$(subst /, ,$(DEPTH)), $(eval $(def_include_config)) )
704# add the default config file.
705_CFGFILE := $(firstword $(wildcard $(_CFGFILES) $(FILE_KBUILD_CONFIG)))
706_CFGFILES :=
707_CFGDIR :=
708ifeq ($(_CFGFILE),)
709$(error kBuild: no Config.kmk file found! Check the DEPTH: DEPTH='$(DEPTH)' PATH_CURRENT='$(PATH_CURRENT)')
710endif
711
712# Include the config.kmk we found file (or the default one).
713include $(_CFGFILE)
714
715
716# end-of-file-content
717__header_kmk__ := 1
718endif # __header_kmk__
Note: See TracBrowser for help on using the repository browser.