Commit 961e196c authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Ralf Baechle

MIPS: Refactor arch/mips/boot/Makefile

- remove stuff that is not needed
  VMLINUX assignment, all: rule
- use hostprogs-y for the host program
- use kbuild rules for the three targets - to beautify output
- drop clean-files - it is no longer needed
- simplify arch/mips/Makefile when calling targets in boot/Makefile
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
To: linux-mips <linux-mips@linux-mips.org>
To: Wu Zhangjin <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/1303/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent ad5f2635
...@@ -266,7 +266,6 @@ vmlinux.32: vmlinux ...@@ -266,7 +266,6 @@ vmlinux.32: vmlinux
vmlinux.64: vmlinux vmlinux.64: vmlinux
$(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@
makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1)
makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \ makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1) VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1)
...@@ -284,14 +283,8 @@ vmlinuz.ecoff: vmlinux ...@@ -284,14 +283,8 @@ vmlinuz.ecoff: vmlinux
vmlinuz.srec: vmlinux vmlinuz.srec: vmlinux
+@$(call makezboot,$@) +@$(call makezboot,$@)
vmlinux.bin: $(vmlinux-32) vmlinux.bin vmlinux.ecoff vmlinux.srec: $(vmlinux-32) FORCE
+@$(call makeboot,$@) $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) arch/mips/boot/$@
vmlinux.ecoff: $(vmlinux-32)
+@$(call makeboot,$@)
vmlinux.srec: $(vmlinux-32)
+@$(call makeboot,$@)
CLEAN_FILES += vmlinux.ecoff \ CLEAN_FILES += vmlinux.ecoff \
vmlinux.srec vmlinux.srec
......
...@@ -11,35 +11,32 @@ ...@@ -11,35 +11,32 @@
# Some DECstations need all possible sections of an ECOFF executable # Some DECstations need all possible sections of an ECOFF executable
# #
ifdef CONFIG_MACH_DECSTATION ifdef CONFIG_MACH_DECSTATION
E2EFLAGS = -a e2eflag := -a
else
E2EFLAGS =
endif endif
# #
# Drop some uninteresting sections in the kernel. # Drop some uninteresting sections in the kernel.
# This is only relevant for ELF kernels but doesn't hurt a.out # This is only relevant for ELF kernels but doesn't hurt a.out
# #
drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options
strip-flags = $(addprefix --remove-section=,$(drop-sections)) strip-flags := $(addprefix --remove-section=,$(drop-sections))
VMLINUX = vmlinux hostprogs-y := elf2ecoff
all: vmlinux.ecoff vmlinux.srec targets := vmlinux.ecoff
quiet_cmd_ecoff = ECOFF $@
vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) $@ $(e2eflag)
$(obj)/elf2ecoff $(VMLINUX) $(obj)/vmlinux.ecoff $(E2EFLAGS) $(obj)/vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) FORCE
$(call if_changed,ecoff)
$(obj)/elf2ecoff: $(obj)/elf2ecoff.c
$(HOSTCC) -o $@ $^ targets += vmlinux.bin
quiet_cmd_bin = OBJCOPY $@
vmlinux.bin: $(VMLINUX) cmd_bin = $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $@
$(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin $(obj)/vmlinux.bin: $(VMLINUX) FORCE
$(call if_changed,bin)
vmlinux.srec: $(VMLINUX)
$(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec targets += vmlinux.srec
quiet_cmd_srec = OBJCOPY $@
clean-files += elf2ecoff \ cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@
vmlinux.bin \ $(obj)/vmlinux.srec: $(VMLINUX) FORCE
vmlinux.ecoff \ $(call if_changed,srec)
vmlinux.srec
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment