VirtualBox

Changeset 2479 in kBuild


Ignore:
Timestamp:
Jul 20, 2011 2:16:19 PM (13 years ago)
Author:
bird
Message:

footer.kmk,header.kmk,qt*.kmk: Installalation and staging enhancements.

Location:
trunk/kBuild
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r2477 r2479  
    130130_DIRS     := $(PATH_TARGET)/ $(PATH_TARGET) $(BLDDIRS)
    131131_IMPORT_LIBS :=
     132
     133# Implicit targets added while processing other targets (usually by units).
     134_ALL_INSTALLS_IMPLICIT :=
    132135
    133136# misc
     
    21492152        $(pre_install_cmds)
    21502153
    2151         $$(QUIET)$$(INSTALL) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@
     2154        $$(QUIET)$$(INSTALL_STAGING) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@
    21522155        $(post_install_cmds)
    21532156
     
    30233026local stagedst := $(call $(instfun),$(srcdst),$(target),$(stage),$(PATH_STAGE))
    30243027
    3025 local inst     := $(firstword $($(srcsrc)_INST) $($(target)_1_INST))
    3026 ifneq ($(substr $(inst),-1),/)
    3027  $(warning kBuild: File $(srcsrc) in install target $(target) has a INST property without a trailing slash.)
    3028  local inst    := $(inst)/
    3029 endif
    3030 local inst     := $(inst)$(dir $(srcdstdir))
    3031 local instdst  := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
     3028ifeq ($(insttype),both)
     3029 local inst     := $(firstword $($(srcsrc)_INST) $($(target)_1_INST))
     3030 ifneq ($(substr $(inst),-1),/)
     3031  $(warning kBuild: File $(srcsrc) in install target $(target) has a INST property without a trailing slash.)
     3032  local inst    := $(inst)/
     3033 endif
     3034 local inst     := $(inst)$(dir $(srcdstdir))
     3035 local instdst  := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
     3036endif
    30323037
    30333038#$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => instdst=$(instdst); stage=$(stage) => stagedst=$(stagedst))
     
    31173122endif
    31183123
    3119 # create the commands
     3124# Generate the staging rule (requires double evaluation).
    31203125ifdef $(srcsrc)_INSTALLER
    3121  local stagecmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(stagedst),$(target),$(flags))
    3122  local instcmd  := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags))
     3126 local stagecmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(stagedst),$(target),$(flags),stage)
    31233127else ifdef $(target)_INSTALLER
    3124  local stagecmd := $(call $(target)_INSTALLER,$(srcsrc),$(stagedst),$(target),$(flags))
    3125  local instcmd  := $(call $(target)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags))
     3128 local stagecmd := $(call $(target)_INSTALLER,$(srcsrc),$(stagedst),$(target),$(flags),stage)
    31263129else
    3127  local stagecmd := $$(INSTALL)\
     3130 local stagecmd := $$(INSTALL_STAGING)\
    31283131                $(if $(uid),-o $(uid))\
    31293132                $(if $(gid),-g $(gid))\
     
    31313134                $(flags) -- \
    31323135                $(srcsrc) $(stagedst)
    3133  local instcmd := $$(INSTALL)\
    3134                 $(if $(uid),-o $(uid))\
    3135                 $(if $(gid),-g $(gid))\
    3136                 $(if $(mode),-m $(mode))\
    3137                 $(flags) -- \
    3138                 $(srcsrc) $(instdst)
    3139 endif
    3140 
    3141 # Generate the staging rule (requires double evaluation).
     3136endif
    31423137$(eval $(def_install_src_rule_staging))
    31433138$(target)_2_STAGE_TARGETS += $(stagedst)
     
    31453140# Generate the install rule
    31463141ifeq ($(insttype),both)
     3142 ifdef $(srcsrc)_INSTALLER
     3143  local instcmd  := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags),install)
     3144 else ifdef $(target)_INSTALLER
     3145  local instcmd  := $(call $(target)_INSTALLER,$(srcsrc),$(instdst),$(target),$(flags),install)
     3146 else
     3147  local instcmd := $$(INSTALL)\
     3148                $(if $(uid),-o $(uid))\
     3149                $(if $(gid),-g $(gid))\
     3150                $(if $(mode),-m $(mode))\
     3151                $(flags) -- \
     3152                $(srcsrc) $(instdst)
     3153 endif
    31473154 $(eval $(def_install_src_rule_installing))
    31483155 $(target)_2_INST_TARGETS += $(instdst)
     
    34433450$(eval-opt-var def_install)
    34443451
    3445 ## process all install targets
     3452## Do pass 1 on the implicit targets and add them to the list.
     3453$(foreach target, $(_ALL_INSTALLS_IMPLICIT), \
     3454        $(evalval def_pass1_install))
     3455_ALL_INSTALLS += $(_ALL_INSTALLS_IMPLICIT)
     3456
     3457## Do pass 2 on all install targets.
    34463458$(foreach target, $(_ALL_INSTALLS), \
    34473459        $(evalvalctx def_install))
  • trunk/kBuild/header.kmk

    r2475 r2479  
    391391
    392392# Install directory layout.  Relative to PATH_INS.
     393KBUILD_INST_PATHS   := BIN DLL SYS LIB DOC DEBUG SBIN LIBEXEC SHARE
    393394INST_BIN             = bin/
    394395if1of ($(KBUILD_TARGET), win)
     
    419420STAGE_LIBEXEC        = $(INST_LIBEXEC)
    420421STAGE_SHARE          = $(INST_SHARE)
     422
     423# Install and staging directory paths.
     424$(foreach path, $(KBUILD_INST_PATHS), \
     425        $(eval PATH_STAGE_$(path) = $$(patsubst %/,%,$$(PATH_STAGE)/$$(STAGE_$(path)))) \
     426        $(eval PATH_INST_$(path) = $$(patsubst %/,%,$$(PATH_INS)/$$(INST_$(path)))) \
     427)
    421428
    422429# Output directories.
     
    689696# Symlinking is problematic on some platforms...
    690697LN_SYMLINK  := $(LN) -s
     698
     699# When copying to the staging area, use hard links to save time and space.
     700if1of ($(KMK_FEATURES), install-hard-linking)
     701INSTALL_STAGING := $(INSTALL) --hard-link-files-when-possible
     702else
     703INSTALL_STAGING := $(INSTALL)
     704endif
    691705
    692706
     
    12461260endif
    12471261$($(y)_$(x) := $(val)
     1262
     1263local val := $(strip $(PATH_$(y)_$(x)))
     1264ifeq ($(val),)
     1265 $(error kBuild: 'PATH_$(y)_$(x)' is set to an empty value.)
     1266endif
     1267PATH_$(y)_$(x) := $(val)
    12481268endef
    1249 $(foreach y, INST STAGE, $(foreach x, BIN DLL SYS LIB DOC SBIN LIBEXEC SHARE DEBUG, $(evalcall def_kbuild_finalize_inst)))
     1269$(foreach y, INST STAGE, $(foreach x, $(KBUILD_INST_PATHS), $(evalcall def_kbuild_finalize_inst)))
    12501270
    12511271
  • trunk/kBuild/units/qt3.kmk

    r2413 r2479  
    905905        $($(target)_QT_TRANSLATIONS)
    906906ifneq ($(strip $(translations)),)
    907  local expr := _ALL_INSTALLS += $(target)-inst-nls
     907 local expr := _ALL_INSTALLS_IMPLICIT += $(target)-inst-nls
    908908 $(eval $(expr))
    909909 ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
  • trunk/kBuild/units/qt4.kmk

    r2478 r2479  
    10321032        $($(target)_QT_TRANSLATIONS)
    10331033ifneq ($(strip $(translations)),)
    1034  local expr := _ALL_INSTALLS += $(target)-inst-nls/
     1034 local expr := _ALL_INSTALLS_IMPLICIT += $(target)-inst-nls
    10351035 $(eval $(expr))
    10361036 ifdef $(target)_QT_TRANSLATIONS_TEMPLATE
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette