summaryrefslogtreecommitdiffstats
path: root/tools/scripts/Makefile.include
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scripts/Makefile.include')
-rw-r--r--tools/scripts/Makefile.include10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index ccad8ce..9dc8f07 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,7 +1,7 @@
ifneq ($(O),)
ifeq ($(origin O), command line)
- dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
- ABSOLUTE_O := $(shell cd $(O) ; pwd)
+ ABSOLUTE_O := $(realpath $(O))
+ dummy := $(if $(ABSOLUTE_O),,$(error O=$(O) does not exist))
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
@@ -12,7 +12,7 @@ endif
# check that the output directory actually exists
ifneq ($(OUTPUT),)
-OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+OUTDIR := $(realpath $(OUTPUT))
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
endif
@@ -39,7 +39,9 @@ EXTRA_WARNINGS += -Wundef
EXTRA_WARNINGS += -Wwrite-strings
EXTRA_WARNINGS += -Wformat
-ifneq ($(CC), clang)
+CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
+
+ifeq ($(CC_NO_CLANG), 1)
EXTRA_WARNINGS += -Wstrict-aliasing=3
endif
OpenPOWER on IntegriCloud