summaryrefslogtreecommitdiffstats
path: root/src/extension/script/Makefile.tmp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-01-16 02:36:01 +0000
committermental <mental@users.sourceforge.net>2006-01-16 02:36:01 +0000
commit179fa413b047bede6e32109e2ce82437c5fb8d34 (patch)
treea5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/extension/script/Makefile.tmp
downloadinkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz
inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/extension/script/Makefile.tmp')
-rw-r--r--src/extension/script/Makefile.tmp89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/extension/script/Makefile.tmp b/src/extension/script/Makefile.tmp
new file mode 100644
index 000000000..a952f2ba3
--- /dev/null
+++ b/src/extension/script/Makefile.tmp
@@ -0,0 +1,89 @@
+#############################################
+# Makefile for testing embedding
+#
+# This temporary makefile is for designing
+# and testing a generic structure for embedding
+# interpreters in Inkscape, and binding back
+# from them into the Inkscape internals. This
+# would allow users to automate some Inkscape
+# functionality.
+#############################################
+
+CXX = g++
+
+WRAPS = \
+inkscape_py_wrap.o \
+inkscape_perl_wrap.o
+
+OBJ = \
+InkscapeScript.o \
+InkscapeInterpreter.o \
+InkscapeBinding.o \
+InkscapePython.o \
+InkscapePerl.o \
+$(WRAPS)
+
+#########################################################
+# NOTE that we are using the interpreters themselves, to
+# discover the settings for compiling and linking
+#########################################################
+
+PERL_CFLAGS := $(shell perl -MExtUtils::Embed -e ccopts )
+PERL_LDFLAGS := $(shell perl -MExtUtils::Embed -e ldopts )
+
+#INCLUDEPY, LIBPL, LIBRARY
+PYTHON_CFLAGS := -I$(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('INCLUDEPY')" )
+PYTHON_LDPATH := $(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('LIBPL')" )
+PYTHON_LIB := $(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('LIBRARY')" )
+PYTHON_LDFLAGS = $(PYTHON_LDPATH)/$(PYTHON_LIB)
+#PYTHON_LDFLAGS = $(PYTHON_LDPATH)
+
+GLIB_INC := $(shell pkg-config --cflags glib-2.0)
+GLIB_LIB := $(shell pkg-config --libs glib-2.0)
+
+INC = -I. -I../.. $(GLIB_INC)
+
+CFLAGS = -g $(PYTHON_CFLAGS) $(PERL_CFLAGS)
+CXXFLAGS = $(CFLAGS)
+
+LIBS = $(PYTHON_LDFLAGS) $(PERL_LDFLAGS) $(GLIB_LIB)
+
+all: bindtest cpptest
+
+wraps: $(WRAPS)
+
+bindtest: bindtest.o $(OBJ)
+ $(CXX) -o $@ bindtest.o $(OBJ) $(LIBS)
+
+cpptest: cpptest.o $(OBJ)
+ $(CXX) -o $@ cpptest.o $(OBJ) $(LIBS)
+
+
+#_inkscape_py.so : inkscape_py_wrap.o $(OBJ)
+# $(CXX) -shared -o _inkscape_py.so $(OBJ)
+
+inkscape_py_wrap.cpp: InkscapeBinding.h inkscape_py.i
+ swig -c++ -python -o inkscape_py_wrap.cpp inkscape_py.i
+ perl quotefile.pl inkscape_py.py inkscape_py.py.h
+
+InkscapePython.o: InkscapePython.cpp InkscapePython.h inkscape_py_wrap.o
+ $(CXX) $(CXXFLAGS) $(INC) $(PYINC) -o $@ -c InkscapePython.cpp
+
+inkscape_perl_wrap.cpp: InkscapeBinding.h inkscape_perl.i
+ swig -c++ -perl5 -static -o inkscape_perl_wrap.cpp inkscape_perl.i
+ perl quotefile.pl inkscape_perl.pm inkscape_perl.pm.h
+
+InkscapePerl.o: InkscapePerl.cpp InkscapePerl.h inkscape_perl_wrap.o
+ $(CXX) $(CXXFLAGS) $(INC) $(PERLINC) -o $@ -c InkscapePerl.cpp
+
+.cpp.o:
+ $(CXX) $(CXXFLAGS) $(INC) -o $@ -c $<
+
+clean:
+ -$(RM) bindtest
+ -$(RM) cpptest
+ -$(RM) *.o
+ -$(RM) *.so
+ -$(RM) *.pyc
+
+