+HOST_SPARSE_SDKROOT ?= /
+
+# SDKROOT may be passed as a shorthand like "iphoneos.internal". We
+# must resolve these to a full path and override SDKROOT.
+
+ifeq ($(SDKROOT_RESOLVED),)
+ifeq ($(SDKROOT),/)
+export SDKROOT_RESOLVED := /
+else
+export SDKROOT_RESOLVED := $(shell xcodebuild -sdk $(SDKROOT) -version Path | head -1)
+endif
+endif
+override SDKROOT = $(SDKROOT_RESOLVED)