You might try using xnu-make, a project for building xnu. It serves as a standalone build environment and automatically creates a local copy of the SDK instead of modifying the default one. See the lines below from its Makefile which are used to copy the SDK and create a symlink in Xcode so it can be used:
MACOSX_SDK = MacOSX10.11
...
#make a copy of the current sdk to the build directory and create a symlink in the Xcode SDKs directory
XCODE_SDKS_DIR := $(shell xcrun -sdk macosx --show-sdk-platform-path)/Developer/SDKs
MACOSX_SDK_SRC := $(XCODE_SDKS_DIR)/$(MACOSX_SDK).sdk
MACOSX_SDK_DST := $(CURDIR)/build/sdk/$(MACOSX_SDK)-xnu.sdk
MACOSX_SDK_LNK := $(XCODE_SDKS_DIR)/$(shell basename $(MACOSX_SDK_DST))
MACOSX_SDK_XNU := $(shell echo $(MACOSX_SDK) | tr A-Z a-z)-xnu
sdk:
ifeq ($(shell test -d $(MACOSX_SDK_SRC); echo $$?), 1)
$(error "The SDK $(MACOSX_SDK) cannot be found, make sure that the latest Xcode version is installed")
endif
mkdir -p $(MACOSX_SDK_DST)
cd $(MACOSX_SDK_SRC) && rsync -rtpl . $(MACOSX_SDK_DST)
plutil -replace CanonicalName -string $(MACOSX_SDK_XNU) $(MACOSX_SDK_DST)/SDKSettings.plist
rm -f $(MACOSX_SDK_LNK)
ln -sf $(MACOSX_SDK_DST) $(MACOSX_SDK_LNK)
I updated the Makefile slightly to build MacOSX10.13 and replaced the .gitmodules with newer sources of the xnu code and supporting libraries, but once I did those things, this built the kernel without modifying the local SDK.
You could also simply adapt the lines above into a script for copying the SDK if you don't want to use the xnu-make project.