$(toolchain/stamp-install): $(tools/stamp-install)
$(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
-$(package/stamp-cleanup): $(target/stamp-compile)
-$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
+$(package/stamp-compile): $(target/stamp-compile)
$(package/stamp-install): $(package/stamp-compile)
-$(package/stamp-rootfs-prepare): $(package/stamp-install)
-$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare)
+$(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
printdb:
@true
fi
prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
-world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
+world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index
# update all feeds, re-create index files, install symlinks
# 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
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))
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
$(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)_*
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)
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
.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 $@
download:
prepare:
configure:
-compile:
-install:
+compile: prepare-package-install
+install: compile
clean-staging: FORCE
rm -f $(STAMP_INSTALLED)
@-(\
-include $(TMP_DIR)/.packagedeps
$(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
+$(curdir)/builddirs-install:=.
ifeq ($(SDK),1)
- $(curdir)/builddirs-install:=.
else
$(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
$(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
- $(curdir)/builddirs-install:=. $(filter-out base-files,$(sort $(package-y))) $(filter base-files,$(package-y))
endif
ifneq ($(IGNORE_ERRORS),)
$(curdir)/builddirs-ignore-compile:= $(if $(filter n m y, $(IGNORE_ERRORS)),$(foreach m,$(IGNORE_ERRORS),$(package-$(subst n,,$(m)))),$(package-m) $(package-))
endif
-$(curdir)/install:=$(curdir)/install-cleanup
-
-$(curdir)/cleanup: $(TMP_DIR)/.build
- - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
- rm -rf $(TARGET_DIR) $(STAGING_DIR_ROOT)
-
ifdef CONFIG_USE_MKLIBS
define mklibs
rm -rf $(TMP_DIR)/mklibs-progs $(TMP_DIR)/mklibs-out
endef
endif
-$(curdir)/rootfs-prepare: $(TMP_DIR)/.build
+# 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
+
+PACKAGE_INSTALL:=$(sort $(foreach pkg,$(package-y),$(lastword $(subst /,$(space),$(pkg)))))
+PACKAGE_INSTALL_FILES:=$(patsubst %,$(PKG_INFO_DIR)/%.install,$(PACKAGE_INSTALL))
+
+$(curdir)/install: $(TMP_DIR)/.build
+ - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
+ rm -rf $(TARGET_DIR) $(STAGING_DIR_ROOT)
+ [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
+ $(OPKG) install `cat $(PACKAGE_INSTALL_FILES) | sed -e 's,^\(.*\)$$,$(PACKAGE_DIR)/\1_*.ipk,'`
+ @for pkg in $(PACKAGE_INSTALL); do \
+ [ -s $(PKG_INFO_DIR)/$${pkg}.install.flags ] || continue; \
+ for flag in `cat $(PKG_INFO_DIR)/$${pkg}.install.flags`; do \
+ $(OPKG) flag $$flag `cat $(PKG_INFO_DIR)/$${pkg}.install`; \
+ done; \
+ done || true
@-$(MAKE) package/preconfig
@if [ -d $(TOPDIR)/files ]; then \
( cd $(TOPDIR)/files; find -type f ) | \
gzip -9c Packages > Packages.gz \
)
+$(curdir)/preconfig:
+
$(curdir)/flags-install:= -j1
$(eval $(call stampfile,$(curdir),package,prereq,.config))
-$(eval $(call stampfile,$(curdir),package,cleanup,$(TMP_DIR)/.build))
$(eval $(call stampfile,$(curdir),package,compile,$(TMP_DIR)/.build))
$(eval $(call stampfile,$(curdir),package,install,$(TMP_DIR)/.build))
-$(eval $(call stampfile,$(curdir),package,rootfs-prepare,$(TMP_DIR)/.build))
$(eval $(call subdir,$(curdir)))
TARGET_DIR:=$(TARGET_ROOTFS_DIR)/root-$(BOARD)
STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD)
BUILD_LOG_DIR:=$(TOPDIR)/logs
+PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3)