-clean:
- rm -f $(name).dylib
-
-libcyrver.plist: Bridge.def makefile
- sed -e 's/^C/0/;s/^F/1/;s/^V/2/' Bridge.def | while read -r line; do \
- if [[ $$line == '' ]]; then \
- continue; \
- fi; \
- set $$line; \
- if [[ $$1 =~ [#fl] ]]; then \
- continue; \
- fi; \
- echo "$$2 = ($$1, \"$$3\");"; \
- done >$@
-
-Struct.hpp:
- $$($(target)gcc -print-prog-name=cc1obj) -print-objc-runtime-info </dev/null >$@
-
-$(name).dylib: Tweak.mm makefile $(menes)/mobilesubstrate/substrate.h sig/*.[ch]pp Struct.hpp
- $(target)g++ -save-temps -dynamiclib -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.cpp,$^) $(filter %.mm,$^) -lobjc -I$(menes)/mobilesubstrate $(link) $(flags)
- ldid -S $@
-
-package: all
+header := Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp
+code := ffi_type.o parse.o
+code += Replace.o Output.o
+code += Cycript.tab.o lex.cy.o
+code += Network.o Parser.o
+code += JavaScriptCore.o Library.o
+
+filters := C
+ldid := true
+dll := so
+apr := $(shell apr-1-config --link-ld)
+library := $(apr) -lffi -liconv
+console := $(apr) -lreadline
+depends :=
+
+uname_s := $(shell uname -s)
+uname_p := $(shell uname -p)
+-include $(uname_s).mk
+-include $(uname_s)-$(uname_p).mk
+
+ifeq ($(filter ObjectiveC,$(filters)),)
+ifneq ($(shell which gnustep-config 2>/dev/null),)
+include GNUstep.mk
+endif
+endif
+
+#flags += -g3 -O0 -DYYDEBUG=1
+flags += -g0 -O3
+flags += -Wall -Werror -Wno-parentheses #-Wno-unused
+flags += -fPIC -fno-common
+flags += -I. -I$(shell apr-1-config --includedir)
+
+all += libcycript.$(dll)
+
+ifdef arch
+deb := $(shell grep ^Package: control | cut -d ' ' -f 2-)_$(shell grep ^Version: control | cut -d ' ' -f 2 | sed -e 's/\#/$(svn)/')_$(arch).deb
+
+all: $(deb)
+
+extra:
+
+$(deb): $(all)