diff options
| author | Sam Ravnborg <sam@ravnborg.org> | 2010-05-30 10:27:33 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2010-08-05 08:25:57 -0400 |
| commit | 961e196c7a3b3c3d1d9eb32629b0e745ce0a68d1 (patch) | |
| tree | a57f19cb586244ca2106afa78062144aa7c0c29f | |
| parent | ad5f2635578a19ff8885bff1ef4d5adf7193cb02 (diff) | |
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: Sam 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: Ralf Baechle <ralf@linux-mips.org>
| -rw-r--r-- | arch/mips/Makefile | 11 | ||||
| -rw-r--r-- | arch/mips/boot/Makefile | 49 |
2 files changed, 25 insertions, 35 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 50f780aa832..93ce1cefcdf 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
| @@ -266,7 +266,6 @@ vmlinux.32: vmlinux | |||
| 266 | vmlinux.64: vmlinux | 266 | vmlinux.64: vmlinux |
| 267 | $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ | 267 | $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ |
| 268 | 268 | ||
| 269 | makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) | ||
| 270 | makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \ | 269 | makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \ |
| 271 | VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1) | 270 | VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1) |
| 272 | 271 | ||
| @@ -284,14 +283,8 @@ vmlinuz.ecoff: vmlinux | |||
| 284 | vmlinuz.srec: vmlinux | 283 | vmlinuz.srec: vmlinux |
| 285 | +@$(call makezboot,$@) | 284 | +@$(call makezboot,$@) |
| 286 | 285 | ||
| 287 | vmlinux.bin: $(vmlinux-32) | 286 | vmlinux.bin vmlinux.ecoff vmlinux.srec: $(vmlinux-32) FORCE |
| 288 | +@$(call makeboot,$@) | 287 | $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) arch/mips/boot/$@ |
| 289 | |||
| 290 | vmlinux.ecoff: $(vmlinux-32) | ||
| 291 | +@$(call makeboot,$@) | ||
| 292 | |||
| 293 | vmlinux.srec: $(vmlinux-32) | ||
| 294 | +@$(call makeboot,$@) | ||
| 295 | 288 | ||
| 296 | CLEAN_FILES += vmlinux.ecoff \ | 289 | CLEAN_FILES += vmlinux.ecoff \ |
| 297 | vmlinux.srec | 290 | vmlinux.srec |
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile index e39a08edcaa..85bcb5adc7c 100644 --- a/arch/mips/boot/Makefile +++ b/arch/mips/boot/Makefile | |||
| @@ -11,35 +11,32 @@ | |||
| 11 | # Some DECstations need all possible sections of an ECOFF executable | 11 | # Some DECstations need all possible sections of an ECOFF executable |
| 12 | # | 12 | # |
| 13 | ifdef CONFIG_MACH_DECSTATION | 13 | ifdef CONFIG_MACH_DECSTATION |
| 14 | E2EFLAGS = -a | 14 | e2eflag := -a |
| 15 | else | ||
| 16 | E2EFLAGS = | ||
| 17 | endif | 15 | endif |
| 18 | 16 | ||
| 19 | # | 17 | # |
| 20 | # Drop some uninteresting sections in the kernel. | 18 | # Drop some uninteresting sections in the kernel. |
| 21 | # This is only relevant for ELF kernels but doesn't hurt a.out | 19 | # This is only relevant for ELF kernels but doesn't hurt a.out |
| 22 | # | 20 | # |
| 23 | drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options | 21 | drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options |
| 24 | strip-flags = $(addprefix --remove-section=,$(drop-sections)) | 22 | strip-flags := $(addprefix --remove-section=,$(drop-sections)) |
| 25 | 23 | ||
| 26 | VMLINUX = vmlinux | 24 | hostprogs-y := elf2ecoff |
| 27 | 25 | ||
| 28 | all: vmlinux.ecoff vmlinux.srec | 26 | targets := vmlinux.ecoff |
| 29 | 27 | quiet_cmd_ecoff = ECOFF $@ | |
| 30 | vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) | 28 | cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) $@ $(e2eflag) |
| 31 | $(obj)/elf2ecoff $(VMLINUX) $(obj)/vmlinux.ecoff $(E2EFLAGS) | 29 | $(obj)/vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) FORCE |
| 32 | 30 | $(call if_changed,ecoff) | |
| 33 | $(obj)/elf2ecoff: $(obj)/elf2ecoff.c | 31 | |
| 34 | $(HOSTCC) -o $@ $^ | 32 | targets += vmlinux.bin |
| 35 | 33 | quiet_cmd_bin = OBJCOPY $@ | |
| 36 | vmlinux.bin: $(VMLINUX) | 34 | cmd_bin = $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $@ |
| 37 | $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin | 35 | $(obj)/vmlinux.bin: $(VMLINUX) FORCE |
| 38 | 36 | $(call if_changed,bin) | |
| 39 | vmlinux.srec: $(VMLINUX) | 37 | |
| 40 | $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec | 38 | targets += vmlinux.srec |
| 41 | 39 | quiet_cmd_srec = OBJCOPY $@ | |
| 42 | clean-files += elf2ecoff \ | 40 | cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $@ |
| 43 | vmlinux.bin \ | 41 | $(obj)/vmlinux.srec: $(VMLINUX) FORCE |
| 44 | vmlinux.ecoff \ | 42 | $(call if_changed,srec) |
| 45 | vmlinux.srec | ||
