diff mbox series

[kvm-unit-tests,v3,09/13] s390x: Add binary generation to makefile

Message ID 20181218092657.46466-10-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series 390x: Add cross hypervisor and disk boot | expand

Commit Message

Janosch Frank Dec. 18, 2018, 9:26 a.m. UTC
make bin will now generate binaries that can be booted from this or as
a non ELF kernel boot.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 s390x/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

David Hildenbrand Dec. 18, 2018, 11:24 a.m. UTC | #1
On 18.12.18 10:26, Janosch Frank wrote:
> make bin will now generate binaries that can be booted from this or as
> a non ELF kernel boot.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  s390x/Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/s390x/Makefile b/s390x/Makefile
> index ede2961..eaad18c 100644
> --- a/s390x/Makefile
> +++ b/s390x/Makefile
> @@ -10,9 +10,11 @@ tests += $(TEST_DIR)/cmm.elf
>  tests += $(TEST_DIR)/vector.elf
>  tests += $(TEST_DIR)/gs.elf
>  tests += $(TEST_DIR)/iep.elf
> +test_bins = $(patsubst %.elf,%.bin,$(tests))
>  
>  all: directories test_cases
>  
> +bin: $(test_bins)
>  test_cases: $(tests)

Maybe a different naming and build it along with "all" ?

tests_binary = $(patsubst %.elf,%.bin,$(tests))

all: directories test_cases test_cases_binary

test_cases_binary: $(tests_binary)

>  
>  CFLAGS += -std=gnu99
> @@ -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)
>
Thomas Huth Dec. 18, 2018, 11:51 a.m. UTC | #2
On 2018-12-18 10:26, Janosch Frank wrote:
> make bin will now generate binaries that can be booted from this or as
> a non ELF kernel boot.

"booted from disk" ?

 Thomas
Janosch Frank Dec. 18, 2018, 12:29 p.m. UTC | #3
On 18.12.18 12:24, David Hildenbrand wrote:
> On 18.12.18 10:26, Janosch Frank wrote:
>> make bin will now generate binaries that can be booted from this or as
>> a non ELF kernel boot.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  s390x/Makefile | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/s390x/Makefile b/s390x/Makefile
>> index ede2961..eaad18c 100644
>> --- a/s390x/Makefile
>> +++ b/s390x/Makefile
>> @@ -10,9 +10,11 @@ tests += $(TEST_DIR)/cmm.elf
>>  tests += $(TEST_DIR)/vector.elf
>>  tests += $(TEST_DIR)/gs.elf
>>  tests += $(TEST_DIR)/iep.elf
>> +test_bins = $(patsubst %.elf,%.bin,$(tests))
>>  
>>  all: directories test_cases
>>  
>> +bin: $(test_bins)
>>  test_cases: $(tests)
> 
> Maybe a different naming and build it along with "all" ?

Are you sure you want it in "all", the default is KVM elf boot after all?

> 
> tests_binary = $(patsubst %.elf,%.bin,$(tests))
> 
> all: directories test_cases test_cases_binary
> 
> test_cases_binary: $(tests_binary)
> 

Sure, fixed the naming

>>  
>>  CFLAGS += -std=gnu99
>> @@ -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)
>>
> 
>
diff mbox series

Patch

diff --git a/s390x/Makefile b/s390x/Makefile
index ede2961..eaad18c 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -10,9 +10,11 @@  tests += $(TEST_DIR)/cmm.elf
 tests += $(TEST_DIR)/vector.elf
 tests += $(TEST_DIR)/gs.elf
 tests += $(TEST_DIR)/iep.elf
+test_bins = $(patsubst %.elf,%.bin,$(tests))
 
 all: directories test_cases
 
+bin: $(test_bins)
 test_cases: $(tests)
 
 CFLAGS += -std=gnu99
@@ -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)