X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/b112996a4bb584811bbdd2156a068f6024a59bed..dd221c6b84e9b15478b32cc0b4ed23eb74603bbb:/GNUmakefile.in diff --git a/GNUmakefile.in b/GNUmakefile.in index 1e2628c..b193e8f 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -15,13 +15,13 @@ flex := @FLEX@ libtool := @LIBTOOL@ cxx := @CXX@ objcxx := @OBJCXX@ -cflags := @CPPFLAGS@ @CXXFLAGS@ -DYYDEBUG=1 @DEFS@ +cflags := @CPPFLAGS@ @CXXFLAGS@ -DYYDEBUG=1 $(filter -DHAVE_FFI% -DHAVE_READLINE% -DHAVE_HISTORY_H,@DEFS@) objcxxflags := @OBJCXXFLAGS@ ldflags := @LDFLAGS@ library := @LIBS@ @LTLIBAPR@ @LTLIBICONV@ sed := @SED@ bison := @BISON@ -time := $(shell which @TIME@) +time := @TIME@ gperf := @GPERF@ otool := @OTOOL@ @@ -56,18 +56,31 @@ CY_EXECUTE := @CY_EXECUTE@ CY_OBJECTIVEC := @CY_OBJECTIVEC@ CY_OBJECTIVEC_MACH := @CY_OBJECTIVEC_MACH@ +svn := @SVN@ +svnversion := @SVNVERSION@ + +ifneq ($(svnversion),) +release := $(shell svnversion $(srcdir)) + +ifneq ($(release),exported) +gnutar := @GNUTAR@ +version := @PACKAGE_VERSION@.$(release) +tarname := @PACKAGE_TARNAME@-$(version) +endif +endif + paths := $(foreach path,$(paths),$(wildcard $(path))) cflags += $(foreach path,$(paths),-I$(path) -L$(path)) -svn := $(shell svnversion $(srcdir)) +#svn := $(shell svnversion $(srcdir)) all: all := cycript -dpkg_architecture := $(shell which dpkg-architecture 2>/dev/null) -ifneq ($(dpkg_architecture),) -arch := $(shell $(dpkg_architecture) -qDEB_HOST_ARCH 2>/dev/null) -endif +#dpkg_architecture := $(shell which dpkg-architecture 2>/dev/null) +#ifneq ($(dpkg_architecture),) +#arch := $(shell $(dpkg_architecture) -qDEB_HOST_ARCH 2>/dev/null) +#endif header := Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp Internal.hpp Error.hpp String.hpp Exception.hpp Standard.hpp @@ -95,6 +108,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 @@ -169,20 +183,21 @@ inject += Mach/Inject.lo Mach/Inject.lo: Trampoline.t.hpp Baton.hpp %.t.hpp: %.t.cpp - $(libtool) --mode=compile $(cxx) -c -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 + # LC_SEGMENT_64 + $(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 endif endif all: $(all) clean:: - rm -rf *.lo *.o *.d *.t.hpp .libs */*.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 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 ifneq ($(srcdir),.) - rm -rf sig ObjectiveC + rm -rf Mach ObjectiveC sig endif distclean: clean - rm -f GNUmakefile config.log config.status libtool + rm -f GNUmakefile Makefile config.log config.status libtool %.yy: %.yy.in $(srcdir)/Filter.sh <$< >$@ $(filters) @@ -226,6 +241,12 @@ test: cycript if [[ -e jquery.js ]]; then $(time) ./cycript -c jquery.js >jquery.cyc.js; gzip -9c jquery.cyc.js >jquery.cyc.js.gz; wc -c jquery.{mam,gcc,cyc,bak,yui}.js; wc -c jquery.{cyc,gcc,bak,mam,yui}.js.gz; fi if [[ -e test.cy ]]; then ./cycript test.cy; fi +ifneq ($(gnutar),:) +dist: + echo -n >> $(tarname).tar.gz + $(gnutar) -cC $(srcdir) -f $(tarname).tar.gz -vX <($(svn) propget svn:ignore $(srcdir)) -z --exclude-vcs --show-transformed-names --transform='s#^\.#$(tarname)#' . +endif + install: cycript libcycript.la $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(libtool) --mode=install $(INSTALL_PROGRAM) libcycript.la $(DESTDIR)$(libdir)/libcycript.la @@ -235,4 +256,4 @@ uninstall: $(libtool) --mode=uninstall rm -f $(DESTDIR)$(bindir)/cycript $(libtool) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libcycript.la -.PHONY: all clean extra install uninstall package test control.tmp +.PHONY: all clean extra dist install uninstall package test control.tmp