X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/4e869640036110df20ccde74fcb5a5167f28622a..1504c9b837a7561d8ae2c81f1c4d57fe0f138781:/makefile diff --git a/makefile b/makefile index 3100f0a..f939c4b 100644 --- a/makefile +++ b/makefile @@ -38,9 +38,9 @@ ldid := true entitle := $(ldid) lib := lib dll := so -apr := $(shell apr-1-config --link-ld) -library := $(apr) -console := $(apr) -lreadline +apr_config := apr-1-config +library := +console := -lreadline depends := restart ?= $(MAKE) @@ -50,6 +50,10 @@ uname_p ?= $(shell uname -p) -include $(uname_s).mk -include $(uname_s)-$(uname_p).mk +ifneq ($(shell pkg-config libffi --modversion 2>/dev/null),) +flags += $(shell pkg-config --cflags libffi) +endif + ifdef CY_EXECUTE ifeq ($(filter ObjectiveC,$(filters)),) ifneq ($(shell which gnustep-config 2>/dev/null),) @@ -58,16 +62,22 @@ endif endif endif +apr := $(shell $(apr_config) --link-ld) +library += $(apr) +console += $(apr) + flags += -Wall -Werror -Wno-parentheses #-Wno-unused flags += -fno-common -flags += -I. -Iinclude -I$(shell apr-1-config --includedir) +flags += -I. -Iinclude -I$(shell $(apr_config) --includedir) all += $(lib)cycript.$(dll) +filters += $(shell bison <(echo '%code{}%%_:') -o/dev/null 2>/dev/null && echo Bison24 || echo Bison23) + ifdef arch deb := $(shell grep ^Package: control.in | cut -d ' ' -f 2-)_$(shell grep ^Version: control.in | cut -d ' ' -f 2 | sed -e 's/\#/$(svn)/')_$(arch).deb -all: $(deb) +all: extra:: @@ -101,8 +111,8 @@ endif all: $(all) -clean: - rm -f *.o $(lib)cycript.$(dll) $(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.hpp +clean:: + rm -f *.o $(lib)cycript.$(dll) $(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.hpp Cycript.output %.yy: %.yy.in ./Filter.sh <$< >$@ $(filters) @@ -114,7 +124,7 @@ Cycript.tab.cc Cycript.tab.hh location.hh position.hh: Cycript.yy bison -v --report=state $< lex.cy.c: Cycript.l - flex $< + flex -t $< | sed -e 's/int yyl;/yy_size_t yyl;/;s/int yyleng_r;/yy_size_t yyleng_r;/' >$@ #Parser.hpp: Parser.py Parser.dat # ./Parser.py $@ @@ -148,4 +158,8 @@ test: $(deb) if [[ -e jquery.js ]]; then /usr/bin/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 +install: cycript $(lib)cycript.$(dll) + cp -p cycript /usr/bin + cp -p $(lib)cycript.$(dll) /usr/lib + .PHONY: all clean extra package control.tmp