aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-01-22 07:34:15 -0500
committerSam Ravnborg <sam@mars.ravnborg.org>2006-02-19 03:51:20 -0500
commit20a468b51325b3636785a8ca0047ae514b39cbd5 (patch)
tree22e8d00b947cd110c9d600d24c4119ff30ff22c1 /Makefile
parentb39927cf4cc5a9123d2b157ffd396884cb8156eb (diff)
kbuild: make cc-version available in kbuild files
Move $(CC) support functions to Kbuild.include so they are available in the kbuild files. In addition the following was done: o as-option documented in Documentation/kbuild/makefiles.txt o Moved documentation to new section to match new scope of functions o added cc-ifversion used to conditionally select a text string dependent on actual $(CC) version o documented cc-ifversion o change so Kbuild.include is read before the kbuild file Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 0 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index c55d0f1b85ec..05b451a1b760 100644
--- a/Makefile
+++ b/Makefile
@@ -258,38 +258,6 @@ endif
258 258
259export quiet Q KBUILD_VERBOSE 259export quiet Q KBUILD_VERBOSE
260 260
261######
262# cc support functions to be used (only) in arch/$(ARCH)/Makefile
263# See documentation in Documentation/kbuild/makefiles.txt
264
265# as-option
266# Usage: cflags-y += $(call as-option, -Wa$(comma)-isa=foo,)
267
268as-option = $(shell if $(CC) $(CFLAGS) $(1) -Wa,-Z -c -o /dev/null \
269 -xassembler /dev/null > /dev/null 2>&1; then echo "$(1)"; \
270 else echo "$(2)"; fi ;)
271
272# cc-option
273# Usage: cflags-y += $(call cc-option, -march=winchip-c6, -march=i586)
274
275cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
276 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
277
278# cc-option-yn
279# Usage: flag := $(call cc-option-yn, -march=winchip-c6)
280cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
281 > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
282
283# cc-option-align
284# Prefix align with either -falign or -malign
285cc-option-align = $(subst -functions=0,,\
286 $(call cc-option,-falign-functions=0,-malign-functions=0))
287
288# cc-version
289# Usage gcc-ver := $(call cc-version $(CC))
290cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
291 $(if $(1), $(1), $(CC)))
292
293 261
294# Look for make include files relative to root of kernel src 262# Look for make include files relative to root of kernel src
295MAKEFLAGS += --include-dir=$(srctree) 263MAKEFLAGS += --include-dir=$(srctree)