-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile.template
42 lines (32 loc) · 1.13 KB
/
makefile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
HOOK= {{ leakname }}
PROVIDER= {{ leakname }}.provider
SCRIPT= {{ leakname }}.lldb
PLATFORM_NAME = iPhoneSimulator
ARCH = i386
SDK_VERSION = 7.0
XCODE = /Applications/Xcode.app
SDK_NAME = $(PLATFORM_NAME)$(SDK_VERSION)
PLAT = $(XCODE)/Contents/Developer/Platforms/$(PLATFORM_NAME).platform
SDK = /Developer/SDKs/$(SDK_NAME).sdk
TOOLCHAIN = $(XCODE)/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
OCAMLBINDIR = $(OCAMLDIR)/bin/
CC = $(TOOLCHAIN)/usr/bin/clang
OBJCFLAGS = -arch i386 -fobjc-link-runtime -Xlinker -no_implicit_dylibs \
-mios-simulator-version-min=$(SDK_VERSION) \
-Xlinker -objc_abi_version -Xlinker 2 -ObjC -Wl,-no_compact_unwind \
-Wl,-objc_abi_version,2 -Wl,-no_pie \
-isysroot $(PLAT)$(SDK)
$(HOOK).dylib: $(HOOK).m $(PROVIDER).h
$(CC) $(OBJCFLAGS) -shared -flat_namespace $< -o $@
$(PROVIDER).h: $(PROVIDER).d
dtrace -h -s $<
clean:
rm -f $(HOOK).dylib $(PROVIDER).h
apply:
@test "$(PID)" -ge 1 2>/dev/null || (echo error: specify PID=; false)
cat $(SCRIPT) | lldb-run $(PID) # lldb-run is in https://github.com/proger/darwinkit
sudo dtrace -m $(HOOK).dylib -l
.PHONY: clean apply
{#
# vim: ft=jinja
#}