source: trunk/kBuild/header.kmk@ 417

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

Check for PACKING.$(BUILD_TARGET) as well.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.4 KB
RevLine 
[69]1# $Id: header.kmk 417 2006-01-20 12:07:51Z 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
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)
[397]372DEP := kmk_builtin_kDep
[230]373else
[380]374DEP := $(DEP_EXT)
[230]375endif
[69]376
[397]377DEP_IDB_EXT := $(PATH_TOOLS)/kDepIDB$(HOSTSUFF_EXE)
378ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepIDB)
379DEP_IDB := $(if kmk_builtin_kDepIDB
380else
381DEP_IDB := $(DEP_IDB_EXT)
382endif
383
[380]384DEP_PRE_EXT := $(PATH_TOOLS)/kDepPre$(HOSTSUFF_EXE)
385ifeq ($(filter kDepPre,$(KMK_BUILTIN)),kDepPre)
386DEP_PRE := $(if kmk_builtin_kDepPre
387else
388DEP_PRE := $(DEP_PRE_EXT)
389endif
390
391APPEND_EXT := $(PATH_TOOLS)/kmk_append$(HOSTSUFF_EXE)
[353]392ifeq ($(filter append,$(KMK_BUILTIN)),append)
[380]393APPEND := kmk_builtin_append
[353]394else
[380]395APPEND := $(APPEND_EXT)
[353]396endif
[69]397
[380]398CAT_EXT := $(PATH_TOOLS)/kmk_cat$(HOSTSUFF_EXE)
399ifeq ($(filter cat,$(KMK_BUILTIN)),cat)
400CAT := kmk_builtin_cat
401else
402CAT := $(CAT_EXT)
403endif
[353]404
[380]405CP_EXT := $(PATH_TOOLS)/kmk_cp$(HOSTSUFF_EXE)
406ifeq ($(filter cp,$(KMK_BUILTIN)),cp)
407CP := kmk_builtin_cp
408else
409CP := $(CP_EXT)
410endif
411
412ECHO_EXT := $(PATH_TOOLS)/kmk_echo$(HOSTSUFF_EXE)
413ifeq ($(filter echo,$(KMK_BUILTIN)),echo)
414ECHO := kmk_builtin_echo
415else
416ECHO := $(ECHO_EXT)
417endif
418
419INSTALL_EXT := $(PATH_TOOLS)/kmk_install$(HOSTSUFF_EXE)
420ifeq ($(filter install,$(KMK_BUILTIN)),install)
421INSTALL := kmk_builtin_install
422else
423INSTALL := $(INSTALL_EXT)
424endif
425
426LN_EXT := $(PATH_TOOLS)/kmk_ln$(HOSTSUFF_EXE)
427ifeq ($(filter ln,$(KMK_BUILTIN)),ln)
428LN := kmk_builtin_ln
429else
430LN := $(LN_EXT)
431endif
432
433MKDIR_EXT := $(PATH_TOOLS)/kmk_mkdir$(HOSTSUFF_EXE)
434ifeq ($(filter mkdir,$(KMK_BUILTIN)),mkdir)
435MKDIR := kmk_builtin_mkdir
436else
437MKDIR := $(MKDIR_EXT)
438endif
439
440MV_EXT := $(PATH_TOOLS)/kmk_mv$(HOSTSUFF_EXE)
441ifeq ($(filter mv,$(KMK_BUILTIN)),mv)
442MV := kmk_builtin_mv
443else
444MV := $(MV_EXT)
445endif
446
447RM_EXT := $(PATH_TOOLS)/kmk_rm$(HOSTSUFF_EXE)
448ifeq ($(filter rm,$(KMK_BUILTIN)),rm)
449RM := kmk_builtin_rm
450else
451RM := $(RM_EXT)
452endif
453
454SED_EXT := $(PATH_TOOLS)/kmk_sed$(HOSTSUFF_EXE)
455ifeq ($(filter sed,$(KMK_BUILTIN)),sed)
456SED := kmk_builtin_sed
457else
458SED := $(SED_EXT)
459endif
460
461# Our default shell is the Almquist shell from *BSD.
462ASH := $(PATH_TOOLS)/kmk_ash$(HOSTSUFF_EXE)
463MAKESHELL := $(ASH)
464SHELL := $(ASH)
465export SHELL MAKESHELL
466
[414]467# Symlinking is problematic on some platforms...
[380]468LN_SYMLINK := $(LN) -s
469
470
471
[69]472#
[73]473# Message macros.
[204]474#
475
[73]476ifndef BUILD_QUIET
[75]477ifdef BUILD_DEBUG
478BUILD_VERBOSE := 9
479endif
[230]480MSG_L1 = @$(ECHO) "kBuild: $1"
[73]481ifdef BUILD_VERBOSE
[230]482MSG_L2 = @$(ECHO) "kBuild: $1"
[75]483QUIET :=
[73]484else
[75]485QUIET := @
[73]486MSG_L2 =
487endif
488ifdef BUILD_DEBUG
[230]489MSG_L3 = @$(ECHO) "kBuild: $1"
[73]490else
491MSG_L3 =
492endif
493else
[75]494QUIET :=
[73]495MSG_L1 =
496MSG_L2 =
497MSG_L3 =
498endif
499
[130]500## ABSPATH - make paths absolute.
[129]501# This implementation is clumsy and doesn't resolve '..' and '.' components.
[73]502#
[129]503# @param $1 The paths to make absolute.
[306]504ifeq ($(filter abspath,$(KMK_FEATURES)),abspath)
505ABSPATH = $(abspath $(1))
506else
[129]507ABSPATH = $(foreach path,$(1)\
508 ,$(strip $(if $(subst <,,$(firstword $(subst /, ,<$(path)))),\
509 $(if $(patsubst %:,,$(firstword $(subst :,: ,$(path)))),$(PATH_CURRENT)/$(path),$(path)),\
510 $(path))))
[306]511endif
[353]512
[130]513## DIRDEP - make create directory dependencies.
514#
515# @param $1 The paths to the directories which must be created.
[353]516ifeq ($(BUILD_PLATFORM),win32)
517DIRDEP = $(patsubst %/,%,$(1))
518else
519DIRDEP = $(foreach path,$(patsubst %/,%,$(1)),$(path)/)
520endif
[129]521
[204]522
[129]523## Cygwin kludge.
524# This converts /cygdrive/x/% to x:%.
525#
526# @param $1 The paths to make native.
527# @remark This macro is pretty much obsolete since we don't use cygwin base make.
528ifneq ($(patsubst /cygdrive/%,%,$(CURDIR)),$(CURDIR))
529CYGPATHMIXED = $(foreach path,$(1)\
530 ,$(if $(patsubst /cygdrive/%,,$(path)),$(path),$(patsubst $(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path)))))/%,$(strip $(firstword $(subst /, ,$(patsubst /cygdrive/%,%,$(path))))):/%,$(patsubst /cygdrive/%,%,$(path)))))
531else
532CYGPATHMIXED = $(1)
533endif
534
535#
[353]536# Initialize some of the globals which the Config.kmk and
537# others can add stuff to if they like for processing in the footer.
538#
539
540## ALL_TARGET
541# This is the list of all targets.
542ALL_TARGETS :=
543
544## TEMPLATE_PATHS
545# List a paths (separated by space) where templates can be found.
546TEMPLATE_PATHS :=
547
548## TOOL_PATHS
549# List of paths (separated by space) where tools can be found.
550TOOL_PATHS :=
551
552## SDK_PATHS
553# List of paths (separated by space) where SDKs can be found.
554SDK_PATHS :=
555
556## Proritized list of the default makefile when walking subdirectories.
557# The user can overload this list.
558DEFAULT_MAKEFILE := Makefile.kmk makefile.kmk Makefile makefile
559
560## PROPS_SINGLE
561# The list of non-accumulative target properties.
562# A Config.kmk file can add it's own properties to this list and kBuild
563# will do the necessary inheritance from templates to targets.
564PROPS_SINGLE := TOOL ARTOOL CTOOL CXXTOOL ASTOOL LDTOOL INST NOINST
565
566## PROPS_DEFERRED
567# This list of non-accumulative target properties which are functions,
568# and thus should not be expanded until the very last moment.
569PROPS_DEFERRED := INSTFUN INSTALLER
570
571## PROPS_ACCUMULATE
572# The list of accumulative target properties.
573# A Config.kmk file can add it's own properties to this list and kBuild
574# will do the necessary inheritance from templates to targets.
575PROPS_ACCUMULATE := \
576 SDKS DEFS INCS SOURCES \
577 COPTS CFLAGS CDEFS CINCS CXXOPTS CXXFLAGS CXXDEFS CXXINCS \
578 ASOPTS ASFLAGS ASDEFS ASINCS \
579 LDFLAGS LIBS LIBPATH \
580 BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU \
581 SYSSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \
582
583
584## PROPS_TOOLS
585# This is a subset of the other PROPS
586PROPS_TOOLS := TOOL CTOOL CXXTOOL ASTOOL ARTOOL LDTOOL
587
588
589#
590# Pass configuration.
591#
592# The PASS_<passname>_trgs variable is listing the targets.
593# The PASS_<passname>_vars variable is listing the target variables.
594# The PASS_<passname>_pass variable is the lowercased passname.
595#
596
597## PASS: bldprogs
598# This pass builds targets which are required for building the rest.
599PASS_BLDPROGS := Build Programs
600PASS_BLDPROGS_trgs :=
601PASS_BLDPROGS_vars := _BLDPROGS
602PASS_BLDPROGS_pass := bldprogs
603
604## PASS: libraries
605# This pass builds library targets.
606PASS_LIBRARIES := Libraries
607PASS_LIBRARIES_trgs :=
608PASS_LIBRARIES_vars := _LIBS _IMPORT_LIBS _OTHER_LIBRARIES
609PASS_LIBRARIES_pass := libraries
610
611## PASS: binaries
612# This pass builds dll targets.
613PASS_DLLS := DLLs
614PASS_DLLS_trgs :=
615PASS_DLLS_vars := _DLLS _OTHER_DLLS
616PASS_DLLS_pass := dlls
617
618## PASS: binaries
619# This pass builds binary targets, i.e. programs, system modules and stuff.
620PASS_BINARIES := Programs
621PASS_BINARIES_trgs :=
622PASS_BINARIES_vars := _PROGRAMS _SYSMODS _OTHER_BINARIES
623PASS_BINARIES_pass := binaries
624
625## PASS: others
626# This pass builds other targets.
627PASS_OTHERS := Other Stuff
628PASS_OTHERS_trgs :=
629PASS_OTHERS_vars := _OTHERS
630PASS_OTHERS_pass := others
631
632## PASS: install
633# This pass installs the built entities to a sandbox area.
634PASS_INSTALLS := Install
635PASS_INSTALLS_trgs :=
[380]636PASS_INSTALLS_vars := _INSTALLS_DIRS _INSTALLS
[353]637PASS_INSTALLS_pass := installs
638
639## PASS: packing
640# This pass processes custom packing rules.
641PASS_PACKING := Packing
[414]642PASS_PACKING_trgs :=
[417]643PASS_PACKING_vars := _PACKING
[353]644PASS_PACKING_pass := packing
[414]645#alias
646packing: pass_packing
[353]647
648## PASS: clean
649# This pass removes all generated files.
650PASS_CLEAN := Clean
651PASS_CLEAN_trgs := do-clean
652PASS_CLEAN_vars :=
653PASS_CLEAN_pass := clean
654# alias
655clean: pass_clean
656
657## PASS: nothing
658# This pass just walks the tree.
659PASS_NOTHING := Nothing
660PASS_NOTHING_trgs := do-nothing
661PASS_NOTHING_vars :=
662PASS_NOTHING_pass := nothing
663# alias
664nothing: pass_nothing
665
666## DEFAULT_PASSES
667# The default passes and their order.
668DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
669
670## PASSES
671# The passes that should be defined. This must include
672# all passes mentioned by DEFAULT_PASSES.
673PASSES := $(DEFAULT_PASSES) NOTHING CLEAN
674
675
676#
[69]677# This is how we find the closest config.kmk.
678# It's a little hacky but I think it works fine.
[70]679#
680_CFGDIR := .
[78]681_CFGFILES := ./Config.kmk ./config.kmk
[69]682define def_include_config
[78]683$(eval _CFGDIR := $(_CFGDIR)/$(dir))
684_CFGFILES += $(_CFGDIR)/Config.kmk $(_CFGDIR)/config.kmk
[69]685endef
686# walk down the _RELATIVE_ path specified by DEPTH.
[78]687$(foreach dir,$(subst /, ,$(DEPTH)), $(eval $(def_include_config)) )
[69]688# add the default config file.
[78]689_CFGFILE := $(firstword $(wildcard $(_CFGFILES) $(FILE_KBUILD_CONFIG)))
[69]690_CFGFILES :=
691_CFGDIR :=
[416]692ifeq ($(_CFGFILE),)
693$(error kBuild: no Config.kmk file found! Check the DEPTH: DEPTH='$(DEPTH)' PATH_CURRENT='$(PATH_CURRENT)')
694endif
[69]695
696# Include the config.kmk we found file (or the default one).
697include $(_CFGFILE)
698
699
700# end-of-file-content
[72]701__header_kmk__ := 1
[69]702endif # __header_kmk__
Note: See TracBrowser for help on using the repository browser.