1 include ../Makefile.common
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)
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
14 ifeq "$(Embedded)" "YES"
15 TARGET_NAME:=PerfIndex.bundle-ios
17 TARGET_NAME:=PerfIndex.bundle-osx
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
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
47 $(DSTROOT)/perf_index: $(OBJROOT)/perf_index.o
48 $(CC) $(LDFLAGS) $? -o $@
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
53 $(DSTROOT)/%.dylib: $(OBJROOT)/%.o
54 $(CC) $(LDFLAGS) -dynamiclib $? -o $@
56 $(OBJROOT)/%.o: $(SRCROOT)/%.c
57 $(CC) $(CFLAGS) $? -o $@