source: trunk/kBuild/header.kmk@ 464

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

Changed the default output directory structure with respect to build target + arch + target sub. [Blast x86 output compatibility].

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