]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/Makefile
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tools / tests / perf_index / Makefile
1 include ../Makefile.common
2
3 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
4 CFLAGS:=-c -Wall -pedantic -Os -isysroot $(SDKROOT) $(ARCH_FLAGS)
5 CFLAGS += -Wl,-sectcreate,__INFO_FILTER,__disable,/dev/null
6 LDFLAGS:= $(ARCH_FLAGS) -isysroot $(SDKROOT)
7
8 SRCROOT?=$(shell /bin/pwd)
9 DSTROOT?=$(shell /bin/pwd)/BUILD/dst
10 OBJROOT?=$(shell /bin/pwd)/BUILD/obj
11 SYMROOT?=$(shell /bin/pwd)/BUILD/sym
12
13
14 ifeq "$(Embedded)" "YES"
15 TARGET_NAME:=PerfIndex.bundle-ios
16 else
17 TARGET_NAME:=PerfIndex.bundle-osx
18 endif
19
20 all: $(DSTROOT) $(OBJROOT) $(SYMROOT) \
21 $(DSTROOT)/perf_index \
22 $(DSTROOT)/perfindex-cpu.dylib \
23 $(DSTROOT)/perfindex-memory.dylib \
24 $(DSTROOT)/perfindex-syscall.dylib \
25 $(DSTROOT)/perfindex-fault.dylib \
26 $(DSTROOT)/perfindex-zfod.dylib \
27 $(DSTROOT)/perfindex-file_create.dylib \
28 $(DSTROOT)/perfindex-file_read.dylib \
29 $(DSTROOT)/perfindex-file_write.dylib \
30 $(DSTROOT)/perfindex-ram_file_create.dylib \
31 $(DSTROOT)/perfindex-ram_file_read.dylib \
32 $(DSTROOT)/perfindex-ram_file_write.dylib \
33 $(DSTROOT)/perfindex-iperf.dylib \
34 $(DSTROOT)/perfindex-compile.dylib \
35 $(DSTROOT)/PerfIndex.bundle
36
37 $(DSTROOT)/perfindex-cpu.dylib: $(OBJROOT)/md5.o
38 $(DSTROOT)/perfindex-fault.dylib: $(OBJROOT)/test_fault_helper.o
39 $(DSTROOT)/perfindex-zfod.dylib: $(OBJROOT)/test_fault_helper.o
40 $(DSTROOT)/perfindex-file_create.dylib: $(OBJROOT)/test_file_helper.o
41 $(DSTROOT)/perfindex-file_read.dylib: $(OBJROOT)/test_file_helper.o
42 $(DSTROOT)/perfindex-file_write.dylib: $(OBJROOT)/test_file_helper.o
43 $(DSTROOT)/perfindex-ram_file_create.dylib: $(OBJROOT)/test_file_helper.o $(OBJROOT)/ramdisk.o
44 $(DSTROOT)/perfindex-ram_file_read.dylib: $(OBJROOT)/test_file_helper.o $(OBJROOT)/ramdisk.o
45 $(DSTROOT)/perfindex-ram_file_write.dylib: $(OBJROOT)/test_file_helper.o $(OBJROOT)/ramdisk.o
46
47 $(DSTROOT)/perf_index: $(OBJROOT)/perf_index.o
48 $(CC) $(LDFLAGS) $? -o $@
49
50 $(DSTROOT)/PerfIndex.bundle: $(SRCROOT)/PerfIndex_COPS_Module/PerfIndex.xcodeproj
51 xcodebuild -sdk $(SDKROOT) -target $(TARGET_NAME) OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) TARGET_TEMP_DIR=$(OBJROOT) TARGET_BUILD_DIR=$(DSTROOT) -project $? CLANG_ENABLE_MODULES=NO
52
53 $(DSTROOT)/%.dylib: $(OBJROOT)/%.o
54 $(CC) $(LDFLAGS) -dynamiclib $? -o $@
55
56 $(OBJROOT)/%.o: $(SRCROOT)/%.c
57 $(CC) $(CFLAGS) $? -o $@
58
59 $(DSTROOT):
60 mkdir -p $(DSTROOT)
61
62 $(OBJROOT):
63 mkdir -p $(OBJROOT)
64
65 $(SYMROOT):
66 mkdir -p $(SYMROOT)
67
68 clean:
69 rm -rf $(OBJROOT)
70 rm -rf $(DSTROOT)
71 rm -rf $(SYMROOT)