source: trunk/kBuild/header.kmk@ 473

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

New feature: Sub-Makefile.

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