Makefile.include (a02633e9b13dcb9b1a656b08f81bc8ba2d4d2294) Makefile.include (7ed1c1901fe52e6c5828deb155920b44b0adabb1)
1# SPDX-License-Identifier: GPL-2.0
2ifneq ($(O),)
3ifeq ($(origin O), command line)
4 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
5 ABSOLUTE_O := $(shell cd $(O) ; pwd)
6 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
7 COMMAND_O := O=$(ABSOLUTE_O)
8ifeq ($(objtree),)

--- 28 unchanged lines hidden (view full) ---

37EXTRA_WARNINGS += -Wswitch-default
38EXTRA_WARNINGS += -Wswitch-enum
39EXTRA_WARNINGS += -Wundef
40EXTRA_WARNINGS += -Wwrite-strings
41EXTRA_WARNINGS += -Wformat
42
43CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
44
1# SPDX-License-Identifier: GPL-2.0
2ifneq ($(O),)
3ifeq ($(origin O), command line)
4 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
5 ABSOLUTE_O := $(shell cd $(O) ; pwd)
6 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
7 COMMAND_O := O=$(ABSOLUTE_O)
8ifeq ($(objtree),)

--- 28 unchanged lines hidden (view full) ---

37EXTRA_WARNINGS += -Wswitch-default
38EXTRA_WARNINGS += -Wswitch-enum
39EXTRA_WARNINGS += -Wundef
40EXTRA_WARNINGS += -Wwrite-strings
41EXTRA_WARNINGS += -Wformat
42
43CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
44
45# Makefiles suck: This macro sets a default value of $(2) for the
46# variable named by $(1), unless the variable has been set by
47# environment or command line. This is necessary for CC and AR
48# because make sets default values, so the simpler ?= approach
49# won't work as expected.
50define allow-override
51 $(if $(or $(findstring environment,$(origin $(1))),\
52 $(findstring command line,$(origin $(1)))),,\
53 $(eval $(1) = $(2)))
54endef
55
56# Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix.
57$(call allow-override,CC,$(CROSS_COMPILE)gcc)
58$(call allow-override,AR,$(CROSS_COMPILE)ar)
59$(call allow-override,LD,$(CROSS_COMPILE)ld)
60$(call allow-override,CXX,$(CROSS_COMPILE)g++)
61$(call allow-override,STRIP,$(CROSS_COMPILE)strip)
62
45ifeq ($(CC_NO_CLANG), 1)
46EXTRA_WARNINGS += -Wstrict-aliasing=3
47endif
48
49# Hack to avoid type-punned warnings on old systems such as RHEL5:
50# We should be changing CFLAGS and checking gcc version, but this
51# will do for now and keep the above -Wstrict-aliasing=3 in place
52# in newer systems.

--- 52 unchanged lines hidden ---
63ifeq ($(CC_NO_CLANG), 1)
64EXTRA_WARNINGS += -Wstrict-aliasing=3
65endif
66
67# Hack to avoid type-punned warnings on old systems such as RHEL5:
68# We should be changing CFLAGS and checking gcc version, but this
69# will do for now and keep the above -Wstrict-aliasing=3 in place
70# in newer systems.

--- 52 unchanged lines hidden ---