1 include Makefile.common
4 export SRCROOT := $(shell /bin/pwd)
7 export OBJROOT = $(SRCROOT)/BUILD/obj
10 export DSTROOT = $(SRCROOT)/BUILD/dst
13 export SYMROOT = $(SRCROOT)/BUILD/sym
17 DSTSUBPATH = $(DSTROOT)/AppleInternal/CoreOS/tests/xnu
18 BATS_CONFIG_PATH = $(DSTROOT)/AppleInternal/CoreOS
20 DSTSUBPATH = $(DSTROOT)
21 BATS_CONFIG_PATH = $(DSTROOT)
24 DSTSUBPATH_KEXTS = $(DSTROOT)/System/AppleInternal/Library/AuxiliaryExtensions
26 COMMON_TARGETS = unit_tests \
36 kernpost_test_report \
38 KEXT_TARGETS = pgokext.kext
44 BATS_TARGET = $(BATS_CONFIG_PATH)/BATS
46 ifeq "$(Embedded)" "YES"
47 TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(IPHONE_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
49 TARGETS = $(addprefix $(DSTSUBPATH)/, $(COMMON_TARGETS) $(MAC_TARGETS)) $(addprefix $(DSTSUBPATH_KEXTS)/, $(KEXT_TARGETS))
52 all: $(BATS_TARGET) $(TARGETS)
58 # NOTE: RC_ARCHES nonsense is here because code signing will fail on kexts if we include a i386 slice
59 # <rdar://problem/29878263> CoreOSLobo: xnu_tests-4026 fails to codesign
61 $(DSTSUBPATH_KEXTS)/pgokext.kext: always
62 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
64 $(DSTSUBPATH)/%: always
67 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
68 $(_v)mkdir -p $(SYMROOT)/$(notdir $@)
69 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SYMROOT=$(SYMROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT)
70 $(_v)find $@ -type d -name "*.dSYM" -exec cp -a {} $(SYMROOT)/ ';'
72 $(BATS_TARGET): $(TARGETS)
74 $(_v)mkdir -p $(OBJROOT)/$(notdir $@)
75 $(_v)mkdir -p $(SYMROOT)
76 $(_v)$(MAKE) -C $(SRCROOT)/$(notdir $@) SRCROOT=$(SRCROOT)/$(notdir $@) DSTROOT=$@ OBJROOT=$(OBJROOT)/$(notdir $@) SDKROOT=$(SDKROOT) BASEDSTROOT=$(DSTROOT) BASEDSTSUBPATH=$(DSTSUBPATH)