Skip to content

Commit 950b260

Browse files
sravnborgmichalsimek
authored andcommitted
microblaze: Makefile cleanup
Reviewed the Makefile on request by Michal and this is the resulting changes. o Use ':=' for assignmnet so we do not re-evaluate for each use o Use $(shell echo xxx) to remove "" o Replaced CFLAGS_KERNEL with KBUILD_CFLAGS The settings are equally relevant for modules and the linked kernel o Dropped LDFLAGS_BLOB - it is no longer used o Refactored assignmnets to libs-y and core-y o Use MMU for the MMU specific extension. "MMUEXT" was hurting my eyes and I did not wanted it spread to m68k Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Simek <monstr@monstr.eu>
1 parent 65d3db0 commit 950b260

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

‎arch/microblaze/Makefile‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ endif
66

77
# What CPU vesion are we building for, and crack it open
88
# as major.minor.rev
9-
CPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) )
10-
CPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1)
11-
CPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2)
12-
CPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3)
9+
CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER))
10+
CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1)
11+
CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2)
12+
CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3)
1313

1414
export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV
1515

1616
# Use cpu-related CONFIG_ vars to set compile options.
17+
# The various CONFIG_XILINX cpu features options are integers 0/1/2...
18+
# rather than bools y/n
1719

1820
# Work out HW multipler support. This is icky.
1921
# 1. Spartan2 has no HW multiplers.
@@ -34,30 +36,29 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare
3436

3537
CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER))
3638

37-
# The various CONFIG_XILINX cpu features options are integers 0/1/2...
38-
# rather than bools y/n
39-
4039
# r31 holds current when in kernel mode
41-
CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
40+
KBUILD_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
4241

4342
LDFLAGS :=
4443
LDFLAGS_vmlinux :=
45-
LDFLAGS_BLOB := --format binary --oformat elf32-microblaze
4644

47-
LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name)
45+
LIBGCC := $(shell $(CC) $(KBUILD_KERNEL) -print-libgcc-file-name)
4846

49-
head-y := arch/microblaze/kernel/head.o
50-
libs-y += arch/microblaze/lib/ $(LIBGCC)
51-
core-y += arch/microblaze/kernel/ arch/microblaze/mm/ \
52-
arch/microblaze/platform/
47+
head-y := arch/microblaze/kernel/head.o
48+
libs-y += arch/microblaze/lib/
49+
libs-y += $(LIBGCC)
50+
core-y += arch/microblaze/kernel/
51+
core-y += arch/microblaze/mm/
52+
core-y += arch/microblaze/platform/
5353

54-
boot := arch/$(ARCH)/boot
54+
boot := arch/microblaze/boot
5555

5656
# defines filename extension depending memory management type
5757
ifeq ($(CONFIG_MMU),)
58-
MMUEXT := -nommu
58+
MMU := -nommu
5959
endif
60-
export MMUEXT
60+
61+
export MMU
6162

6263
all: linux.bin
6364

‎arch/microblaze/kernel/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ obj-$(CONFIG_HEART_BEAT) += heartbeat.o
1717
obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
1818
obj-$(CONFIG_MMU) += misc.o
1919

20-
obj-y += entry$(MMUEXT).o
20+
obj-y += entry$(MMU).o

0 commit comments

Comments
 (0)