code += JavaScriptCore.o Library.o
filters := C
-ldid := echo
+ldid := true
dll := so
apr := $(shell apr-1-config --link-ld)
-library := $(apr) -lffi
+library := $(apr) -lffi -liconv
console := $(apr) -lreadline
depends :=
-include $(uname_s).mk
-include $(uname_s)-$(uname_p).mk
-flags += -g3 -O0 -DYYDEBUG=1
-#flags += -g0 -O3
-flags += -Wall -Werror -Wno-parentheses
+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)
echo '})'; \
} >$@
-Cycript.y: Cycript.y.in
+%.y: %.y.in
+ ./Filter.sh <$< >$@ $(filters)
+
+%.l: %.l.in
./Filter.sh <$< >$@ $(filters)
Cycript.tab.cc Cycript.tab.hh location.hh position.hh: Cycript.y
%.o: sig/%.cpp
$(target)g++ $(flags) -c -o $@ $<
-Cycript.tab.o: Cycript.tab.cc Cycript.tab.hh Parser.hpp Pooling.hpp
+Cycript.tab.o: Cycript.tab.cc $(header)
$(target)g++ $(flags) -c -o $@ $<
-lex.cy.o: lex.cy.c Cycript.tab.hh Parser.hpp Pooling.hpp
+lex.cy.o: lex.cy.c $(header)
$(target)g++ $(flags) -c -o $@ $<
%.o: %.cpp $(header)
$(target)g++ $(flags) -c -o $@ $<
+#objc := -x c++
%.o: %.mm $(header)
- $(target)g++ $(flags) -c -o $@ $< $(objc)
+ $(target)g++ $(objc) $(flags) -c -o $@ $<
libcycript.$(dll): $(code)
$(target)g++ $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link)
- $(ldid) -S $@
+ $(ldid) $@
cycript: Console.o libcycript.$(dll)
$(target)g++ $(flags) -o $@ $(filter %.o,$^) -L. -lcycript $(console) $(link)
- $(ldid) -S cycript
+ $(ldid) cycript
package: $(deb)