arm/powerpc: Makefile cleanup
v2 cover arm/powerpc: Makefile cleanup
Cleanup makefiles like 'x86: Makefile refine' does.
v2:
- no need for %.elf on powerpc patch
- commit message points out why .PRECIOUS is used
Andrew Jones (2):
arm/arm64: Makefile cleanup
powerpc/ppc64: Makefile cleanup
arm/Makefile.common | 8 ++++---- powerpc/Makefile.common | 13 ++++--------- 2 files changed, 8 insertions(+), 13 deletions(-)
Signature · 1 line
2.4.11
PATCH v2 1/2 arm/arm64: Makefile cleanup
This does the same cleanup as 'x86: Makefile refine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.
--- arm/Makefile.common | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arm/Makefile.common +4 -4
@@ -24,6 +24,9 @@ CFLAGS += -Wextra CFLAGS += -O2 CFLAGS += -I lib -I lib/libfdt +# We want to keep intermediate files +.PRECIOUS: %.elf %.o + asm-offsets = lib/$(ARCH)/asm-offsets.h include scripts/asm-offsets.mak
@@ -48,7 +51,7 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) %.elf: LDFLAGS = $(CFLAGS) -nostdlib -%.elf: %.o $(FLATLIBS) arm/flat.lds +%.elf: %.o $(FLATLIBS) arm/flat.lds $(cstart.o) $(CC) $(LDFLAGS) -o $@ \ -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS)
@@ -69,7 +72,4 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) -$(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o - $(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)
Signature · 1 line
2.4.11
PATCH v2 2/2 powerpc/ppc64: Makefile cleanup
In reply to Andrew JonesThis does the same cleanup as 'x86: Makefile refine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.
--- powerpc/Makefile.common | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
powerpc/Makefile.common +4 -9
@@ -22,6 +22,9 @@ CFLAGS += -I lib -I lib/libfdt CFLAGS += -Wa,-mregnames CFLAGS += -fpie +# We want to keep intermediate files +.PRECIOUS: %.o + asm-offsets = lib/$(ARCH)/asm-offsets.h include scripts/asm-offsets.mak
@@ -37,7 +40,7 @@ cflatobjs += lib/powerpc/processor.o FLATLIBS = $(libcflat) $(LIBFDT_archive) %.elf: CFLAGS += $(arch_CFLAGS) %.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -%.elf: %.o $(FLATLIBS) powerpc/flat.lds +%.elf: %.o $(FLATLIBS) powerpc/flat.lds $(cstart.o) $(reloc.o) $(LD) $(LDFLAGS) -o $@ \ -T powerpc/flat.lds --build-id=none \ $(filter %.o, $^) $(FLATLIBS)
@@ -69,11 +72,3 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) $(cstart.o): $(asm-offsets) - -$(TEST_DIR)/selftest.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/selftest.o - -$(TEST_DIR)/spapr_hcall.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/spapr_hcall.o - -$(TEST_DIR)/rtas.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/rtas.o - -$(TEST_DIR)/emulator.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/emulator.o
Signature · 1 line
2.4.11
Paolo Bonzini
maintainerRe: [kvm-unit-tests PATCH v2 1/2] arm/arm64: Makefile cleanup
In reply to Andrew JonesQuoted 3 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.
Actually it should and, worst case, we could use .SECONDARY without prerequisites. I'll change this to "doesn't seem to work reliably".
Paolo
Quoted 37 lines
Signed-off-by Andrew Jones <[email protected]>--- arm/Makefile.common | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)arm/Makefile.common +4
-4@@ -24,6 +24,9 @@ CFLAGS += -Wextra CFLAGS += -O2 CFLAGS += -I lib -I lib/libfdt +# We want to keep intermediate files +.PRECIOUS: %.elf %.o + asm-offsets = lib/$(ARCH)/asm-offsets.h include scripts/asm-offsets.mak@@ -48,7 +51,7 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) %.elf: LDFLAGS = $(CFLAGS) -nostdlib -%.elf: %.o $(FLATLIBS) arm/flat.lds +%.elf: %.o $(FLATLIBS) arm/flat.lds $(cstart.o) $(CC) $(LDFLAGS) -o $@ \ -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS)@@ -69,7 +72,4 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) -$(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o - $(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)
Quoted 6 lines · Andrew Jones
Cleanup makefiles like 'x86:
Makefilerefine' does.v2:
- no need for %.elf on powerpc patch
- commit message points out why .PRECIOUS is used
Quoted 8 lines
Andrew Jones (2):
arm/arm64:Makefilecleanup
powerpc/ppc64:Makefilecleanuparm/Makefile.common | 8 ++++---- powerpc/Makefile.common | 13 ++++--------- 2 files changed, 8 insertions(+), 13 deletions(-)
Applied, thanks.
Paolo
Re: [kvm-unit-tests PATCH v2 1/2] arm/arm64: Makefile cleanup
In reply to Andrew JonesQuoted 5 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.Signed-off-by Andrew Jones <[email protected]>
Is it possible to add
Now?
Quoted 37 lines
---
arm/Makefile.common | 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)arm/Makefile.common +0
-0@@ -24,6 +24,9 @@ CFLAGS += -WextraCFLAGS += -O2
CFLAGS += -I lib -I lib/libfdtarm/Makefile.common +3
-0+# We want to keep intermediate files +.PRECIOUS: %.elf %.o +asm-offsets = lib/$(ARCH)/asm-offsets.h
includescripts/asm-offsets.makarm/Makefile.common +0
-0@@ -48,7 +51,7 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi)%.elf: LDFLAGS = $(CFLAGS) -nostdlib
-%.elf: %.o $(FLATLIBS)arm/flat.lds
+%.elf: %.o $(FLATLIBS)arm/flat.lds$(cstart.o)$(CC) $(LDFLAGS) -o $@ \ -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS)arm/Makefile.common +0
-3@@ -69,7 +72,4 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) -$(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o - $(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)Signature · 1 line
2.4.11
Signature · 2 lines
Wei Yang Help you, Help me
Re: [kvm-unit-tests PATCH v2 2/2] powerpc/ppc64: Makefile cleanup
In reply to Andrew JonesQuoted 5 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.Signed-off-by Andrew Jones <[email protected]>
Same as above.
Quoted 41 lines
---
powerpc/Makefile.common | 13 ++++---------1 file changed, 4 insertions(+), 9 deletions(-)powerpc/Makefile.common +0
-0@@ -22,6 +22,9 @@ CFLAGS += -I lib -I lib/libfdtCFLAGS += -Wa,-mregnames
CFLAGS += -fpiepowerpc/Makefile.common +3
-0+# We want to keep intermediate files +.PRECIOUS: %.o +asm-offsets = lib/$(ARCH)/asm-offsets.h
includescripts/asm-offsets.makpowerpc/Makefile.common +0
-0@@ -37,7 +40,7 @@ cflatobjs += lib/powerpc/processor.o FLATLIBS = $(libcflat) $(LIBFDT_archive) %.elf: CFLAGS += $(arch_CFLAGS)%.elf: LDFLAGS = $(arch_LDFLAGS) -nostdlib -pie -%.elf: %.o $(FLATLIBS)
powerpc/flat.lds
+%.elf: %.o $(FLATLIBS)powerpc/flat.lds$(cstart.o) $(reloc.o)$(LD) $(LDFLAGS) -o $@ \ -T powerpc/flat.lds --build-id=none \ $(filter %.o, $^) $(FLATLIBS)powerpc/Makefile.common +0
-8@@ -69,11 +72,3 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) $(cstart.o): $(asm-offsets) - -$(TEST_DIR)/selftest.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/selftest.o - -$(TEST_DIR)/spapr_hcall.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/spapr_hcall.o - -$(TEST_DIR)/rtas.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/rtas.o - -$(TEST_DIR)/emulator.elf: $(cstart.o) $(reloc.o) $(TEST_DIR)/emulator.oSignature · 1 line
2.4.11
Signature · 2 lines
Wei Yang Help you, Help me
Paolo Bonzini
maintainerRe: [kvm-unit-tests PATCH v2 1/2] arm/arm64: Makefile cleanup
In reply to Wei YangQuoted 10 lines · Wei Yang
Quoted 5 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.Signed-off-by Andrew Jones <[email protected]>Is it possible to add
Reviewed-by Wei Yang <[email protected]>
Too late, sorry; the commit has been pushed already.
Paolo
Quoted 40 lines
Now?
Quoted 37 lines
---
arm/Makefile.common | 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)arm/Makefile.common +0
-0@@ -24,6 +24,9 @@ CFLAGS += -WextraCFLAGS += -O2
CFLAGS += -I lib -I lib/libfdtarm/Makefile.common +3
-0+# We want to keep intermediate files +.PRECIOUS: %.elf %.o +asm-offsets = lib/$(ARCH)/asm-offsets.h
includescripts/asm-offsets.makarm/Makefile.common +0
-0@@ -48,7 +51,7 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi)%.elf: LDFLAGS = $(CFLAGS) -nostdlib
-%.elf: %.o $(FLATLIBS)arm/flat.lds
+%.elf: %.o $(FLATLIBS)arm/flat.lds$(cstart.o)$(CC) $(LDFLAGS) -o $@ \ -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS)arm/Makefile.common +0
-3@@ -69,7 +72,4 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) -$(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o - $(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)Signature · 1 line
2.4.11
Re: [kvm-unit-tests PATCH v2 1/2] arm/arm64: Makefile cleanup
Quoted 8 lines · Paolo Bonzini
Quoted 5 lines · Wei Yang
Quoted 4 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Andrew Jones <[email protected]>Is it possible to add
Reviewed-by Wei Yang <[email protected]>Too late, sorry; the commit has been pushed already.
OK, that's fine.
BTW, do I need to reply with Reviewed-by in each patch version? I thought just reply to one of it and the following versions would contain it. Or I missed the rule?
Quoted 42 lines
Paolo
Quoted 40 lines
Now?
Quoted 37 lines
---
arm/Makefile.common | 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)arm/Makefile.common +0
-0@@ -24,6 +24,9 @@ CFLAGS += -WextraCFLAGS += -O2
CFLAGS += -I lib -I lib/libfdtarm/Makefile.common +3
-0+# We want to keep intermediate files +.PRECIOUS: %.elf %.o +asm-offsets = lib/$(ARCH)/asm-offsets.h
includescripts/asm-offsets.makarm/Makefile.common +0
-0@@ -48,7 +51,7 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi)%.elf: LDFLAGS = $(CFLAGS) -nostdlib
-%.elf: %.o $(FLATLIBS)arm/flat.lds
+%.elf: %.o $(FLATLIBS)arm/flat.lds$(cstart.o)$(CC) $(LDFLAGS) -o $@ \ -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS)arm/Makefile.common +0
-3@@ -69,7 +72,4 @@ generated_files = $(asm-offsets) test_cases: $(generated_files) $(tests-common) $(tests) -$(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o -$(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o - $(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)Signature · 1 line
2.4.11
Signature · 2 lines
Wei Yang Help you, Help me
Paolo Bonzini
maintainerRe: [kvm-unit-tests PATCH v2 1/2] arm/arm64: Makefile cleanup
Quoted 15 lines · Wei Yang
Quoted 14 lines · Paolo Bonzini
Quoted 10 lines · Wei Yang
Quoted 5 lines · Andrew Jones
This does the same cleanup as 'x86:
Makefilerefine'. .PRECIOUS is used (as opposed to .SECONDARY), because .SECONDARY doesn't accept target patterns.Signed-off-by Andrew Jones <[email protected]>Is it possible to add
Reviewed-by Wei Yang <[email protected]>
Quoted 8 lines
Quoted 2 lines
Too late, sorry; the commit has been pushed already.
OK, that's fine.
BTW, do I need to reply with Reviewed-by in each patch version? I thought just reply to one of it and the following versions would contain it. Or I missed the rule?
Usually it's enough to reply once. However, the submitter may drop Reviewed-by tags if he/she believes that there were large changes compared to the reviewed version; or they might just forget to add it.
Paolo