source: trunk/kBuild/header.kmk@ 391

Last change on this file since 391 was 380, checked in by bird, 20 years ago

Big command dependency job. More installation stuff.

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