Changeset 40527


Ignore:
Timestamp:
2014-04-18T16:58:01+02:00 (4 years ago)
Author:
nbd
Message:

build: reimplement package build directory override

Remove leftover pieces from package-version-override.mk support
Add a new variable USE_SOURCE_DIR to use a custom build directory.

Signed-off-by: Felix Fietkau <nbd@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/package.mk

    r39792 r40527  
    6767  QUILT:=1 
    6868endif 
     69ifdef USE_SOURCE_DIR 
     70  QUILT:=1 
     71endif 
     72ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),) 
     73  QUILT:=1 
     74endif 
    6975 
    7076PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR))) 
     
    94100    endef 
    95101  endif 
    96 endif 
    97  
    98 ifeq ($(CONFIG_$(PKG_NAME)_USE_CUSTOM_SOURCE_DIR),y) 
    99 # disable load stage 
    100 PKG_SOURCE_URL:= 
    101 # add hook to install a link to customer source path of dedicated package 
    102 Hooks/Prepare/Pre += prepare_custom_source_directory 
    103 ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),) 
    104   Hooks/Configure/Pre += autoreconf_target 
    105 endif 
    106 # define empty default action 
    107 define Build/Prepare/Default 
    108         @:  
    109 endef 
    110102endif 
    111103 
     
    128120  endef 
    129121endif 
     122ifdef USE_SOURCE_DIR 
     123  define Build/Prepare/Default 
     124        rm -rf $(PKG_BUILD_DIR) 
     125        $(if $(wildcard $(USE_SOURCE_DIR)/*),,@echo "Error: USE_SOURCE_DIR=$(USE_SOURCE_DIR) path not found"; false) 
     126        ln -snf $(USE_SOURCE_DIR) $(PKG_BUILD_DIR) 
     127        touch $(PKG_BUILD_DIR)/.source_dir 
     128  endef 
     129endif 
    130130 
    131131define Build/Exports/Default 
     
    142142define Build/DefaultTargets 
    143143  $(if $(QUILT),$(Build/Quilt)) 
    144   $(if $(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))) 
     144  $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default))) 
    145145  $(call Build/Autoclean) 
    146146 
Note: See TracChangeset for help on using the changeset viewer.