[kvm-unit-tests,PULL,09/10] s390x: Add binary generation to makefile
diff mbox series

Message ID 1548067555-15766-10-git-send-email-thuth@redhat.com
State New
Headers show
Series
  • [kvm-unit-tests,PULL,01/10] s390x: cleanup and add SCLP defines
Related show

Commit Message

Thomas Huth Jan. 21, 2019, 10:45 a.m. UTC
From: Janosch Frank <frankja@linux.ibm.com>

"make test_cases_binary" will now generate binaries that can be booted
from disk or as a non ELF kernel boot.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 s390x/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/s390x/Makefile b/s390x/Makefile
index ed6ef0b..af40fd4 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -10,10 +10,12 @@  tests += $(TEST_DIR)/cmm.elf
 tests += $(TEST_DIR)/vector.elf
 tests += $(TEST_DIR)/gs.elf
 tests += $(TEST_DIR)/iep.elf
+tests_binary = $(patsubst %.elf,%.bin,$(tests))
 
-all: directories test_cases
+all: directories test_cases test_cases_binary
 
 test_cases: $(tests)
+test_cases_binary: $(tests_binary)
 
 CFLAGS += -std=gnu99
 CFLAGS += -ffreestanding
@@ -55,8 +57,11 @@  FLATLIBS = $(libcflat)
 	$(RM) $(@:.elf=.aux.o)
 	@chmod a-x $@
 
+%.bin: %.elf
+	$(OBJCOPY) -O binary  $< $@
+
 arch_clean: asm_offsets_clean
-	$(RM) $(TEST_DIR)/*.{o,elf} $(TEST_DIR)/.*.d lib/s390x/.*.d
+	$(RM) $(TEST_DIR)/*.{o,elf,bin} $(TEST_DIR)/.*.d lib/s390x/.*.d
 
 generated-files = $(asm-offsets)
 $(tests:.elf=.o) $(cstart.o) $(cflatobjs): $(generated-files)