mbedtls: update to 2.16.6
[openwrt/openwrt.git] / package / Makefile
index 3cf500d46166a08f90bbac4d57aea280287361b6..58c1ba2bbf655c76c214c59c68652665c5b3666f 100644 (file)
@@ -7,12 +7,12 @@
 
 curdir:=package
 
+include $(INCLUDE_DIR)/feeds.mk
 include $(INCLUDE_DIR)/rootfs.mk
 
 -include $(TMP_DIR)/.packagedeps
 $(curdir)/autoremove:=1
 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m))
-$(curdir)/builddirs-install:=.
 $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m))
 $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m))
 ifdef CHECK_ALL
@@ -57,23 +57,26 @@ $(curdir)/merge:
 $(curdir)/merge-index: $(curdir)/merge
        (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; )
 
-$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/install $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
+ifndef SDK
+  $(curdir)/compile: $(curdir)/system/opkg/host/compile
+endif
+
+$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
        - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
        rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
-       [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
+       mkdir -p $(TARGET_DIR)/tmp
        $(call opkg,$(TARGET_DIR)) install \
-               $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null))
+               $(call opkg_package_files,$(foreach pkg,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null),$(pkg)$(call GetABISuffix,$(pkg))))
        @for file in $(PACKAGE_INSTALL_FILES); do \
                [ -s $$file.flags ] || continue; \
                for flag in `cat $$file.flags`; do \
                        $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \
                done; \
        done || true
-       @-$(MAKE) package/preconfig
 
        $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
 
-       $(call prepare_rootfs,$(TARGET_DIR))
+       $(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
 
 $(curdir)/index: FORCE
        @echo Generating package index...
@@ -81,8 +84,12 @@ $(curdir)/index: FORCE
                mkdir -p $$d; \
                cd $$d || continue; \
                $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
-               grep -vE '^(Maintainer|LicenseFiles|Source|Require)' Packages.manifest > Packages && \
-                       gzip -9nc Packages > Packages.gz; \
+               grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
+               case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
+                       $(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
+                       { echo ""; echo ""; } >> Packages;; \
+               esac; \
+               gzip -9nc Packages > Packages.gz; \
        ); done
 ifdef CONFIG_SIGNED_PACKAGES
        @echo Signing package index...
@@ -93,8 +100,6 @@ ifdef CONFIG_SIGNED_PACKAGES
        ); done
 endif
 
-$(curdir)/preconfig:
-
 $(curdir)/flags-install:= -j1
 
 $(eval $(call stampfile,$(curdir),package,prereq,.config))