From 4a0457153b86e50ea5c231af2290971aa1588066 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 3 Sep 2008 13:19:50 +0000 Subject: add default Build/Install template, which is activated by setting PKG_INSTALL=1 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12512 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/package-defaults.mk | 11 +++++++++++ include/package.mk | 15 ++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/package-defaults.mk b/include/package-defaults.mk index fd50cb4d81..c086cc21cc 100644 --- a/include/package-defaults.mk +++ b/include/package-defaults.mk @@ -102,6 +102,10 @@ MAKE_FLAGS = \ CROSS="$(TARGET_CROSS)" \ ARCH="$(ARCH)" +MAKE_INSTALL_FLAGS = \ + $(MAKE_FLAGS) \ + DESTDIR="$(PKG_INSTALL_DIR)" + MAKE_PATH = . define Build/Compile/Default @@ -110,3 +114,10 @@ define Build/Compile/Default $(MAKE_FLAGS) \ $(1); endef + +define Build/Install/Default + $(MAKE_VARS) \ + $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \ + $(MAKE_INSTALL_FLAGS) \ + $(1) install; +endef diff --git a/include/package.mk b/include/package.mk index e0f8c719f4..9c6503799b 100644 --- a/include/package.mk +++ b/include/package.mk @@ -150,17 +150,10 @@ define pkg_install_bin $(foreach install_apps,$(1),$(INSTALL_DIR) $(3)/`dirname $(install_apps)`; $(INSTALL_BIN) $(2)/$(install_apps) $(3)/`dirname $(install_apps)`;) endef -define Build/Prepare - $(call Build/Prepare/Default,) -endef - -define Build/Configure - $(call Build/Configure/Default,) -endef - -define Build/Compile - $(call Build/Compile/Default,) -endef +Build/Prepare=$(call Build/Prepare/Default,) +Build/Configure=$(call Build/Configure/Default,) +Build/Compile=$(call Build/Compile/Default,) +Build/Install=$(if $(PKG_INSTALL),$(call Build/Install/Default,)) $(PACKAGE_DIR): mkdir -p $@ -- cgit v1.2.3