License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[sfrench/cifs-2.6.git] / tools / scripts / Makefile.include
index 1e8b6116ba3c4ee03e137b737b84aaa26d133b94..f5c95d4f56a1747c8f5537e33a26ba4907a0e339 100644 (file)
@@ -1,7 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
 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 +13,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