mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: using cc-option in arch/ppc64/boot/Makefile
Date: Mon, 18 Oct 2004 15:58:38 +0000	[thread overview]
Message-ID: <200410181558.38286.hollisb@us.ibm.com> (raw)
In-Reply-To: <20041018210128.GA16283@mars.ravnborg.org>

On Monday 18 October 2004 21:01, Sam Ravnborg wrote:
> Skip the include of Mafilefile.lib and try again. If you still has troubles
> try posting a complete diff.

Complete diff:

===== arch/ppc64/boot/Makefile 1.25 vs edited =====
--- 1.25/arch/ppc64/boot/Makefile       Sun Oct  3 12:23:50 2004
+++ edited/arch/ppc64/boot/Makefile     Mon Oct 18 14:24:50 2004
@@ -72,7 +72,12 @@
 quiet_cmd_stripvm = STRIP $@
       cmd_stripvm = $(STRIP) -s $< -o $@

+HAS_BIARCH      := $(call cc-option-yn, -lalala)
+
 vmlinux.strip: vmlinux FORCE
+       echo $(cc-option-yn)
+       echo $(HAS_BIARCH)
+       $(call cc-option-yn, -m64)
        $(call if_changed,stripvm)
 $(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk 
$(obj)/ramdisk.image.gz FORCE
        $(call if_changed,ramdisk)
===== scripts/Makefile.lib 1.26 vs edited =====
--- 1.26/scripts/Makefile.lib   Sun Aug 15 05:17:51 2004
+++ edited/scripts/Makefile.lib Wed Oct 13 14:13:38 2004
@@ -232,3 +232,28 @@
 # Usage:
 # $(Q)$(MAKE) $(build)=dir
 build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+
+######
+# cc support functions to be used (only) in arch/$(ARCH)/Makefile
+# See documentation in Documentation/kbuild/makefiles.txt
+
+# cc-option
+# Usage: cflags-y += $(call gcc-option, -march=winchip-c6, -march=i586)
+
+cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+
+# For backward compatibility
+check_gcc = $(warning check_gcc is deprecated - use cc-option) \
+            $(call cc-option, $(1),$(2))
+
+# cc-option-yn
+# Usage: flag := $(call gcc-option-yn, -march=winchip-c6)
+cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null 
\
+                > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
+
+# cc-version
+# Usage gcc-ver := $(call cc-version $(CC))
+cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
+              $(if $(1), $(1), $(CC)))
+


Output:
...
make -f scripts/Makefile.build obj=arch/ppc64/boot arch/ppc64/boot/zImage
echo y
y
echo

y
make[1]: y: Command not found


-- 
Hollis Blanchard
IBM Linux Technology Center

      reply	other threads:[~2004-10-18 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-14 16:11 Hollis Blanchard
2004-10-17  9:57 ` Sam Ravnborg
2004-10-18 13:47   ` Hollis Blanchard
2004-10-18 21:01     ` Sam Ravnborg
2004-10-18 15:58       ` Hollis Blanchard [this message]

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=200410181558.38286.hollisb@us.ibm.com \
    --to=hollisb@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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

all inboxes | Powered by JetHome®