10 include $(MAKEFILEPATH)/CoreOS/ReleaseControl/Common.make
11 MY_ARCH = $(patsubst %, -arch %, $(RC_ARCHS))
12 install:: xnu_quick_test
15 SRCROOT=$(shell /bin/pwd)
18 OBJROOT=$(SRCROOT)/BUILD/obj
21 DSTROOT=$(SRCROOT)/BUILD/dst
25 ARCH=i386 x86_64 ppc ppc64
29 MY_ARCH = $(patsubst %, -arch %, $(ARCH)) # allows building multiple archs.
35 CFLAGS += -g -I /System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/ -F/AppleInternal/Library/Frameworks/ $(MORECFLAGS)
36 LIBFLAGS = -I /System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/ -F/AppleInternal/Library/Frameworks/ -framework XILog
37 #CFLAGS+= $(MY_ARCH) -g -D_POSIX_C_SOURCE=200112L
39 MY_OBJECTS = $(OBJROOT)/main.o $(OBJROOT)/memory_tests.o $(OBJROOT)/misc.o \
40 $(OBJROOT)/sema_tests.o $(OBJROOT)/shared_memory_tests.o \
41 $(OBJROOT)/socket_tests.o $(OBJROOT)/tests.o $(OBJROOT)/xattr_tests.o
44 xnu_quick_test : $(OBJROOT) $(DSTROOT) $(MY_OBJECTS) helpers
45 sudo rm -rf $(DSTROOT)/xnu_quick_test
46 cc $(MY_ARCH) $(LIBFLAGS) -o $(DSTROOT)/xnu_quick_test $(MY_OBJECTS)
47 sudo chown root $(DSTROOT)/xnu_quick_test
48 sudo chmod 4755 $(DSTROOT)/xnu_quick_test
50 # The helper binaries are used to test exec()'ing between 64bit and 32bit.
51 # Creates test binaries with page zero sizes = 4KB and 4GB. Also creates 32-bit
52 # helper processes for the 64-bit version of xnu_quick_test to test the conversion
53 # from a 32-bit process to a 64-bit process.
54 helpers : helpers/sleep.c helpers/launch.c helpers/arch.c helperdir $(OBJROOT)/misc.o
55 gcc -arch ppc helpers/sleep.c -o $(DSTROOT)/helpers/sleep-ppc32
56 gcc -arch i386 helpers/sleep.c -o $(DSTROOT)/helpers/sleep-i386
57 gcc -arch x86_64 -pagezero_size 0x100000000 helpers/sleep.c -o $(DSTROOT)/helpers/sleep-x86_64-4G
58 gcc -arch x86_64 -pagezero_size 0x1000 helpers/sleep.c -o $(DSTROOT)/helpers/sleep-x86_64-4K
59 gcc -arch ppc64 -pagezero_size 0x100000000 helpers/sleep.c -o $(DSTROOT)/helpers/sleep-ppc64-4G
60 gcc -arch ppc64 -pagezero_size 0x1000 helpers/sleep.c -o $(DSTROOT)/helpers/sleep-ppc64-4K
61 gcc $(LIBFLAGS) -arch i386 $(OBJROOT)/misc.o helpers/launch.c -o $(DSTROOT)/helpers/launch-i386
62 gcc $(LIBFLAGS) -arch x86_64 $(OBJROOT)/misc.o helpers/launch.c -o $(DSTROOT)/helpers/launch-x86_64
63 gcc $(LIBFLAGS) -arch ppc $(OBJROOT)/misc.o helpers/launch.c -o $(DSTROOT)/helpers/launch-ppc
64 gcc $(LIBFLAGS) -arch ppc64 $(OBJROOT)/misc.o helpers/launch.c -o $(DSTROOT)/helpers/launch-ppc64
65 gcc -arch ppc -arch ppc64 -arch i386 -arch x86_64 helpers/arch.c -o $(DSTROOT)/helpers/arch
68 mkdir -p $(DSTROOT)/helpers
76 INCLUDES = /Developer/SDKs/Purple/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/
79 $(OBJROOT)/main.o : main.c tests.h
80 cc $(CFLAGS) -c main.c -o $@
82 $(OBJROOT)/memory_tests.o : memory_tests.c tests.h
83 cc $(CFLAGS) -c memory_tests.c -o $@
85 # misc.o has to be built 4-way for the helpers to link
86 $(OBJROOT)/misc.o : misc.c tests.h
87 cc -arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS) -c misc.c -o $@
89 $(OBJROOT)/sema_tests.o : sema_tests.c tests.h
90 cc $(CFLAGS) -c sema_tests.c -o $@
92 $(OBJROOT)/shared_memory_tests.o : shared_memory_tests.c tests.h
93 cc $(CFLAGS) -c shared_memory_tests.c -o $@
95 $(OBJROOT)/socket_tests.o : socket_tests.c tests.h
96 cc $(CFLAGS) -c socket_tests.c -o $@
98 $(OBJROOT)/tests.o : tests.c tests.h
99 cc $(CFLAGS) -c tests.c -o $@
101 $(OBJROOT)/xattr_tests.o : xattr_tests.c tests.h
102 cc $(CFLAGS) -c xattr_tests.c -o $@
108 sudo rm -f $(DSTROOT)/xnu_quick_test
109 sudo rm -f $(DSTROOT)/helpers/*