mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] RISC-V: Makefile: cleanup layout
@ 2023-02-02 13:26 Marco Felsch
  2023-02-02 13:26 ` [PATCH 2/3] RISC-V: Makefile: align the isa string setting with the kernel Marco Felsch
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco Felsch @ 2023-02-02 13:26 UTC (permalink / raw)
  To: barebox

The cflag and cppflag handling is rather complicated for this small
Makefile. The code uses two helper variables riscv-cflags-y cflags-y
which are assigned later to PBL_CPPFLAGS, KBUILD_CPPFLAGS and
KBUILD_CFLAGS.

Remove this complexity by assigning the flags directly to
KBUILD_CPPFLAGS. The variable is used during pbl/barebox compile and
during cpp process.

While on it move the KBUILD_IMAGE to the KBUILD_BINARY to bundle the
usage.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/riscv/Makefile | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 279db046c0..b4cf5983a2 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -5,21 +5,19 @@ KBUILD_DEFCONFIG := rv64i_defconfig
 KBUILD_CPPFLAGS += -fno-strict-aliasing
 
 ifeq ($(CONFIG_ARCH_RV32I),y)
-	riscv-cflags-y += -march=rv32im -mabi=ilp32
+	KBUILD_CPPFLAGS += -march=rv32im -mabi=ilp32
 	riscv-ldflags-y += -melf32lriscv
 else
-	riscv-cflags-y += -march=rv64im -mabi=lp64
+	KBUILD_CPPFLAGS += -march=rv64im -mabi=lp64
 	riscv-ldflags-y += -melf64lriscv
 endif
 
-riscv-cflags-y += -Wstrict-prototypes -mcmodel=medany -fpic
-riscv-ldflags-y += -pie -static
 
-PBL_CPPFLAGS += $(riscv-cflags-y)
-LDFLAGS_pbl += $(riscv-ldflags-y)
 
-cflags-y += $(riscv-cflags-y)
+KBUILD_CPPFLAGS += -Wstrict-prototypes -mcmodel=medany -fpic
+riscv-ldflags-y += -pie -static
 
+LDFLAGS_pbl += $(riscv-ldflags-y)
 LDFLAGS_barebox += $(riscv-ldflags-y)
 
 ifndef CONFIG_MODULES
@@ -29,6 +27,7 @@ LDFLAGS_barebox += -static --gc-sections
 endif
 
 KBUILD_BINARY := barebox.bin
+KBUILD_IMAGE := $(KBUILD_BINARY)
 
 archprepare: maketools
 
@@ -41,11 +40,6 @@ common-y += arch/riscv/boot/
 
 common-$(CONFIG_OFTREE) += arch/riscv/dts/
 
-KBUILD_CPPFLAGS += $(cflags-y)
-KBUILD_CFLAGS += $(cflags-y)
-
 lds-y	:= arch/riscv/lib/barebox.lds
 
 CLEAN_FILES += arch/riscv/lib/barebox.lds
-
-KBUILD_IMAGE := $(KBUILD_BINARY)
-- 
2.39.1




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-03  8:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 13:26 [PATCH 1/3] RISC-V: Makefile: cleanup layout Marco Felsch
2023-02-02 13:26 ` [PATCH 2/3] RISC-V: Makefile: align the isa string setting with the kernel Marco Felsch
2023-02-02 13:26 ` [PATCH 3/3] RISC-V: Makefile: fix build with binutils 2.38 Marco Felsch
2023-02-03  8:04 ` [PATCH 1/3] RISC-V: Makefile: cleanup layout Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox