]> git.saurik.com Git - cycript.git/blobdiff - Darwin.mk
Generalized fix for injector.
[cycript.git] / Darwin.mk
index 1a2a9db5addda77642a8c676c91af297f69265c3..3db42ea65a1fd143ec0093312c159699d352a284 100644 (file)
--- a/Darwin.mk
+++ b/Darwin.mk
@@ -1,6 +1,31 @@
+prefix := /sw
+
 dll := dylib
+link += -lobjc -framework CoreFoundation
+console += -framework Foundation
+library += -install_name $(prefix)/lib/libcycript.$(dll)
+library += -framework Foundation
+console += -framework JavaScriptCore
+# XXX: do I just need WebCore?
+console += -framework WebKit
+library += -undefined dynamic_lookup
+library += -liconv
+flags += -I/usr/include/ffi
+apr_config := /usr/bin/apr-1-config
+flags += -arch i386 -arch x86_64 #-arch armv6
+
+flags += -mmacosx-version-min=10.5
+
+flags += -DCY_ATTACH -DCY_LIBRARY='"$(prefix)/lib/libcycript.dylib"'
+code += Handler.o
+inject += Mach/Inject.o
+Mach/Inject.o: Trampoline.t.hpp Baton.hpp
+
+%.t.hpp: %.t.cpp trampoline.sh Baton.hpp Trampoline.hpp Darwin.mk
+       ./trampoline.sh $@ $*.t.dylib $* sed $(target){otool,lipo,nm,gcc} $(flags) -dynamiclib -g0 -fno-stack-protector -fno-exceptions -Iinclude $< -o $*.t.dylib
 
-header += Struct.hpp
+clean::
+       rm -f Trampoline.t.hpp
 
-Struct.hpp:
-       $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@
+include Execute.mk
+include ObjectiveC.mk