1 include ../Makefile.common
3 CC:=$(shell xcrun -sdk "$(SDKROOT)" -find cc)
4 CFLAGS:=-c -Wall -pedantic -Os -isysroot $(SDKROOT)
7 SRCROOT?=$(shell /bin/pwd)
8 DSTROOT?=$(shell /bin/pwd)/BUILD/dst
9 OBJROOT?=$(shell /bin/pwd)/BUILD/obj
10 SYMROOT?=$(shell /bin/pwd)/BUILD/sym
16 ifeq "$(Embedded)" "YES"
17 ARCHS:=armv7 armv7s arm64
24 ifeq "$(Embedded)" "YES"
25 TARGET_NAME:=PerfIndex.bundle-ios
27 TARGET_NAME:=PerfIndex.bundle-osx
30 CFLAGS += $(patsubst %, -arch %, $(ARCHS))
31 LDFLAGS += $(patsubst %, -arch %, $(ARCHS))
33 all: $(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
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
60 $(DSTROOT)/perf_index: $(OBJROOT)/perf_index.o
61 $(CC) $(LDFLAGS) $? -o $@
63 $(DSTROOT)/PerfIndex.bundle: $(SRCROOT)/PerfIndex_COPS_Module/PerfIndex.xcodeproj
64 xcodebuild -sdk $(SDKROOT) -target $(TARGET_NAME) OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) TARGET_TEMP_DIR=$(OBJROOT) TARGET_BUILD_DIR=$(DSTROOT) -project $? CLANG_ENABLE_MODULES=NO
66 $(DSTROOT)/%.dylib: $(OBJROOT)/%.o
67 $(CC) $(LDFLAGS) -dynamiclib $? -o $@
69 $(OBJROOT)/%.o: $(SRCROOT)/%.c
70 $(CC) $(CFLAGS) $? -o $@