IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
- ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
+ ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
ifdef Package/$(1)/install
ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),)
IPKGS += $(1)
compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
ifeq ($(CONFIG_PACKAGE_$(1)),y)
- .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 \
+ .PHONY: $(PKG_INSTALL_STAMP).$(1)
+ compile: $(PKG_INSTALL_STAMP).$(1)
+ $(PKG_INSTALL_STAMP).$(1):
+ if [ -f $(PKG_INSTALL_STAMP).clean ]; then \
rm -f \
- $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install \
- $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean; \
+ $(PKG_INSTALL_STAMP) \
+ $(PKG_INSTALL_STAMP).clean; \
fi; \
- echo "$(1)" >> $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install
+ echo "$(1)" >> $(PKG_INSTALL_STAMP)
endif
else
compile: $(1)-disabled
endif
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
+PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk
.PHONY: prepare-package-install
prepare-package-install:
@mkdir -p $(PKG_INFO_DIR)
- @touch $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean
- @echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.flags
+ @touch $(PKG_INSTALL_STAMP).clean
+ @echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
$(PACKAGE_DIR):
mkdir -p $@
IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \
IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
- $(STAGING_DIR_HOST)/bin/opkg \
+ $(XARGS) $(STAGING_DIR_HOST)/bin/opkg \
--offline-root $(TARGET_DIR) \
--force-depends \
--force-overwrite \
--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))
+PACKAGE_INSTALL_FILES:=$(patsubst %,$(PKG_INFO_DIR)/%.*.install,$(PACKAGE_INSTALL))
$(curdir)/cleanup: $(TMP_DIR)/.build
rm -rf $(STAGING_DIR_ROOT)
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
rm -rf $(TARGET_DIR)
[ -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`; \
+ @$(FIND) `sed -e 's|.*|$(PACKAGE_DIR)/&_*.ipk|' $(PACKAGE_INSTALL_FILES)` | sort -u | $(OPKG) install
+ @for file in $(PACKAGE_INSTALL_FILES); do \
+ [ -s $$file.flags ] || continue; \
+ for flag in `cat $$file.flags`; do \
+ $(OPKG) flag $$flag < $$file; \
done; \
done || true
@-$(MAKE) package/preconfig