source: trunk/kBuild/header.kmk@ 692

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

tools location is being cleaned up.

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