X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/fe8ab488e9161c46dd9885d58fc52996dc0249ff..3903760236c30e3b5ace7a4eefac3a269d68957c:/tools/tests/Makefile diff --git a/tools/tests/Makefile b/tools/tests/Makefile index 37bd9e536..9080b3347 100644 --- a/tools/tests/Makefile +++ b/tools/tests/Makefile @@ -1,31 +1,29 @@ -ifdef RC_ProjectName -DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS -else -DSTSUBPATH = $(DSTROOT) -endif - -OBJROOT?=$(shell /bin/pwd) +include Makefile.common -SDKROOT ?= macosx.internal - -# SDKROOT may be passed as a shorthand like "iphoneos.internal". We -# must resolve these to a full path and override SDKROOT. - -SDKROOT_RESOLVED := $(shell xcrun -sdk $(SDKROOT) -show-sdk-path) -ifeq ($(strip $(SDKROOT)_$(SDKROOT_RESOLVED)),/_) -SDKROOT_RESOLVED := / +ifndef SRCROOT +export SRCROOT := $(shell /bin/pwd) +endif +ifndef OBJROOT +export OBJROOT = $(SRCROOT)/BUILD/obj +endif +ifndef DSTROOT +export DSTROOT = $(SRCROOT)/BUILD/dst +endif +ifndef SYMROOT +export SYMROOT = $(SRCROOT)/BUILD/sym endif -override SDKROOT = $(SDKROOT_RESOLVED) - -ifeq "$(RC_TARGET_CONFIG)" "iPhone" -Embedded?=YES +ifdef RC_ProjectName +DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS/tests/xnu +BATS_CONFIG_PATH = $(DSTROOT)/AppleInternal/CoreOS else -Embedded?=$(shell echo $(SDKROOT) | grep -iq iphoneos && echo YES || echo NO) +DSTSUBPATH = $(DSTROOT) +BATS_CONFIG_PATH = $(DSTROOT) endif -COMMON_TARGETS = xnu_quick_test \ +COMMON_TARGETS = unit_tests \ MPMMTest \ + packetdrill \ affinity \ execperf \ kqueue_tests \ @@ -33,21 +31,36 @@ COMMON_TARGETS = xnu_quick_test \ zero-to-n \ jitter \ perf_index \ - unit_tests + darwintests \ + unixconf -IPHONE_TARGETS = memorystatus +IPHONE_TARGETS = -MAC_TARGETS = +MAC_TARGETS = + +BATS_TARGET = $(BATS_CONFIG_PATH)/BATS ifeq "$(Embedded)" "YES" -TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) +TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) else -TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) +TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) endif -all: $(TARGETS) +all: $(BATS_TARGET) $(TARGETS) + +.PHONY: always + +always: + +$(DSTSUBPATH)/%: always + $(_v)echo Building $@ + $(_v)mkdir -p $@ + $(_v)mkdir -p $(OBJROOT)/$(notdir $@) + $(_v)mkdir -p $(SYMROOT)/$(notdir $@) + $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) -$(DSTSUBPATH)/%: - mkdir -p $@ - mkdir -p $(OBJROOT)/$(notdir $@) - $(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) +$(BATS_TARGET): $(TARGETS) + $(_v)mkdir -p $@ + $(_v)mkdir -p $(OBJROOT)/$(notdir $@) + $(_v)mkdir -p $(SYMROOT) + $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)