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)
-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),)
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::
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)
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 <Parser.dat >$@
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