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