source: trunk/kBuild/header.kmk@ 672

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

KMK_REVISION experiment

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