source: trunk/kBuild/header.kmk@ 448

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

Accumulate DEPS.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.0 KB
Line 
1# $Id: header.kmk 444 2006-05-28 21:02:06Z 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
275ifeq ($(BUILD_PLATFORM_ARCH),x86)
276ifdef BUILD_TARGET_SUB # (BUILD_TARGET_SUB is not currently recognized by kBuild in any other places.)
277PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET)/$(BUILD_TARGET_SUB)/$(BUILD_TYPE)
278else
279PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET)/$(BUILD_TYPE)
280endif
281else # !x86
282ifdef BUILD_TARGET_SUB # (BUILD_TARGET_SUB is not currently recognized by kBuild in any other places.)
283PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET)/$(BUILD_TARGET_ARCH)/$(BUILD_TARGET_SUB)/$(BUILD_TYPE)
284else
285PATH_OUT := $(PATH_OUT_BASE)/$(BUILD_TARGET)/$(BUILD_TARGET_ARCH)/$(BUILD_TYPE)
286endif
287endif # !x86
288endif # !define PATH_OUT
289PATH_OBJ = $(PATH_OUT)/obj
290PATH_TARGET = $(PATH_OBJ)/$(CURSUBDIR)
291PATH_INS = $(PATH_OUT)
292PATH_BIN = $(PATH_INS)/bin
293PATH_DLL = $(PATH_INS)/bin
294PATH_SYS = $(PATH_INS)/bin
295PATH_LIB = $(PATH_INS)/lib
296PATH_DOC = $(PATH_INS)/doc
297
298# Usually kBuild is external to the source tree.
299ifndef PATH_KBUILD
300PATH_KBUILD := $(PATH_ROOT)/kBuild
301endif
302ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
303PATH_KBUILD := $(abspath $(PATH_KBUILD))
304endif
305# kBuild files which might be of interest.
306FILE_KBUILD_HEADER := $(PATH_KBUILD)/header.kmk
307FILE_KBUILD_CONFIG := $(PATH_KBUILD)/config.kmk
308FILE_KBUILD_FOOTER := $(PATH_KBUILD)/footer.kmk
309
310SUFF_DEP := .dep
311MAKEFILE := $(firstword $(MAKEFILE_LIST))
312
313
314#
315# Get rid of the GNU Make default stuff
316#
317ifndef KMK_VERSION
318include $(PATH_KBUILD)/StampOutPredefines.kmk
319endif
320
321#
322# Build platform setup.
323#
324PATH_TOOLS := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
325
326# OS/2
327ifeq ($(BUILD_PLATFORM),os2)
328EXEC_X86_WIN32 := innopec.exe
329HOSTSUFF_EXE := .exe
330endif
331
332# Linux
333ifeq ($(BUILD_PLATFORM),linux)
334EXEC_X86_WIN32 := wine
335HOSTSUFF_EXE :=
336endif
337
338# Win32 & Win64
339ifeq ($(filter-out win32 win64,$(BUILD_TARGET)),)
340EXEC_X86_WIN32 :=
341HOSTSUFF_EXE := .exe
342endif
343
344# FreeBSD
345ifeq ($(BUILD_PLATFORM),freebsd)
346EXEC_X86_WIN32 := wine
347HOSTSUFF_EXE :=
348endif
349
350
351#
352# Build target setup.
353#
354ifeq ($(BUILD_TARGET),os2)
355SUFF_OBJ := .obj
356SUFF_LIB := .lib
357SUFF_DLL := .dll
358SUFF_EXE := .exe
359SUFF_SYS := .sys
360SUFF_RES := .res
361endif
362ifeq ($(filter-out win32 win64,$(BUILD_TARGET)),)
363SUFF_OBJ := .obj
364SUFF_LIB := .lib
365SUFF_DLL := .dll
366SUFF_EXE := .exe
367SUFF_SYS := .sys
368SUFF_RES := .res
369endif
370ifeq ($(BUILD_TARGET),linux)
371SUFF_OBJ := .o
372SUFF_LIB := .a
373SUFF_DLL := .so
374SUFF_EXE :=
375SUFF_SYS := .a
376SUFF_RES :=
377endif
378ifeq ($(BUILD_TARGET),l4)
379SUFF_OBJ := .o
380SUFF_LIB := .a
381SUFF_DLL := .s.so
382SUFF_EXE :=
383SUFF_SYS := .a
384SUFF_RES :=
385endif
386
387#
388# Standard kBuild tools.
389#
390ifeq ($(MAKE),kmk)
391MAKE := $(PATH_TOOLS)/kmk$(HOSTSUFF_EXE)
392endif
393
394DEP_EXT := $(PATH_TOOLS)/kDep$(HOSTSUFF_EXE)
395ifeq ($(filter kDep,$(KMK_BUILTIN)),kDep)
396DEP := kmk_builtin_kDep
397else
398DEP := $(DEP_EXT)
399endif
400
401DEP_IDB_EXT := $(PATH_TOOLS)/kDepIDB$(HOSTSUFF_EXE)
402ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepIDB)
403DEP_IDB := $(if kmk_builtin_kDepIDB
404else
405DEP_IDB := $(DEP_IDB_EXT)
406endif
407
408DEP_PRE_EXT := $(PATH_TOOLS)/kDepPre$(HOSTSUFF_EXE)
409ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepPre)
410DEP_PRE := $(if kmk_builtin_kDepPre
411else
412DEP_PRE := $(DEP_PRE_EXT)
413endif
414
415APPEND_EXT := $(PATH_TOOLS)/kmk_append$(HOSTSUFF_EXE)
416ifeq ($(filter append,$(KMK_BUILTIN)),append)
417APPEND := kmk_builtin_append
418else
419APPEND := $(APPEND_EXT)
420endif
421
422CAT_EXT := $(PATH_TOOLS)/kmk_cat$(HOSTSUFF_EXE)
423ifeq ($(filter cat,$(KMK_BUILTIN)),cat)
424CAT := kmk_builtin_cat
425else
426CAT := $(CAT_EXT)
427endif
428
429CP_EXT := $(PATH_TOOLS)/kmk_cp$(HOSTSUFF_EXE)
430ifeq ($(filter cp,$(KMK_BUILTIN)),cp)
431CP := kmk_builtin_cp
432else
433CP := $(CP_EXT)
434endif
435
436ECHO_EXT := $(PATH_TOOLS)/kmk_echo$(HOSTSUFF_EXE)
437ifeq ($(filter echo,$(KMK_BUILTIN)),echo)
438ECHO := kmk_builtin_echo
439else
440ECHO := $(ECHO_EXT)
441endif
442
443INSTALL_EXT := $(PATH_TOOLS)/kmk_install$(HOSTSUFF_EXE)
444ifeq ($(filter install,$(KMK_BUILTIN)),install)
445INSTALL := kmk_builtin_install
446else
447INSTALL := $(INSTALL_EXT)
448endif
449
450LN_EXT := $(PATH_TOOLS)/kmk_ln$(HOSTSUFF_EXE)
451ifeq ($(filter ln,$(KMK_BUILTIN)),ln)
452LN := kmk_builtin_ln
453else
454LN := $(LN_EXT)
455endif
456
457MKDIR_EXT := $(PATH_TOOLS)/kmk_mkdir$(HOSTSUFF_EXE)
458ifeq ($(filter mkdir,$(KMK_BUILTIN)),mkdir)
459MKDIR := kmk_builtin_mkdir
460else
461MKDIR := $(MKDIR_EXT)
462endif
463
464MV_EXT := $(PATH_TOOLS)/kmk_mv$(HOSTSUFF_EXE)
465ifeq ($(filter mv,$(KMK_BUILTIN)),mv)
466MV := kmk_builtin_mv
467else
468MV := $(MV_EXT)
469endif
470
471RM_EXT := $(PATH_TOOLS)/kmk_rm$(HOSTSUFF_EXE)
472ifeq ($(filter rm,$(KMK_BUILTIN)),rm)
473RM := kmk_builtin_rm
474else
475RM := $(RM_EXT)
476endif
477
478SED_EXT := $(PATH_TOOLS)/kmk_sed$(HOSTSUFF_EXE)
479ifeq ($(filter sed,$(KMK_BUILTIN)),sed)
480SED := kmk_builtin_sed
481else
482SED := $(SED_EXT)
483endif
484
485# Our default shell is the Almquist shell from *BSD.
486ASH := $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)
487MAKESHELL := $(ASH)
488SHELL := $(ASH)
489export SHELL MAKESHELL
490
491# Symlinking is problematic on some platforms...
492LN_SYMLINK := $(LN) -s
493
494
495
496#
497# Message macros.
498#
499
500ifndef BUILD_QUIET
501ifdef BUILD_DEBUG
502BUILD_VERBOSE := 9
503endif
504MSG_L1 = @$(ECHO) "kBuild: $1"
505ifdef BUILD_VERBOSE
506MSG_L2 = @$(ECHO) "kBuild: $1"
507QUIET :=
508else
509QUIET := @
510MSG_L2 =
511endif
512ifdef BUILD_DEBUG
513MSG_L3 = @$(ECHO) "kBuild: $1"
514else
515MSG_L3 =
516endif
517else
518QUIET :=
519MSG_L1 =
520MSG_L2 =
521MSG_L3 =
522endif
523
524## ABSPATH - make paths absolute.
525# This implementation is clumsy and doesn't resolve '..' and '.' components.
526#
527# @param $1 The paths to make absolute.
528ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
529ABSPATH = $(abspath $(1))
530else
531ABSPATH = $(foreach path,$(1)\
532 ,$(strip $(if $(subst <,,$(firstword $(subst /, ,<$(path)))),\
533 $(if $(patsubst %:,,$(firstword $(subst :,: ,$(path)))),$(PATH_CURRENT)/$(path),$(path)),\
534 $(path))))
535endif
536
537## DIRDEP - make create directory dependencies.
538#
539# @param $1 The paths to the directories which must be created.
540ifeq ($(filter-out win32 win64,$(BUILD_PLATFORM)),)
541DIRDEP = $(patsubst %/,%,$(1))
542else
543DIRDEP = $(foreach path,$(patsubst %/,%,$(1)),$(path)/)
544endif
545
546
547## Cygwin kludge.
548# This converts /cygdrive/x/% to x:%.
549#
550# @param $1 The paths to make native.
551# @remark This macro is pretty much obsolete since we don't use cygwin base make.
552ifneq ($(patsubst /cygdrive/%,%,$(CURDIR)),$(CURDIR))
553CYGPATHMIXED = $(foreach path,$(1)\
554 ,$(if $(patsubst /cygdrive/%,,$(path)),$(path),$(patsubst $(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path)))))/%,$(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path))))):/%,$(patsubst /cygdrive/%,%,$(path)))))
555else
556CYGPATHMIXED = $(1)
557endif
558
559#
560# Initialize some of the globals which the Config.kmk and
561# others can add stuff to if they like for processing in the footer.
562#
563
564## ALL_TARGET
565# This is the list of all targets.
566ALL_TARGETS :=
567
568## TEMPLATE_PATHS
569# List a paths (separated by space) where templates can be found.
570TEMPLATE_PATHS :=
571
572## TOOL_PATHS
573# List of paths (separated by space) where tools can be found.
574TOOL_PATHS :=
575
576## SDK_PATHS
577# List of paths (separated by space) where SDKs can be found.
578SDK_PATHS :=
579
580## Proritized list of the default makefile when walking subdirectories.
581# The user can overload this list.
582DEFAULT_MAKEFILE := Makefile.kmk makefile.kmk Makefile makefile
583
584## PROPS_SINGLE
585# The list of non-accumulative target properties.
586# A Config.kmk file can add it's own properties to this list and kBuild
587# will do the necessary inheritance from templates to targets.
588PROPS_SINGLE := TOOL ARTOOL CTOOL CXXTOOL ASTOOL LDTOOL INST NOINST
589
590## PROPS_DEFERRED
591# This list of non-accumulative target properties which are functions,
592# and thus should not be expanded until the very last moment.
593PROPS_DEFERRED := INSTFUN INSTALLER
594
595## PROPS_ACCUMULATE
596# The list of accumulative target properties.
597# A Config.kmk file can add it's own properties to this list and kBuild
598# will do the necessary inheritance from templates to targets.
599PROPS_ACCUMULATE := \
600 SDKS DEFS DEPS INCS SOURCES \
601 COPTS CFLAGS CDEFS CINCS CXXOPTS CXXFLAGS CXXDEFS CXXINCS \
602 ASOPTS ASFLAGS ASDEFS ASINCS \
603 LDFLAGS LIBS LIBPATH \
604 BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \
605 SYSSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \
606
607
608## PROPS_TOOLS
609# This is a subset of the other PROPS
610PROPS_TOOLS := TOOL CTOOL CXXTOOL ASTOOL ARTOOL LDTOOL
611
612
613#
614# Pass configuration.
615#
616# The PASS_<passname>_trgs variable is listing the targets.
617# The PASS_<passname>_vars variable is listing the target variables.
618# The PASS_<passname>_pass variable is the lowercased passname.
619#
620
621## PASS: bldprogs
622# This pass builds targets which are required for building the rest.
623PASS_BLDPROGS := Build Programs
624PASS_BLDPROGS_trgs :=
625PASS_BLDPROGS_vars := _BLDPROGS
626PASS_BLDPROGS_pass := bldprogs
627
628## PASS: libraries
629# This pass builds library targets.
630PASS_LIBRARIES := Libraries
631PASS_LIBRARIES_trgs :=
632PASS_LIBRARIES_vars := _LIBS _IMPORT_LIBS _OTHER_LIBRARIES
633PASS_LIBRARIES_pass := libraries
634
635## PASS: binaries
636# This pass builds dll targets.
637PASS_DLLS := DLLs
638PASS_DLLS_trgs :=
639PASS_DLLS_vars := _DLLS _OTHER_DLLS
640PASS_DLLS_pass := dlls
641
642## PASS: binaries
643# This pass builds binary targets, i.e. programs, system modules and stuff.
644PASS_BINARIES := Programs
645PASS_BINARIES_trgs :=
646PASS_BINARIES_vars := _PROGRAMS _SYSMODS _OTHER_BINARIES
647PASS_BINARIES_pass := binaries
648
649## PASS: others
650# This pass builds other targets.
651PASS_OTHERS := Other Stuff
652PASS_OTHERS_trgs :=
653PASS_OTHERS_vars := _OTHERS
654PASS_OTHERS_pass := others
655
656## PASS: install
657# This pass installs the built entities to a sandbox area.
658PASS_INSTALLS := Install
659PASS_INSTALLS_trgs :=
660PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS
661PASS_INSTALLS_pass := installs
662
663## PASS: packing
664# This pass processes custom packing rules.
665PASS_PACKING := Packing
666PASS_PACKING_trgs :=
667PASS_PACKING_vars := _PACKING
668PASS_PACKING_pass := packing
669#alias
670packing: pass_packing
671
672## PASS: clean
673# This pass removes all generated files.
674PASS_CLEAN := Clean
675PASS_CLEAN_trgs := do-clean
676PASS_CLEAN_vars :=
677PASS_CLEAN_pass := clean
678# alias
679clean: pass_clean
680
681## PASS: nothing
682# This pass just walks the tree.
683PASS_NOTHING := Nothing
684PASS_NOTHING_trgs := do-nothing
685PASS_NOTHING_vars :=
686PASS_NOTHING_pass := nothing
687# alias
688nothing: pass_nothing
689
690## DEFAULT_PASSES
691# The default passes and their order.
692DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
693
694## PASSES
695# The passes that should be defined. This must include
696# all passes mentioned by DEFAULT_PASSES.
697PASSES := $(DEFAULT_PASSES) NOTHING CLEAN
698
699
700#
701# This is how we find the closest config.kmk.
702# It's a little hacky but I think it works fine.
703#
704_CFGDIR := .
705_CFGFILES := ./Config.kmk ./config.kmk
706define def_include_config
707$(eval _CFGDIR := $(_CFGDIR)/$(dir))
708_CFGFILES += $(_CFGDIR)/Config.kmk $(_CFGDIR)/config.kmk
709endef
710# walk down the _RELATIVE_ path specified by DEPTH.
711$(foreach dir,$(subst /, ,$(DEPTH)), $(eval $(def_include_config)) )
712# add the default config file.
713_CFGFILE := $(firstword $(wildcard $(_CFGFILES) $(FILE_KBUILD_CONFIG)))
714_CFGFILES :=
715_CFGDIR :=
716ifeq ($(_CFGFILE),)
717$(error kBuild: no Config.kmk file found! Check the DEPTH: DEPTH='$(DEPTH)' PATH_CURRENT='$(PATH_CURRENT)')
718endif
719
720# Include the config.kmk we found file (or the default one).
721include $(_CFGFILE)
722
723
724# end-of-file-content
725__header_kmk__ := 1
726endif # __header_kmk__
Note: See TracBrowser for help on using the repository browser.