Update makefile to have Local.hpp.
[cycript.git] / GNUmakefile.in
index e6d2ee380f01c23e58573b72d065df495a115c13..a99274702f3e41c42f54e1182ed1a1d1e021a97c 100644 (file)
@@ -23,7 +23,9 @@ sed := @SED@
 bison := @BISON@
 time := @TIME@
 gperf := @GPERF@
-otool := @OTOOL@
+otool := @_OTOOL@
+lipo := @_LIPO@
+nm := @_NM@
 
 INSTALL := @INSTALL@
 INSTALL_PROGRAM := @INSTALL_PROGRAM@
@@ -55,6 +57,7 @@ mandir := @mandir@
 CY_EXECUTE := @CY_EXECUTE@
 CY_OBJECTIVEC := @CY_OBJECTIVEC@
 CY_OBJECTIVEC_MACH := @CY_OBJECTIVEC_MACH@
+CY_ATTACH_GROUP := @CY_ATTACH_GROUP@
 
 svn := @SVN@
 svnversion := @SVNVERSION@
@@ -82,7 +85,7 @@ all := cycript
 #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 Local.hpp cycript.hpp Internal.hpp Error.hpp String.hpp Exception.hpp Standard.hpp
 
 code := 
 code += Replace.lo Output.lo
@@ -96,7 +99,7 @@ filters := #E4X
 ldid := true
 entitle := $(ldid)
 lib := lib
-dll := so
+dll := @SO@
 depends :=
 
 restart ?= $(MAKE)
@@ -177,21 +180,20 @@ Struct.hpp:
 
 ifeq ($(CY_OBJECTIVEC_MACH),1)
 code += Handler.lo
-cflags += -DCY_ATTACH
+cflags += -DCY_ATTACH -DCY_LIBRARY='"$(libdir)/libcycript.$(dll)"'
 inject += Mach/Inject.lo
 
 Mach/Inject.lo: Trampoline.t.hpp Baton.hpp
 
 %.t.hpp: %.t.cpp trampoline.sh Baton.hpp Trampoline.hpp
-       # DOUG: abstract "lipo" and "nm" with configure?
-       ./trampoline.sh $@ .libs/lib$*.t.dylib $* $(sed) $(otool) lipo nm $(libtool) --mode=compile $(cxx) -dynamiclib -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o lib$*.t.la $< $(cflags)
+       $(srcdir)/trampoline.sh $@ .libs/lib$*.t.$(dll) $* $(sed) $(otool) $(lipo) $(nm) $(libtool) --mode=link $(cxx) -c -fno-stack-protector -fno-exceptions -I$(srcdir)/include -o lib$*.t.la $< $(cflags) -rpath $(libdir)
 endif
 endif
 
 all: $(all)
 
 clean::
-       rm -rf *.lo *.o *.d *.t.hpp .libs */*.d */*.lo */.libs libcycript.la $(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.gperf Bridge.hpp Cycript.output
+       rm -rf *.lo *.o *.d *.t.hpp .libs */*.d */*.lo */.libs lib*.la $(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.gperf Bridge.hpp Cycript.output
 ifneq ($(srcdir),.)
        rm -rf Mach ObjectiveC sig
 endif
@@ -251,6 +253,10 @@ install: cycript libcycript.la
        $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir)
        $(libtool) --mode=install $(INSTALL_PROGRAM) libcycript.la $(DESTDIR)$(libdir)/libcycript.la
        $(libtool) --mode=install $(INSTALL_PROGRAM) cycript $(DESTDIR)$(bindir)/cycript
+ifneq ($(CY_ATTACH_GROUP),)
+       chgrp $(CY_ATTACH_GROUP) $(DESTDIR)$(bindir)/cycript
+       chmod g+s $(DESTDIR)$(bindir)/cycript
+endif
 
 uninstall:
        $(libtool) --mode=uninstall rm -f $(DESTDIR)$(bindir)/cycript