10f3703acSApple OSS Distributionsinclude Makefile.common 20f3703acSApple OSS Distributions 30f3703acSApple OSS Distributionsifndef SRCROOT 40f3703acSApple OSS Distributionsexport SRCROOT := $(shell /bin/pwd) 50f3703acSApple OSS Distributionsendif 60f3703acSApple OSS Distributionsifndef OBJROOT 70f3703acSApple OSS Distributionsexport OBJROOT = $(SRCROOT)/BUILD/obj 80f3703acSApple OSS Distributionsendif 90f3703acSApple OSS Distributionsifndef DSTROOT 100f3703acSApple OSS Distributionsexport DSTROOT = $(SRCROOT)/BUILD/dst 110f3703acSApple OSS Distributionsendif 120f3703acSApple OSS Distributionsifndef SYMROOT 130f3703acSApple OSS Distributionsexport SYMROOT = $(SRCROOT)/BUILD/sym 140f3703acSApple OSS Distributionsendif 150f3703acSApple OSS Distributions 16186b8fceSApple OSS Distributionsifdef RC_ProjectName 170f3703acSApple OSS DistributionsDSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS/tests/xnu 180f3703acSApple OSS DistributionsBATS_CONFIG_PATH = $(DSTROOT)/AppleInternal/CoreOS 19186b8fceSApple OSS Distributionselse 20186b8fceSApple OSS DistributionsDSTSUBPATH = $(DSTROOT) 210f3703acSApple OSS DistributionsBATS_CONFIG_PATH = $(DSTROOT) 22186b8fceSApple OSS Distributionsendif 23186b8fceSApple OSS Distributions 24bb611c8fSApple OSS DistributionsDSTSUBPATH_KEXTS = $(DSTROOT)/System/AppleInternal/Library/AuxiliaryExtensions 25bb611c8fSApple OSS Distributions 260f3703acSApple OSS DistributionsCOMMON_TARGETS = unit_tests \ 27186b8fceSApple OSS Distributions MPMMTest \ 2888cc0b97SApple OSS Distributions packetdrill \ 29186b8fceSApple OSS Distributions affinity \ 30186b8fceSApple OSS Distributions superpages \ 31186b8fceSApple OSS Distributions zero-to-n \ 32186b8fceSApple OSS Distributions jitter \ 3388cc0b97SApple OSS Distributions perf_index \ 34cc9a6355SApple OSS Distributions personas \ 3576e12aa3SApple OSS Distributions unixconf \ 36*e6231be0SApple OSS Distributions kernpost_test_report \ 37bb611c8fSApple OSS Distributions 38bb611c8fSApple OSS DistributionsKEXT_TARGETS = pgokext.kext 39186b8fceSApple OSS Distributions 400f3703acSApple OSS DistributionsIPHONE_TARGETS = 41186b8fceSApple OSS Distributions 42186b8fceSApple OSS DistributionsMAC_TARGETS = 43186b8fceSApple OSS Distributions 440f3703acSApple OSS DistributionsBATS_TARGET = $(BATS_CONFIG_PATH)/BATS 450f3703acSApple OSS Distributions 46186b8fceSApple OSS Distributionsifeq "$(Embedded)" "YES" 47bb611c8fSApple OSS DistributionsTARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) 48186b8fceSApple OSS Distributionselse 49bb611c8fSApple OSS DistributionsTARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS)) 50186b8fceSApple OSS Distributionsendif 51186b8fceSApple OSS Distributions 520f3703acSApple OSS Distributionsall: $(BATS_TARGET) $(TARGETS) 53186b8fceSApple OSS Distributions 5488cc0b97SApple OSS Distributions.PHONY: always 5588cc0b97SApple OSS Distributions 5688cc0b97SApple OSS Distributionsalways: 5788cc0b97SApple OSS Distributions 5876e12aa3SApple OSS Distributions# NOTE: RC_ARCHES nonsense is here because code signing will fail on kexts if we include a i386 slice 5976e12aa3SApple OSS Distributions# <rdar://problem/29878263> CoreOSLobo: xnu_tests-4026 fails to codesign 6076e12aa3SApple OSS Distributions 61bb611c8fSApple OSS Distributions$(DSTSUBPATH_KEXTS)/pgokext.kext: always 62bb611c8fSApple OSS Distributions xcodebuild -configuration Debug -project $(SRCROOT)/testkext/testkext.xcodeproj -target pgokext DSTROOT=$(DSTSUBPATH_KEXTS) SYMROOT=$(SYMROOT)/testkext SRCROOT=$(SRCROOT)/testkext OBJROOT=$(OBJROOT)/testkext SDKROOT=$(SDKROOT) RC_ARCHS="$(subst i386,,$(RC_ARCHS))" install 6376e12aa3SApple OSS Distributions 6488cc0b97SApple OSS Distributions$(DSTSUBPATH)/%: always 6588cc0b97SApple OSS Distributions $(_v)echo Building $@ 6688cc0b97SApple OSS Distributions $(_v)mkdir -p $@ 6788cc0b97SApple OSS Distributions $(_v)mkdir -p $(OBJROOT)/$(notdir $@) 6888cc0b97SApple OSS Distributions $(_v)mkdir -p $(SYMROOT)/$(notdir $@) 6988cc0b97SApple OSS Distributions $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) 7076e12aa3SApple OSS Distributions $(_v)find $@ -type d -name "*.dSYM" -exec cp -a {} $(SYMROOT)/ ';' 7188cc0b97SApple OSS Distributions 7288cc0b97SApple OSS Distributions$(BATS_TARGET): $(TARGETS) 7388cc0b97SApple OSS Distributions $(_v)mkdir -p $@ 7488cc0b97SApple OSS Distributions $(_v)mkdir -p $(OBJROOT)/$(notdir $@) 7588cc0b97SApple OSS Distributions $(_v)mkdir -p $(SYMROOT) 7676e12aa3SApple OSS Distributions $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) BASEDSTSUBPATH=$(DSTSUBPATH) 77