X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..7e41aa883dd258f888d0470250eead40a53ef1f5:/tools/tests/kqueue_tests/Makefile?ds=sidebyside diff --git a/tools/tests/kqueue_tests/Makefile b/tools/tests/kqueue_tests/Makefile index b51ccd631..d8ffd2c16 100755 --- a/tools/tests/kqueue_tests/Makefile +++ b/tools/tests/kqueue_tests/Makefile @@ -1,7 +1,31 @@ -all: file timer +include ../Makefile.common -file: - gcc -o file_tests kqueue_file_tests.c -arch i386 +CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc) -timer: - gcc -o timer_tests kqueue_timer_tests.c -arch i386 -arch x86_64 +ifdef RC_ARCHS + ARCHS:=$(RC_ARCHS) + else + ifeq "$(Embedded)" "YES" + ARCHS:=armv7 armv7s arm64 + else + ARCHS:=x86_64 i386 + endif +endif + +CFLAGS :=-g $(patsubst %, -arch %,$(ARCHS)) -isysroot $(SDKROOT) + +DSTROOT?=$(shell /bin/pwd) +SYMROOT?=$(shell /bin/pwd) + +all: $(addprefix $(DSTROOT)/, file timer) + +$(DSTROOT)/file: + $(CC) $(CFLAGS) -o $(SYMROOT)/file_tests kqueue_file_tests.c + if [ ! -e $(DSTROOT)/file_tests ]; then ditto $(SYMROOT)/file_tests $(DSTROOT)/file_tests; fi + +$(DSTROOT)/timer: + $(CC) $(CFLAGS) -o $(SYMROOT)/timer_tests kqueue_timer_tests.c + if [ ! -e $(DSTROOT)/timer_tests ]; then ditto $(SYMROOT)/timer_tests $(DSTROOT)/timer_tests; fi + +clean: + rm -rf $(DSTROOT)/file_tests $(DSTROOT)/timer_tests $(SYMROOT)/*.dSYM $(SYMROOT)/file_tests $(SYMROOT)/timer_tests