Makefile.include (1b2f76d77a277bb70d38ad0991ed7f16bbc115a9) Makefile.include (8e9b466799230bc20a029579e92d4cd526e5a2e1)
1ifneq ($(O),)
2ifeq ($(origin O), command line)
1ifneq ($(O),)
2ifeq ($(origin O), command line)
3 dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
4 ABSOLUTE_O := $(shell cd $(O) ; pwd)
3 ABSOLUTE_O := $(realpath $(O))
4 dummy := $(if $(ABSOLUTE_O),,$(error O=$(O) does not exist))
5 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
6 COMMAND_O := O=$(ABSOLUTE_O)
7ifeq ($(objtree),)
8 objtree := $(O)
9endif
10endif
11endif
12
13# check that the output directory actually exists
14ifneq ($(OUTPUT),)
5 OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
6 COMMAND_O := O=$(ABSOLUTE_O)
7ifeq ($(objtree),)
8 objtree := $(O)
9endif
10endif
11endif
12
13# check that the output directory actually exists
14ifneq ($(OUTPUT),)
15OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
15OUTDIR := $(realpath $(OUTPUT))
16$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
17endif
18
19#
20# Include saner warnings here, which can catch bugs:
21#
22EXTRA_WARNINGS := -Wbad-function-cast
23EXTRA_WARNINGS += -Wdeclaration-after-statement

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

34EXTRA_WARNINGS += -Wshadow
35EXTRA_WARNINGS += -Wstrict-prototypes
36EXTRA_WARNINGS += -Wswitch-default
37EXTRA_WARNINGS += -Wswitch-enum
38EXTRA_WARNINGS += -Wundef
39EXTRA_WARNINGS += -Wwrite-strings
40EXTRA_WARNINGS += -Wformat
41
16$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
17endif
18
19#
20# Include saner warnings here, which can catch bugs:
21#
22EXTRA_WARNINGS := -Wbad-function-cast
23EXTRA_WARNINGS += -Wdeclaration-after-statement

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

34EXTRA_WARNINGS += -Wshadow
35EXTRA_WARNINGS += -Wstrict-prototypes
36EXTRA_WARNINGS += -Wswitch-default
37EXTRA_WARNINGS += -Wswitch-enum
38EXTRA_WARNINGS += -Wundef
39EXTRA_WARNINGS += -Wwrite-strings
40EXTRA_WARNINGS += -Wformat
41
42CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
43
44ifeq ($(CC_NO_CLANG), 1)
42ifneq ($(CC), clang)
45EXTRA_WARNINGS += -Wstrict-aliasing=3
46endif
47
48# Hack to avoid type-punned warnings on old systems such as RHEL5:
49# We should be changing CFLAGS and checking gcc version, but this
50# will do for now and keep the above -Wstrict-aliasing=3 in place
51# in newer systems.
52# Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h

--- 50 unchanged lines hidden ---
43EXTRA_WARNINGS += -Wstrict-aliasing=3
44endif
45
46# Hack to avoid type-punned warnings on old systems such as RHEL5:
47# We should be changing CFLAGS and checking gcc version, but this
48# will do for now and keep the above -Wstrict-aliasing=3 in place
49# in newer systems.
50# Needed for the __raw_cmpxchg in tools/arch/x86/include/asm/cmpxchg.h

--- 50 unchanged lines hidden ---