Ignore:
Timestamp:
Jul 16, 2011, 10:08:07 PM (14 years ago)
Author:
bird
Message:

kBuild/footer+header.kmk: Reworking installation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r2441 r2475  
    390390endif
    391391
     392# Install directory layout.  Relative to PATH_INS.
     393INST_BIN             = bin/
     394if1of ($(KBUILD_TARGET), win)
     395INST_DLL             = bin/
     396else
     397INST_DLL             = lib/
     398endif
     399if1of ($(KBUILD_TARGET), os2 win)
     400INST_SYS             = drivers/
     401else
     402INST_SYS             = kernel/
     403endif
     404INST_LIB             = lib/
     405INST_DOC             = share/doc/
     406INST_DEBUG           = debug/
     407INST_SBIN            = sbin/
     408INST_LIBEXEC         = libexec/
     409INST_SHARE           = share/
     410
     411# Staging directory layout. Relative to PATH_STAGE.
     412STAGE_BIN            = $(INST_BIN)
     413STAGE_DLL            = $(INST_DLL)
     414STAGE_SYS            = $(INST_SYS)
     415STAGE_LIB            = $(INST_LIB)
     416STAGE_DOC            = $(INST_DOC)
     417STAGE_DEBUG          = $(INST_DEBUG)
     418STAGE_SBIN           = $(INST_SBIN)
     419STAGE_LIBEXEC        = $(INST_LIBEXEC)
     420STAGE_SHARE          = $(INST_SHARE)
     421
    392422# Output directories.
    393423ifndef PATH_OUT_BASE
     
    404434PATH_OBJ             = $(PATH_OUT)/obj
    405435PATH_TARGET          = $(PATH_OBJ)/$(CURSUBDIR)
    406 PATH_INS             = $(PATH_OUT)
    407 PATH_BIN             = $(PATH_INS)/bin
    408 PATH_DLL             = $(PATH_INS)/bin
    409 PATH_SYS             = $(PATH_INS)/bin
    410 PATH_LIB             = $(PATH_INS)/lib
    411 PATH_DOC             = $(PATH_INS)/doc
     436PATH_STAGE           = $(PATH_OUT)/stage
     437ifndef PATH_INS
     438 ifdef DESTROOT
     439PATH_INS             = $(DESTROOT)
     440 else
     441PATH_INS             = $(PATH_OUT)/dist
     442 endif
     443endif
    412444
    413445# Development tool tree.
     
    840872# A Config.kmk file can add it's own properties to this list and kBuild
    841873# will do the necessary inheritance for templates, sdks, tools and targets.
    842 PROPS_SINGLE := $(PROPS_TOOLS) TEMPLATE INST NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU FETCHDIR \
     874PROPS_SINGLE := $(PROPS_TOOLS) TEMPLATE INSTTYPE INST STAGE NOINST BLD_TYPE BLD_TRG BLD_TRG_ARCH BLD_TRG_CPU FETCHDIR \
    843875        OBJSUFF COBJSUFF CXXOBJSUFF OBJCOBJSUFF OBJCXXOBJSUFF ASOBJSUFF RCOBJSUFF SYSSUFF BINSUFF EXESUFF DLLSUFF LIBSUFF ARLIBSUFF \
    844876        MODE UID GID
     
    853885# This list of non-accumulative target properties which are or may be
    854886# functions, and thus should not be expanded until the very last moment.
    855 PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS NAME SONAME
     887PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS PRE_INST_CMDS POST_INST_CMDS NAME SONAME
    856888
    857889## PROPS_ACCUMULATE_R
     
    949981PROPS_INSTALLS_SINGLE        := TOOL TEMPLATE INST NOINST
    950982PROPS_INSTALLS_DEFERRED      := INSTFUN INSTALLER
    951 PROPS_INSTALLS_ACCUMULATE_R  := DEPS ORDERDEPS
     983PROPS_INSTALLS_ACCUMULATE_R  := DEPS ORDERDEPS GOALS INST_ONLY_GOALS STAGE_ONLY_GOALS
    952984PROPS_INSTALLS_ACCUMULATE_L  := SOURCES DIRS CLEAN
    953985## @}
    954986
    955 ## @name Properties valid on fetches (INSTALLS)
     987## @name Properties valid on fetches (FETCHES)
    956988## @{
    957989PROPS_FETCHES_SINGLE         := TOOL TEMPLATE FETCHTOOL UNPACKTOOL PATCHTOOL INST FETCHDIR
     
    10691101PASS_OTHERS_pass    := others
    10701102
    1071 ## PASS: install
     1103## PASS: staging
    10721104# This pass installs the built entities to a sandbox area.
    10731105## @todo split this up into build install (to sandbox) and real installation.
     1106PASS_STAGING        := Staging
     1107PASS_STAGING_trgs   :=
     1108PASS_STAGING_vars   := _STAGING_DIRS _INSTALLS _STAGING_FILES
     1109PASS_STAGING_pass   := staging
     1110
     1111## PASS: install
     1112# This pass installs the built entities to where they will be used (using
     1113# DESTROOT or PATH_INS to indicate where this is).
    10741114PASS_INSTALLS       := Install
    10751115PASS_INSTALLS_trgs  :=
    1076 PASS_INSTALLS_vars  := _INSTALLS_DIRS _INSTALLS _INSTALLS_FILES
     1116PASS_INSTALLS_vars  := _INSTALLS_DIRS _INSTALLS_FILES
    10771117PASS_INSTALLS_pass  := installs
    10781118
     
    11071147## DEFAULT_PASSES
    11081148# The default passes and their order.
    1109 DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS INSTALLS
     1149DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES OTHERS STAGING
    11101150
    11111151## PASSES
    11121152# The passes that should be defined. This must include
    11131153# all passes mentioned by DEFAULT_PASSES.
    1114 PASSES := FETCHES PATCHES $(DEFAULT_PASSES) TESTING PACKING CLEAN NOTHING
     1154PASSES := FETCHES PATCHES $(DEFAULT_PASSES) INSTALLS TESTING PACKING CLEAN NOTHING
    11151155
    11161156
     
    11781218#
    11791219PATH_OUT_BASE := $(abspath $(PATH_OUT_BASE))
    1180 PATH_OUT    := $(abspath $(PATH_OUT))
    1181 PATH_OBJ    := $(abspath $(PATH_OBJ))
    1182 PATH_TARGET := $(abspath $(PATH_TARGET))
    1183 PATH_INS    := $(abspath $(PATH_INS))
    1184 PATH_BIN    := $(abspath $(PATH_BIN))
    1185 PATH_DLL    := $(abspath $(PATH_DLL))
    1186 PATH_SYS    := $(abspath $(PATH_SYS))
    1187 PATH_LIB    := $(abspath $(PATH_LIB))
    1188 PATH_DOC    := $(abspath $(PATH_DOC))
     1220PATH_OUT      := $(abspath $(PATH_OUT))
     1221PATH_OBJ      := $(abspath $(PATH_OBJ))
     1222PATH_TARGET   := $(abspath $(PATH_TARGET))
     1223PATH_INS      := $(abspath $(PATH_INS))
     1224PATH_STAGE    := $(abspath $(PATH_STAGE))
     1225
     1226# Finalize the install and staging directory layouts.
     1227define def_kbuild_finalize_inst
     1228local val := $(strip $($(y)_$(x)))
     1229ifeq ($(val),)
     1230 $(error kBuild: '$(y)_$(x)' is set to an empty value.)
     1231endif
     1232ifneq ($(words $(val)),1)
     1233 $(error kBuild: The '$(y)_$(x)' value '$(val)' should not contain spaces.)
     1234endif
     1235ifneq ($(pos \,$(val)), 0)
     1236 $(error kBuild: The '$(y)_$(x)' value '$(val)' contains DOS slashes: not allowed.)
     1237endif
     1238ifneq ($(pos $(COLON),$(val)), 0)
     1239 $(error kBuild: The '$(y)_$(x)' value '$(val)' contains colon: not allowed.)
     1240endif
     1241ifneq ($(substr $(val),-1), /)
     1242 $(error kBuild: The '$(y)_$(x)' value '$(val)' has no trailing slash.)
     1243endif
     1244if $(pos /../,$(val)) != 0 || "$(substr $(val), 3)" == "../"
     1245 $(error kBuild: The '$(y)_$(x)' value '$(val)' contains dot-dot escape.)
     1246endif
     1247$($(y)_$(x) := $(val)
     1248endef
     1249$(foreach y, INST STAGE, $(foreach x, BIN DLL SYS LIB DOC SBIN LIBEXEC SHARE DEBUG, $(evalcall def_kbuild_finalize_inst)))
    11891250
    11901251
Note: See TracChangeset for help on using the changeset viewer.