tests: arch-power: Add support for building hello
authorSandipan Das <sandipan@linux.ibm.com>
Sat, 6 Feb 2021 13:44:29 +0000 (19:14 +0530)
committerSandipan Das <sandipan@linux.ibm.com>
Mon, 15 Feb 2021 08:32:38 +0000 (14:02 +0530)
Commit a440108cc ("tests: Add Makefiles for hello")
introduced Makefiles for building the hello test binary
for ARM and x86 using dockcross. Since dockcross also
provides an image with a 64-bit little endian toolchain
for Power, this adds a Makefile for building the hello
binary.

As of this moment, 64-bit little endian (ppc64le) is the
prevalent variant supported by most distributions. Hence,
we are currently limited to only building the binary for
this variant.

Change-Id: Ic20322ca33c69634d9f17d30b29e522cc35742fb
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
tests/test-progs/hello/src/Makefile.power [new file with mode: 0644]

diff --git a/tests/test-progs/hello/src/Makefile.power b/tests/test-progs/hello/src/Makefile.power
new file mode 100644 (file)
index 0000000..6fb280a
--- /dev/null
@@ -0,0 +1,11 @@
+all: hello64le-static
+
+hello64le-static: hello.c dockcross-ppc64le
+       ./dockcross-ppc64le bash -c '$$CC hello.c -o hello64le-static -static'
+
+dockcross-ppc64le:
+       docker run --rm dockcross/linux-ppc64le > ./dockcross-ppc64le
+       chmod +x ./dockcross-ppc64le
+
+clean:
+       rm -f dockcross* hello64le-static