target := $(PKG_TARG)-
endif
+prefix := /usr
+
gcc := g++
flags ?= -g3 -O0 -DYYDEBUG=1
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
+header := Cycript.tab.hh Parser.hpp Pooling.hpp List.hpp Local.hpp cycript.hpp Internal.hpp Error.hpp String.hpp Exception.hpp Standard.hpp
code :=
code += Replace.o Output.o
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)
rm -rf package
mkdir -p package/DEBIAN
cp -pR control package/DEBIAN
- mkdir -p package/usr/{bin,lib,sbin}
+ mkdir -p package$(prefix)/{bin,lib,sbin}
$(restart) extra
- cp -pR $(lib)cycript.$(dll) package/usr/lib
- cp -pR cycript package/usr/bin
- #cp -pR cyrver package/usr/sbin
+ cp -pR $(lib)cycript.$(dll) package$(prefix)/lib
+ cp -pR cycript package$(prefix)/bin
+ #cp -pR cyrver package$(prefix)/sbin
dpkg-deb -b package $(deb)
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)
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 test.cy ]]; then cycript test.cy; fi
install: cycript $(lib)cycript.$(dll)
- cp -p cycript /usr/bin
- cp -p $(lib)cycript.$(dll) /usr/lib
+ sudo cp -p cycript /usr/bin
+ sudo cp -p $(lib)cycript.$(dll) /usr/lib
+ sudo chgrp procmod /usr/bin/cycript
+ sudo chmod g+s /usr/bin/cycript
+
+uninstall:
+ sudo rm -f /usr/bin/cycript /usr/lib/libcycript.dylib
.PHONY: all clean extra package control.tmp