1
#############################################
2
# Makefile for testing embedding
4
# This temporary makefile is for designing
5
# and testing a generic structure for embedding
6
# interpreters in Inkscape, and binding back
7
# from them into the Inkscape internals. This
8
# would allow users to automate some Inkscape
10
#############################################
20
InkscapeInterpreter.o \
26
#########################################################
27
# NOTE that we are using the interpreters themselves, to
28
# discover the settings for compiling and linking
29
#########################################################
31
PERL_CFLAGS := $(shell perl -MExtUtils::Embed -e ccopts )
32
PERL_LDFLAGS := $(shell perl -MExtUtils::Embed -e ldopts )
34
#INCLUDEPY, LIBPL, LIBRARY
35
PYTHON_CFLAGS := -I$(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('INCLUDEPY')" )
36
PYTHON_LDPATH := $(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('LIBPL')" )
37
PYTHON_LIB := $(shell python -c "import distutils.sysconfig ; print distutils.sysconfig.get_config_var('LIBRARY')" )
38
PYTHON_LDFLAGS = $(PYTHON_LDPATH)/$(PYTHON_LIB)
39
#PYTHON_LDFLAGS = $(PYTHON_LDPATH)
41
GLIB_INC := $(shell pkg-config --cflags glib-2.0)
42
GLIB_LIB := $(shell pkg-config --libs glib-2.0)
44
INC = -I. -I../.. $(GLIB_INC)
46
CFLAGS = -g $(PYTHON_CFLAGS) $(PERL_CFLAGS)
49
LIBS = $(PYTHON_LDFLAGS) $(PERL_LDFLAGS) $(GLIB_LIB)
55
bindtest: bindtest.o $(OBJ)
56
$(CXX) -o $@ bindtest.o $(OBJ) $(LIBS)
58
cpptest: cpptest.o $(OBJ)
59
$(CXX) -o $@ cpptest.o $(OBJ) $(LIBS)
62
#_inkscape_py.so : inkscape_py_wrap.o $(OBJ)
63
# $(CXX) -shared -o _inkscape_py.so $(OBJ)
65
inkscape_py_wrap.cpp: InkscapeBinding.h inkscape_py.i
66
swig -c++ -python -o inkscape_py_wrap.cpp inkscape_py.i
67
perl quotefile.pl inkscape_py.py inkscape_py.py.h
69
InkscapePython.o: InkscapePython.cpp InkscapePython.h inkscape_py_wrap.o
70
$(CXX) $(CXXFLAGS) $(INC) $(PYINC) -o $@ -c InkscapePython.cpp
72
inkscape_perl_wrap.cpp: InkscapeBinding.h inkscape_perl.i
73
swig -c++ -perl5 -static -o inkscape_perl_wrap.cpp inkscape_perl.i
74
perl quotefile.pl inkscape_perl.pm inkscape_perl.pm.h
76
InkscapePerl.o: InkscapePerl.cpp InkscapePerl.h inkscape_perl_wrap.o
77
$(CXX) $(CXXFLAGS) $(INC) $(PERLINC) -o $@ -c InkscapePerl.cpp
80
$(CXX) $(CXXFLAGS) $(INC) -o $@ -c $<