Makefile: fix package file list if FOO_SUBDIR is set
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Wed, 18 Mar 2020 15:58:12 +0000 (16:58 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Fri, 20 Mar 2020 21:15:08 +0000 (22:15 +0100)
If a package sets a FOO_SUBDIR (meaning its sources are not under
output/build/foo-123 but under output/build/foo-123/$(FOO_SUBDIR)), the
.files-list.txt file were also created under FOO_SUBDIR, due to which the
logic in the Makefile would not find it.

Change the instrumentation steps so that the file list is directly under the
package dir, ignoring the subdir.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/pkg-generic.mk

index 47238f26492464635fb6fe40a68e4bed4bdaae11..20b07a7fa9b74e44538986a748d6532e3a323660 100644 (file)
@@ -63,7 +63,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_time
 define step_pkg_size_before
        cd $(2); \
        LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \
-               | LC_ALL=C sort > $($(PKG)_BUILDDIR)/.files-list$(3).before
+               | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(3).before
 endef
 
 # $(1): package name
@@ -72,14 +72,14 @@ endef
 define step_pkg_size_after
        cd $(2); \
        LC_ALL=C find . \( -type f -o -type l \) -printf '%T@:%i:%#m:%y:%s,%p\n' \
-               | LC_ALL=C sort > $($(PKG)_BUILDDIR)/.files-list$(3).after
+               | LC_ALL=C sort > $($(PKG)_DIR)/.files-list$(3).after
        LC_ALL=C comm -13 \
-               $($(PKG)_BUILDDIR)/.files-list$(3).before \
-               $($(PKG)_BUILDDIR)/.files-list$(3).after \
+               $($(PKG)_DIR)/.files-list$(3).before \
+               $($(PKG)_DIR)/.files-list$(3).after \
                | sed -r -e 's/^[^,]+/$(1)/' \
-               > $($(PKG)_BUILDDIR)/.files-list$(3).txt
-       rm -f $($(PKG)_BUILDDIR)/.files-list$(3).before
-       rm -f $($(PKG)_BUILDDIR)/.files-list$(3).after
+               > $($(PKG)_DIR)/.files-list$(3).txt
+       rm -f $($(PKG)_DIR)/.files-list$(3).before
+       rm -f $($(PKG)_DIR)/.files-list$(3).after
 endef
 
 define step_pkg_size
@@ -103,7 +103,7 @@ GLOBAL_INSTRUMENTATION_HOOKS += step_pkg_size
 define check_bin_arch
        $(if $(filter end-install-target,$(1)-$(2)),\
                support/scripts/check-bin-arch -p $(3) \
-                       -l $($(PKG)_BUILDDIR)/.files-list.txt \
+                       -l $($(PKG)_DIR)/.files-list.txt \
                        $(foreach i,$($(PKG)_BIN_ARCH_EXCLUDE),-i "$(i)") \
                        -r $(TARGET_READELF) \
                        -a $(BR2_READELF_ARCH_NAME))