public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Jerone Young <jyoung5@us.ibm.com>
Cc: kvm-devel@lists.sourceforge.net, kvm-ppc-devel@lists.sourceforge.net
Subject: Re: [PATCH] Update kernel/Makefile and remove x86 only entries
Date: Wed, 30 Apr 2008 23:16:09 +0300	[thread overview]
Message-ID: <4818D389.1010102@qumranet.com> (raw)
In-Reply-To: <73d50add8042835e408c.1209409686@thinkpadL>

Jerone Young wrote:
> This patch removes static x86 entries and makes things work for multiple archs.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> diff --git a/kernel/Makefile b/kernel/Makefile
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -1,5 +1,10 @@ include ../config.mak
>  include ../config.mak
>  
> +ARCH_DIR=$(ARCH)
> +ifneq '$(filter $(ARCH_DIR), x86_64 i386)' ''
> +	ARCH_DIR=x86
> +endif
> + 
>   

Let's be consistent with functions and directives:

  ARCH_DIR=$(if $(filter $(ARCH),x86_64 i386),x86,$(ARCH))

>  KVERREL = $(patsubst /lib/modules/%/build,%,$(KERNELDIR))
>  
>  DESTDIR=
> @@ -18,10 +23,19 @@ _hack = mv $1 $1.orig && \
>  	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
>  
>  unifdef = mv $1 $1.orig && \
> -	  unifdef -DCONFIG_X86 $1.orig > $1; \
> +	  unifdef -DCONFIG_$(shell echo $(ARCH_DIR)|tr '[:lower:]' '[:upper:]') $1.orig > $1; \
>            [ $$? -le 1 ] && rm $1.orig
>   

My eyes hurt.  A new variable please (and assign with := to avoid the 
shell being called too often).

>  
>  hack = $(call _hack,$T/$(strip $1))
> +
> +ifneq '$(filter $(ARCH_DIR), x86)' ''
> +HACK_FILES = kvm_main.c \
> +		mmu.c \
> +		vmx.c \
> +		svm.c \
> +		x86.c \
> +		irq.h 
> +endif
>  
>   

hack-files-x86 = ...
hack-files-ppc = ...

hack-files = $(hack-files-$(ARCH_DIR))

(yeah, someone else is now gauging their eyes out)

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-30 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 19:08 [PATCH] Update kernel/Makefile and remove x86 only entries Jerone Young
2008-04-30 20:16 ` Avi Kivity [this message]
2008-04-30 21:11   ` [kvm-ppc-devel] " Hollis Blanchard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4818D389.1010102@qumranet.com \
    --to=avi@qumranet.com \
    --cc=jyoung5@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=kvm-ppc-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox