X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/6f382d8d0a78a8856c549c86746d61e030e9fe10..06293152b6505062453463ef34c0d90e0c8db17e:/GNUmakefile.in diff --git a/GNUmakefile.in b/GNUmakefile.in index c380435..5b390ea 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -23,7 +23,9 @@ sed := @SED@ bison := @BISON@ time := @TIME@ gperf := @GPERF@ -otool := @OTOOL@ +otool := @_OTOOL@ +lipo := @_LIPO@ +nm := @_NM@ INSTALL := @INSTALL@ INSTALL_PROGRAM := @INSTALL_PROGRAM@ @@ -55,6 +57,7 @@ mandir := @mandir@ CY_EXECUTE := @CY_EXECUTE@ CY_OBJECTIVEC := @CY_OBJECTIVEC@ CY_OBJECTIVEC_MACH := @CY_OBJECTIVEC_MACH@ +CY_ATTACH_GROUP := @CY_ATTACH_GROUP@ svn := @SVN@ svnversion := @SVNVERSION@ @@ -96,7 +99,7 @@ filters := #E4X ldid := true entitle := $(ldid) lib := lib -dll := so +dll := @SO@ depends := restart ?= $(MAKE) @@ -108,6 +111,7 @@ cflags += -DCY_EXECUTE code += sig/ffi_type.lo sig/parse.lo sig/copy.lo code += Execute.lo Bridge.lo filters += C +header += JavaScript.hpp endif cflags += -Wall -Werror -Wno-parentheses #-Wno-unused @@ -176,20 +180,20 @@ Struct.hpp: ifeq ($(CY_OBJECTIVEC_MACH),1) code += Handler.lo -cflags += -DCY_ATTACH +cflags += -DCY_ATTACH -DCY_LIBRARY='"$(libdir)/libcycript.$(dll)"' inject += Mach/Inject.lo Mach/Inject.lo: Trampoline.t.hpp Baton.hpp -%.t.hpp: %.t.cpp - $(libtool) --mode=compile $(cxx) -c -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o $*.t.lo $< $(cflags) && { file=($$($(otool) -l .libs/$*.t.o | $(sed) -e 'x; /^1/ { x; /^ *filesize / { s/^.* //; p; }; /^ *fileoff / { s/^.* //; p; }; x; }; x; /^ *cmd LC_SEGMENT$$/ { s/.*/1/; x; }; d;')); od -t x1 -j $${file[0]} -N $${file[1]} .libs/$*.t.o | $(sed) -e 's/^[^ ]*//' | tr $$'\n' ' ' | $(sed) -e 's/ */ /g;s/^ *//;s/ $$//;s/ /,/g;s/\([^,][^,]\)/0x\1/g' | $(sed) -e 's/^/static const char $*_[] = {/;s/$$/};/' && echo && echo "/*" && $(otool) -vVt .libs/$*.t.o && echo "*/"; } >$@ && rm -f $*.t.lo .libs/$*.t.o +%.t.hpp: %.t.cpp trampoline.sh Baton.hpp Trampoline.hpp + $(srcdir)/trampoline.sh $@ .libs/lib$*.t.$(dll) $* $(sed) $(otool) $(lipo) $(nm) $(libtool) --mode=link $(cxx) -c -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o lib$*.t.la $< $(cflags) -rpath $(libdir) endif endif all: $(all) clean:: - rm -rf *.lo *.o *.d *.t.hpp .libs */*.d */*.lo */.libs libcycript.la $(all) Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver Cycript.yy Cycript.l control Bridge.gperf Bridge.hpp Cycript.output + rm -rf *.lo *.o *.d *.t.hpp .libs */*.d */*.lo */.libs lib*.la $(all) Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver Cycript.yy Cycript.l control Bridge.gperf Bridge.hpp Cycript.output ifneq ($(srcdir),.) rm -rf Mach ObjectiveC sig endif @@ -249,6 +253,10 @@ install: cycript libcycript.la $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(libtool) --mode=install $(INSTALL_PROGRAM) libcycript.la $(DESTDIR)$(libdir)/libcycript.la $(libtool) --mode=install $(INSTALL_PROGRAM) cycript $(DESTDIR)$(bindir)/cycript +ifneq ($(CY_ATTACH_GROUP),) + chgrp $(CY_ATTACH_GROUP) $(DESTDIR)$(bindir)/cycript + chmod g+s $(DESTDIR)$(bindir)/cycript +endif uninstall: $(libtool) --mode=uninstall rm -f $(DESTDIR)$(bindir)/cycript