1 # Cycript - Optimizing JavaScript Compiler/Runtime
2 # Copyright (C) 2009-2014 Jay Freeman (saurik)
4 # GNU Affero General Public License, Version 3 {{{
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 AUTOMAKE_OPTIONS = subdir-objects
26 ACLOCAL_AMFLAGS = -I m4
28 AM_CPPFLAGS = -DYYDEBUG=1
29 AM_CPPFLAGS += -include config.h -include $(srcdir)/unconfig.h
31 CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
35 lib_LTLIBRARIES += libcycript.la
36 libcycript_la_LDFLAGS = $(CY_LDFLAGS)
37 libcycript_la_LIBADD = $(LTLIBFFI) $(LTLIBGCC) -ldl
39 libcycript_la_SOURCES = ConvertUTF.c Decode.cpp Driver.cpp Highlight.cpp Library.cpp Network.cpp Output.cpp Parser.cpp Replace.cpp
40 libcycript_la_SOURCES += Cycript.tab.cc lex.cy.cpp
45 bin_PROGRAMS = cycript
46 cycript_SOURCES = Console.cpp Display.cpp
47 cycript_LDADD = libcycript.la $(LTLIBREADLINE) $(LTLIBTERMCAP) $(LTLIBGCC) $(PTHREAD_CFLAGS) -ldl
51 libcycript_la_SOURCES += sig/ffi_type.cpp sig/parse.cpp sig/copy.cpp
52 libcycript_la_SOURCES += Bridge.cpp Execute.cpp JavaScriptCore.cpp
53 libcycript_la_LIBADD += $(LTJAVASCRIPTCORE)
55 AM_CPPFLAGS += -DCY_EXECUTE
60 CLEANFILES += Bridge.gperf
61 Bridge.gperf: Bridge.def Bridge.sh
62 $(srcdir)/Bridge.sh $< >$@
64 CLEANFILES += Bridge.hpp
65 Bridge.hpp: Bridge.gperf
66 $(GPERF) $< | $(SED) -e 's/defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__/0/' >$@
71 libcycript_la_SOURCES += Java/Execute.cpp
72 libcycript_la_LIBADD += $(LTJAVA)
77 libcycript_la_SOURCES += ObjectiveC/Output.cpp ObjectiveC/Replace.cpp ObjectiveC/Library.mm
78 libcycript_la_LIBADD += $(LTOBJECTIVEC)
82 libcycript_la_SOURCES += Handler.cpp
85 cycript_SOURCES += Inject.cpp
86 AM_CPPFLAGS += -DCY_ATTACH
90 CLEANFILES += Cycript.yy
91 Cycript.yy: Cycript.yy.in
92 $(srcdir)/Filter.sh <$< >$@ $(filters)
94 CLEANFILES += Cycript.l
95 Cycript.l: Cycript.l.in
96 $(srcdir)/Filter.sh <$< >$@ $(filters)
98 CLEANFILES += lex.cy.cpp
100 $(FLEX) -t $< | $(SED) -e 's/int yyl;/yy_size_t yyl;/;s/int yyleng_r;/yy_size_t yyleng_r;/' >$@
102 Console.$(OBJEXT) Cycript.tab.lo Driver.lo Handler.lo Highlight.lo Library.lo lex.cy.lo: Cycript.tab.hh
104 CLEANFILES += Cycript.tab.cc Cycript.tab.hh stack.hh Cycript.output
105 Cycript.tab.cc Cycript.tab.hh stack.hh Cycript.output: Cycript.yy
106 $(BISON) -v --report=state $<
107 ! grep -n '^State [0-9]* conflicts:' Cycript.output
108 ! grep -n '^ *$$default reduce using rule [0-9]* (Lex[A-Z][^)]*)$$' Cycript.output -B 2 | grep 'shift, and go to state [0-9]*$$'
109 ! grep -n '^ *$$default reduce using rule [0-9]* (Lex[A-Z][^)]*)$$' Cycript.output -B 2 | grep -v '$$default' | grep 'reduce using rule [0-9]* ([^)]*)$$'