source: trunk/kBuild/header.kmk@ 479

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

More NT stuff.

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