]>
Commit | Line | Data |
---|---|---|
a243b558 JF |
1 | SHELL = @_BASH@ |
2 | ||
3 | .DELETE_ON_ERROR: | |
4 | ||
5 | AUTOMAKE_OPTIONS = subdir-objects | |
6 | CLEANFILES = | |
7 | SUBDIRS = | |
8 | ||
9 | ACLOCAL_AMFLAGS = -I m4 | |
10 | ||
11 | # XXX: do I really need -fno-common? | |
12 | AM_CPPFLAGS = -Werror -fno-common -I$(srcdir)/include -DYYDEBUG=1 | |
13 | ||
14 | lib_LTLIBRARIES = libcycript.la | |
15 | libcycript_la_SOURCES = Highlight.cpp Network.cpp Output.cpp Parser.cpp Replace.cpp | |
812bb90b | 16 | libcycript_la_LDFLAGS = -no-undefined $(LTLIBAPR) $(LTLIBICONV) -ldl |
a243b558 JF |
17 | |
18 | libcycript_la_SOURCES += Cycript.tab.cc | |
19 | libcycript_la_SOURCES += lex.cy.cpp | |
20 | ||
21 | bin_PROGRAMS = cycript | |
22 | cycript_SOURCES = Console.cpp Display.cpp | |
6f9aea2b | 23 | cycript_LDFLAGS = $(LTLIBAPR) $(LTLIBREADLINE) $(LTLIBTERMCAP) -ldl |
a243b558 JF |
24 | cycript_LDADD = libcycript.la |
25 | ||
26 | ldid = true | |
27 | entitle = $(ldid) -Scycript.xml | |
28 | ||
9228a43a | 29 | filters = $(CY_FILTERS) |
a243b558 JF |
30 | |
31 | if CY_EXECUTE | |
32 | libcycript_la_SOURCES += sig/ffi_type.cpp sig/parse.cpp sig/copy.cpp | |
33 | libcycript_la_SOURCES += Bridge.cpp Execute.cpp JavaScriptCore.cpp Library.cpp | |
34 | ||
35 | AM_CPPFLAGS += -DCY_EXECUTE | |
36 | filters += C | |
37 | ||
38 | Bridge.lo: Bridge.hpp | |
39 | ||
40 | CLEANFILES += Bridge.gperf | |
41 | Bridge.gperf: Bridge.def Bridge.sh | |
42 | $(srcdir)/Bridge.sh $< >$@ | |
43 | ||
44 | CLEANFILES += Bridge.hpp | |
45 | Bridge.hpp: Bridge.gperf | |
46 | $(GPERF) $< | $(SED) -e 's/defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__/0/' >$@ | |
47 | endif | |
48 | ||
49 | if CY_OBJECTIVEC | |
50 | filters += ObjectiveC | |
51 | libcycript_la_SOURCES += ObjectiveC/Output.mm ObjectiveC/Replace.cpp ObjectiveC/Library.mm | |
52 | ||
53 | ObjectiveC/Library.lo: Struct.hpp | |
54 | ||
55 | # XXX: this is not architecture-specific... isn't this just totally wrong?! | |
56 | # XXX: clang doesn't support this feature... that makes me really very sad. | |
57 | CLEANFILES += Struct.hpp | |
58 | Struct.hpp: | |
59 | $$($(OBJCXX) -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@ | |
60 | endif | |
61 | ||
62 | if CY_MACH | |
63 | libcycript_la_SOURCES += Handler.mm | |
64 | cycript_SOURCES += Mach/Inject.cpp | |
65 | ||
66 | AM_CPPFLAGS += -DCY_ATTACH -DCY_LIBRARY='"$(libdir)/libcycript.$(SO)"' | |
67 | ||
68 | Mach/Inject.$(OBJEXT): Trampoline.t.hpp | |
69 | ||
70 | CLEANFILES += Trampoline.t.lo | |
9228a43a | 71 | Trampoline.t.lo: Trampoline.t.cpp Trampoline.hpp Baton.hpp Standard.hpp |
a243b558 | 72 | $(LTCXXCOMPILE) $(CY_ARCH) -c -o $@ $< -fno-stack-protector -fno-exceptions -O0 |
a243b558 JF |
73 | |
74 | CLEANFILES += libTrampoline.t.la | |
9228a43a | 75 | libTrampoline.t.la: Trampoline.t.lo |
a243b558 | 76 | $(CXXLINK) $(CY_ARCH) -rpath $(libdir) $^ |
a243b558 JF |
77 | |
78 | CLEANFILES += Trampoline.t.hpp | |
9228a43a JF |
79 | Trampoline.t.hpp: libTrampoline.t.la trampoline.sh |
80 | $(srcdir)/trampoline.sh $@ .libs/libTrampoline.t.dylib Trampoline $(SED) $(LIPO) $(NM) $(OTOOL) | |
a243b558 JF |
81 | endif |
82 | ||
83 | CLEANFILES += Cycript.yy | |
9228a43a | 84 | Cycript.yy: Cycript.yy.in |
a243b558 JF |
85 | $(srcdir)/Filter.sh <$< >$@ $(filters) |
86 | ||
87 | CLEANFILES += Cycript.l | |
9228a43a | 88 | Cycript.l: Cycript.l.in |
a243b558 JF |
89 | $(srcdir)/Filter.sh <$< >$@ $(filters) |
90 | ||
91 | CLEANFILES += lex.cy.cpp | |
92 | lex.cy.cpp: Cycript.l | |
93 | $(FLEX) -t $< | $(SED) -e 's/int yyl;/yy_size_t yyl;/;s/int yyleng_r;/yy_size_t yyleng_r;/' >$@ | |
94 | ||
95 | Highlight.lo: Cycript.tab.hh | |
96 | ||
97 | CLEANFILES += Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh Cycript.output | |
98 | Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh Cycript.output: Cycript.yy | |
99 | $(BISON) -v --report=state $< | |
100 | ! grep -n '^ *$$default reduce using rule [0-9]* (Lex[A-Z][^)]*)$$' Cycript.output -B 2 | grep 'shift, and go to state [0-9]*$$' | |
101 | ! grep -n '^ *$$default reduce using rule [0-9]* (Lex[A-Z][^)]*)$$' Cycript.output -B 2 | grep -v '$$default' | grep 'reduce using rule [0-9]* ([^)]*)$$' |