Ignore:
Timestamp:
Aug 2, 2011, 9:44:43 PM (14 years ago)
Author:
bird
Message:

Quick implementation of PRE_[FILE|SYMLINK|DIRECTORY_CMDS on installs. Fixes #104.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer-pass2-installs.kmk

    r2531 r2537  
    4545$(stagedst) : $(srcsrc) | $(dir $(stagedst))
    4646        %$$(call MSG_INST_FILE,$(srcsrc),$(stagedst))
     47        $(top_pre_file_cmds)
    4748        $$(QUIET)$(stagecmd)
     49        $(top_post_file_cmds)
    4850endef
    4951$(eval-opt-var def_install_src_rule_staging)
     
    5456$(instdst) : $(srcsrc) | $(dir $(instdst))
    5557        %$$(call MSG_INST_FILE,$(srcsrc),$(instdst))
     58        $(top_pre_file_cmds)
    5659        $$(QUIET)$(instcmd)
     60        $(top_post_file_cmds)
    5761endef
    5862$(eval-opt-var def_install_src_rule_installing)
     
    245249        %$$(call MSG_INST_SYM,$(stagedst),$(symdst))
    246250        $$(QUIET)$$(RM) -f -- $$@
     251        $(top_pre_sym_cmds)
    247252        $$(QUIET)$$(LN_SYMLINK) $(symdst) $(stagedst)
     253        $(top_post_sym_cmds)
    248254endef
    249255$(eval-opt-var def_install_symlink_rule_staging)
     
    254260        %$$(call MSG_INST_SYM,$(instdst),$(symdst))
    255261        $$(QUIET)$$(RM) -f -- $$@
     262        $(top_pre_sym_cmds)
    256263        $$(QUIET)$$(LN_SYMLINK) $(symdst) $(instdst)
     264        $(top_post_sym_cmds)
    257265endef
    258266$(eval-opt-var def_install_symlink_rule_installing)
     
    331339$(insdst):
    332340        %$$(call MSG_INST_DIR,$(insdst))
     341        $(top_pre_dir_cmds)
    333342        $$(QUIET)$$(INSTALL) -d \
    334343                $(if $(uid),-o $(uid))\
     
    337346                $(flags) -- \
    338347                $(insdst)
     348        $(top_post_dir_cmds)
    339349
    340350.NOTPARALLEL: $(insdst)
     
    452462
    453463ifneq ($(insttype),none)
    454  # cache top level target properties.
     464 # Cache top level target properties.
    455465 local top_mode := $(firstword \
    456466        $($(target)_MODE.$(bld_trg).$(bld_trg_arch)) \
     
    482492   local top_instfun := _INSTALL_FILE
    483493 endif
     494 # The user have to use double expansion and can only use the above locals. Not 100% optimal...
     495 local top_pre_file_cmds  := $(evalcall def_fn_prop_get_first_defined,PRE_XFILE_CMDS)
     496 local top_post_file_cmds := $(evalcall def_fn_prop_get_first_defined,POST_XFILE_CMDS)
     497 local top_pre_sym_cmds   := $(evalcall def_fn_prop_get_first_defined,PRE_SYMLINK_CMDS)
     498 local top_post_sym_cmds  := $(evalcall def_fn_prop_get_first_defined,POST_SYMLINK_CMDS)
     499 local top_pre_dir_cmds   := $(evalcall def_fn_prop_get_first_defined,PRE_DIRECTORY_CMDS)
     500 local top_post_dir_cmds  := $(evalcall def_fn_prop_get_first_defined,POST_DIRECTORY_CMDS)
    484501
    485502 $(foreach directory, \
Note: See TracChangeset for help on using the changeset viewer.