summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-22 15:37:32 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-04-27 21:16:56 +0200
commitc6f95bc715c4dad2e189b8b6fcb29963c4cec1cd (patch)
treed8c443ba46336f13ffd84a7dc488f6338939783f /arch/mips
parent331eecaa77074726cf7be045afad5eea5969f477 (diff)
downloadbarebox-c6f95bc715c4dad2e189b8b6fcb29963c4cec1cd.tar.gz
barebox-c6f95bc715c4dad2e189b8b6fcb29963c4cec1cd.tar.xz
kbuild: prefix compiler flag variables with KBUILD_
In old days, Linux also used to use well-known variables such CFLAGS, CPPFLAGS, etc. They were prefixed with KBUILD_ presumably for preventing users from overriding them accidentally. Rename as follows: CFLAGS -> KBUILD_CFLAGS AFLAGS -> KBUILD_AFLAGS CPPFLAGS -> KBUILD_CPPFLAGS LDFLAGS -> KBUILD_LDFLAGS HOSTCFLAGS -> KBUILD_HOSTCFLAGS HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS HOST_LOADLIBES -> KBUILD_HOSTLDLIBS HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow users to pass-in additional flags to the host compiler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Makefile22
-rw-r--r--arch/mips/pbl/Makefile2
2 files changed, 12 insertions, 12 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 932fdab0a3..4717f49a46 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -11,7 +11,7 @@ else
64bit-emul = elf64btsmip
endif
-CPPFLAGS += -D__MIPS__ -fno-strict-aliasing -fno-merge-constants
+KBUILD_CPPFLAGS += -D__MIPS__ -fno-strict-aliasing -fno-merge-constants
cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
cflags-y += -Wall -Wstrict-prototypes \
@@ -42,7 +42,7 @@ cflags-y += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(unde
mips-ldflags-y += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL )
endif
-LDFLAGS += $(mips-ldflags-y) -m $(ld-emul)
+KBUILD_LDFLAGS += $(mips-ldflags-y) -m $(ld-emul)
LDFLAGS_barebox += $(mips-ldflags-y)
LDFLAGS_pbl += $(mips-ldflags-y)
@@ -55,11 +55,11 @@ cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS
cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) -Wa,-mips64r2 -Wa,--trap
cflags-$(CONFIG_CPU_GS232) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) -Wa,-mips32r2 -Wa,--trap
-CPPFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)
+KBUILD_CPPFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)
ifndef CONFIG_MODULES
# Add cleanup flags
-CPPFLAGS += -fdata-sections -ffunction-sections
+KBUILD_CPPFLAGS += -fdata-sections -ffunction-sections
LDFLAGS_barebox += -static --gc-sections --emit-relocs
endif
@@ -83,9 +83,9 @@ machine-$(CONFIG_MACH_MIPS_XBURST) := xburst
machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
ifeq ($(KBUILD_SRC),)
-CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
+KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs))
else
-CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
+KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs))
endif
ifeq ($(incdir-y),)
@@ -94,9 +94,9 @@ endif
INCDIR := arch-$(incdir-y)
ifeq ($(KBUILD_SRC),)
-CPPFLAGS += -I$(BOARD)/include
+KBUILD_CPPFLAGS += -I$(BOARD)/include
else
-CPPFLAGS += -I$(srctree)/$(BOARD)/include
+KBUILD_CPPFLAGS += -I$(srctree)/$(BOARD)/include
endif
ifneq ($(machine-y),)
@@ -112,12 +112,12 @@ common-y += arch/mips/lib/
common-y += arch/mips/boot/
common-y += arch/mips/boards/
-CPPFLAGS += $(cflags-y)
-CFLAGS += $(cflags-y)
+KBUILD_CPPFLAGS += $(cflags-y)
+KBUILD_CFLAGS += $(cflags-y)
lds-$(CONFIG_GENERIC_LINKER_SCRIPT) := arch/mips/lib/barebox.lds
-cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@ \
+cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
-T $(BAREBOX_LDS) \
--start-group $(BAREBOX_OBJS) --end-group \
$(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^); \
diff --git a/arch/mips/pbl/Makefile b/arch/mips/pbl/Makefile
index 8f9e9fe593..535bb4bf55 100644
--- a/arch/mips/pbl/Makefile
+++ b/arch/mips/pbl/Makefile
@@ -29,7 +29,7 @@ zbarebox-common := $(BAREBOX_PBL_OBJS) $(obj)/$(piggy_o)
zbarebox-lds := $(obj)/zbarebox.lds
quiet_cmd_zbarebox__ ?= LD $@
- cmd_zbarebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_zbarebox) -o $@ \
+ cmd_zbarebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_zbarebox) -o $@ \
-T $(zbarebox-lds) \
--start-group $(zbarebox-common) --end-group \
$(filter-out $(zbarebox-lds) $(zbarebox-common) FORCE ,$^)