Re: using cc-option in arch/ppc64/boot/Makefile

From: Hollis Blanchard
Date: Mon Oct 18 2004 - 16:06:01 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/