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