linux-mips
[Top] [All Lists]

Re: [PATCH] mips: refactor arch/mips/boot/Makefile

To: Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH] mips: refactor arch/mips/boot/Makefile
From: Wu Zhangjin <wuzhangjin@gmail.com>
Date: Sun, 30 May 2010 11:11:25 +0800
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to:cc :in-reply-to:references:content-type:organization:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=r1a2wfbL9Cd90bZX0YXSawnpL5OU8TW+9IlqJgX4Drk=; b=sFmch4b5Kq4yVsm2JB1Qzr5xLn3ejLoNIYChTPLaxImhApc9qQvgDqWCMmMcIDr5hk ox5PiCEGNJd+KJsl9l0wkb7oaszNTPyshdZOaz2Sgxpv3ULKb6DbSELlSvI5Fih5wVxH ICLJIUs19Dxocrj1xXygtyD28QbZzihJbzObw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=pVY2GWbJhSqkW016Ab8Rjf6jRze3Ldb46w3ciKCY1LOBV0MMmtVTIWCnk/YhZm0s9C cfZQz46HpJh6pbfq0IkySszIN91J+bm3tOKDTmn16upQafBP3KBr04JBEeRZXBGisLwV SdXi1RTpZHzK5OqGS0aHyeMyXpgAK7mnkG1nM=
In-reply-to: <20100529195752.GA19568@merkur.ravnborg.org>
Organization: DSLab, Lanzhou University, China
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20100529195752.GA19568@merkur.ravnborg.org>
Reply-to: wuzhangjin@gmail.com
Sender: linux-mips-bounce@linux-mips.org
Hi, Sam

This patch really make the Makefile looks better,

Could you please apply the similar modification to
arch/mips/boot/compressed/Makefile? thanks!

Regards,
        Wu Zhangjin

On Sat, 2010-05-29 at 21:57 +0200, Sam Ravnborg wrote:
> >From 0b95917f21f145d07351fb098b3f4804c4bf6ca1 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Sat, 29 May 2010 21:50:50 +0200
> Subject: [PATCH] mips: refactor arch/mips/boot/Makefile
> 
> - 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.*



<Prev in Thread] Current Thread [Next in Thread>