summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-06 16:01:06 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-06 16:01:06 +0000
commita5ff4c2e978f74e3856b8500aa226b7f01f209e8 (patch)
treefc4fa7e354f89168dfef355257fe96bb8c5be74a /include
parent64adc2bb7a8179aad09d1f8b0a7434c9914a00b3 (diff)
build: rework the package/install step - collect package install lists during package/compile, then install all packages at once
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33631 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/package-ipkg.mk32
-rw-r--r--include/package.mk12
2 files changed, 18 insertions, 26 deletions
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 14520cfd9..665aac5d6 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -5,22 +5,6 @@
# See /LICENSE for more information.
#
-# where to build (and put) .ipk packages
-OPKG:= \
- IPKG_TMP=$(TMP_DIR)/ipkg \
- IPKG_INSTROOT=$(TARGET_DIR) \
- IPKG_CONF_DIR=$(STAGING_DIR)/etc \
- IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
- $(STAGING_DIR_HOST)/bin/opkg \
- --offline-root $(TARGET_DIR) \
- --force-depends \
- --force-overwrite \
- --force-postinstall \
- --force-maintainer \
- --add-dest root:/ \
- --add-arch all:100 \
- --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200
-
# invoke ipkg-build with some default options
IPKG_BUILD:= \
ipkg-build -c -o 0 -g 0
@@ -89,7 +73,6 @@ ifeq ($(DUMP),)
define BuildTarget/ipkg
IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
- INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
@@ -99,7 +82,15 @@ ifeq ($(DUMP),)
compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
ifeq ($(CONFIG_PACKAGE_$(1)),y)
- install: $$(INFO_$(1))
+ .PHONY: $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1)
+ compile: $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1)
+ $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1):
+ @if [ -f $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean ]; then \
+ rm -f \
+ $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install \
+ $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean; \
+ fi; \
+ echo "$(1)" >> $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install
endif
else
compile: $(1)-disabled
@@ -188,11 +179,6 @@ ifeq ($(DUMP),)
$(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
@[ -f $$(IPKG_$(1)) ]
- $$(INFO_$(1)): $$(IPKG_$(1))
- @[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
- $(OPKG) install $$(IPKG_$(1))
- $(if $(filter-out essential,$(PKG_FLAGS)),for flag in $(filter-out essential,$(PKG_FLAGS)); do $(OPKG) flag $$$$flag $(1); done,$(OPKG) flag ok $(1))
-
$(1)-clean:
rm -f $(PACKAGE_DIR)/$(1)_*
diff --git a/include/package.mk b/include/package.mk
index 3ec5ffdad..8b8cb1aae 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -13,7 +13,6 @@ PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_MD5SUM ?= unknown
PKG_BUILD_PARALLEL ?=
-PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
@@ -52,6 +51,8 @@ ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
QUILT:=1
endif
+PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
+
include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/package-defaults.mk
@@ -250,6 +251,11 @@ Build/DistCheck=$(call Build/DistCheck/Default,)
.NOTPARALLEL:
+.PHONY: prepare-package-install
+prepare-package-install:
+ @touch $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean
+ @echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.flags
+
$(PACKAGE_DIR):
mkdir -p $@
@@ -257,8 +263,8 @@ dumpinfo:
download:
prepare:
configure:
-compile:
-install:
+compile: prepare-package-install
+install: compile
clean-staging: FORCE
rm -f $(STAMP_INSTALLED)
@-(\