add default Build/Install template, which is activated by setting PKG_INSTALL=1
authorFelix Fietkau <nbd@openwrt.org>
Wed, 3 Sep 2008 13:19:50 +0000 (13:19 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 3 Sep 2008 13:19:50 +0000 (13:19 +0000)
SVN-Revision: 12512

include/package-defaults.mk
include/package.mk

index fd50cb4d81d9c569cefdada108843dd45bd21fba..c086cc21cc4c6f53071cb8272ab8f0814c0ea63c 100644 (file)
@@ -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
index e0f8c719f4cfe14af55fe587a4152c6e7472421f..9c6503799bc5ec489e8ce6610c28b87fd0148625 100644 (file)
@@ -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 $@