All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips: refactor arch/mips/boot/Makefile
@ 2010-05-29 19:57 Sam Ravnborg
  2010-05-30  3:11 ` Wu Zhangjin
  0 siblings, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2010-05-29 19:57 UTC (permalink / raw)
  To: Ralf Baechle, linux-mips; +Cc: Wu Zhangjin



^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] mips: refactor arch/mips/boot/Makefile
@ 2010-05-29 19:50 Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2010-05-29 19:50 UTC (permalink / raw)


- remove stuff that is not needed
  VMLINUX assignment, all: rule, unused assignment
- use hostprogs-y for the host program
- use direct assignmnet when possible
- use kbuild rules for the three targets - to beautify output
- update clean-files to specify the targets that is built in the top.level dir

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 arch/mips/boot/Makefile |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index de20e81..28dbf92 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -11,32 +11,32 @@
 # Some DECstations need all possible sections of an ECOFF executable
 #
 ifdef CONFIG_MACH_DECSTATION
-  E2EFLAGS = -a
-else
-  E2EFLAGS =
+  E2EFLAGS := -a
 endif
 
 #
 # Drop some uninteresting sections in the kernel.
 # This is only relevant for ELF kernels but doesn't hurt a.out
 #
-drop-sections	= .reginfo .mdebug .comment .note .pdr .options .MIPS.options
-strip-flags	= $(addprefix --remove-section=,$(drop-sections))
+drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options
+strip-flags   := $(addprefix --remove-section=,$(drop-sections))
 
-VMLINUX = vmlinux
-
-all: vmlinux.ecoff vmlinux.srec
+hostprogs-y := elf2ecoff
 
+quiet_cmd_ecoff = ECOFF   $@
+      cmd_ecoff = $(obj)/elf2ecoff $(VMLINUX) $(obj)/vmlinux.ecoff $(E2EFLAGS)
 vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX)
-	$(obj)/elf2ecoff $(VMLINUX) $(obj)/vmlinux.ecoff $(E2EFLAGS)
-
-$(obj)/elf2ecoff: $(obj)/elf2ecoff.c
-	$(HOSTCC) -o $@ $^
+	$(call cmd,ecoff)
 
+quiet_cmd_bin = OBJCOPY $@
+      cmd_bin = $(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
 vmlinux.bin: $(VMLINUX)
-	$(OBJCOPY) -O binary $(strip-flags) $(VMLINUX) $(obj)/vmlinux.bin
+	$(call cmd,bin)
 
+quiet_cmd_srec = OBJCOPY $@
+      cmd_srec = $(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec
 vmlinux.srec: $(VMLINUX)
-	$(OBJCOPY) -S -O srec $(strip-flags) $(VMLINUX) $(obj)/vmlinux.srec
+	$(call cmd,srec)
 
-clean-files += elf2ecoff
+# clean files created in top-level directory
+clean-files := $(objtree)/vmlinux.*
-- 
1.6.0.6

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

end of thread, other threads:[~2010-05-30  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-29 19:57 [PATCH] mips: refactor arch/mips/boot/Makefile Sam Ravnborg
2010-05-30  3:11 ` Wu Zhangjin
2010-05-30  5:23   ` Sam Ravnborg
2010-05-30  9:11     ` Wu Zhangjin
  -- strict thread matches above, loose matches on Subject: below --
2010-05-29 19:50 Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.