Lines Matching +full:y +full:- +full:min

1 # SPDX-License-Identifier: GPL-2.0-only
3 # cc-cross-prefix
4 # Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
12 cc-cross-prefix = $(firstword $(foreach c, $(1), \
13 $(if $(shell command -v -- $(c)gcc 2>/dev/null), $(c))))
18 # try-run
19 # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
22 try-run = $(shell set -e; \
24 trap "rm -rf $(TMPOUT)" EXIT; \
25 mkdir -p $(TMPOUT); \
31 # as-option
32 # Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
34 as-option = $(call try-run,\
35 …$(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TM…
37 # as-instr
38 # Usage: aflags-y += $(call as-instr,instr,option1,option2)
40 as-instr = $(call try-run,\
41 …f "%b\n" "$(1)" | $(CC) -Werror $(CLANG_FLAGS) $(KBUILD_AFLAGS) -Wa$(comma)--fatal-warnings -c -x …
43 # __cc-option
44 # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586)
45 __cc-option = $(call try-run,\
46 $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4))
48 # cc-option
49 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
51 cc-option = $(call __cc-option, $(CC),\
54 # cc-option-yn
55 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
56 cc-option-yn = $(if $(call cc-option,$1),y,n)
58 # cc-disable-warning
59 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
60 cc-disable-warning = $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $1))
62 # gcc-min-version
63 # Usage: cflags-$(call gcc-min-version, 70100) += -foo
64 gcc-min-version = $(call test-ge, $(CONFIG_GCC_VERSION), $1)
66 # clang-min-version
67 # Usage: cflags-$(call clang-min-version, 110000) += -foo
68 clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1)
70 # ld-option
71 # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
72 ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
74 # __rustc-option
75 # Usage: MY_RUSTFLAGS += $(call __rustc-option,$(RUSTC),$(MY_RUSTFLAGS),-Cinstrument-coverage,-Zins…
77 __rustc-option = $(call try-run,\
79 $(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null,$(2)) $(3)\
80 --crate-type=rlib --out-dir=$(TMPOUT) --emit=obj=- - >/dev/null,$(3),$(4))
82 # rustc-option
83 # Usage: rustflags-y += $(call rustc-option,-Cinstrument-coverage,-Zinstrument-coverage)
84 rustc-option = $(call __rustc-option, $(RUSTC),\
87 # rustc-option-yn
88 # Usage: flag := $(call rustc-option-yn,-Cinstrument-coverage)
89 rustc-option-yn = $(if $(call rustc-option,$1),y,n)