Source: arm-trusted-firmware
Followup-For: Bug #979278

Please use this version instead...
>From fcd113c7c7df92e4e32c2ec5c82118e04a7f58ca Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nico...@debian.org>
Date: Sun, 28 Mar 2021 12:45:16 +0200
Subject: [PATCH 5/7] Make each command run by Make visible in the build log

The information flow is easyer to understand in named Make variables
than in shell pipes or executable debhelper configurations.

Also, errors are handled properly.  For example, chmod is currently
emitting an error message in the amd64 logs (of course, *this* error
can be ignored).
---
 debian/arm-trusted-firmware.install |  9 +--------
 debian/rules                        | 10 +++++++---
 debian/targets                      |  6 ------
 3 files changed, 8 insertions(+), 17 deletions(-)
 mode change 100755 => 100644 debian/arm-trusted-firmware.install
 delete mode 100644 debian/targets

diff --git a/debian/arm-trusted-firmware.install b/debian/arm-trusted-firmware.install
old mode 100755
new mode 100644
index e8c531430..81ddcb861
--- a/debian/arm-trusted-firmware.install
+++ b/debian/arm-trusted-firmware.install
@@ -1,8 +1 @@
-#!/bin/sh
-
-grep -v '^#' debian/targets | while read plat targets ; do
-	for target in $targets ; do
-		chmod a-x build/$plat/debug/$target
-		echo build/$plat/debug/$target usr/lib/arm-trusted-firmware/$plat/
-	done
-done
+build/renamed/*                         usr/lib/arm-trusted-firmware
diff --git a/debian/rules b/debian/rules
index b7fd8ac7e..7a6884a2e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,9 @@ else
 VERBOSE=1
 endif
 
+platforms := g12a gxbb sun50i_a64 sun50i_h6 rk3328 rk3399
+target = $(if $(filter rk3328 rk3399,$@),bl31/bl31.elf,bl31.bin)
+
 %:
 	dh $@
 
@@ -24,10 +27,11 @@ ifeq ($(filter pkg.arm-trusted-firmware.notools,$(DEB_BUILD_PROFILES)),)
 endif
 # Only build firmware on arm64.
 ifeq ($(DEB_HOST_ARCH),arm64)
+  override_dh_auto_build: $(platforms)
+  $(platforms):
 	# Always set CROSS_COMPILE, which also works for native builds.
-	grep -v '^#' debian/targets | while read plat targets ; do \
-		CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= dh_auto_build -- V=$(VERBOSE) DEBUG=1 PLAT=$$plat bl31 ; \
-	done
+	CROSS_COMPILE=aarch64-linux-gnu- CFLAGS= LDFLAGS= dh_auto_build -- V=$(VERBOSE) DEBUG=1 PLAT=$@ bl31
+	install -m644 build/$@/debug/$(target) -Dt build/renamed/$@
 endif
 
 override_dh_installchangelogs:
diff --git a/debian/targets b/debian/targets
deleted file mode 100644
index a6f72441c..000000000
--- a/debian/targets
+++ /dev/null
@@ -1,6 +0,0 @@
-g12a bl31.bin
-gxbb bl31.bin
-sun50i_a64 bl31.bin
-sun50i_h6 bl31.bin
-rk3328 bl31/bl31.elf
-rk3399 bl31/bl31.elf
-- 
2.30.2

Reply via email to