Code

r11512@tres: ted | 2006-04-24 21:36:08 -0700
[inkscape.git] / src / extension / script / Makefile.tmp
1 #############################################
2 # Makefile for testing embedding
3 #
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
9 # functionality.
10 #############################################
12 CXX = g++
14 WRAPS = \
15 inkscape_py_wrap.o \
16 inkscape_perl_wrap.o
18 OBJ = \
19 InkscapeScript.o \
20 InkscapeInterpreter.o \
21 InkscapeBinding.o \
22 InkscapePython.o  \
23 InkscapePerl.o \
24 $(WRAPS)
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)
47 CXXFLAGS = $(CFLAGS)
49 LIBS = $(PYTHON_LDFLAGS) $(PERL_LDFLAGS) $(GLIB_LIB)
51 all: bindtest cpptest
53 wraps: $(WRAPS)
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)
64         
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
68         
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
75         
76 InkscapePerl.o: InkscapePerl.cpp InkscapePerl.h inkscape_perl_wrap.o
77         $(CXX) $(CXXFLAGS) $(INC) $(PERLINC) -o $@ -c InkscapePerl.cpp
79 .cpp.o:
80         $(CXX) $(CXXFLAGS) $(INC) -o $@ -c $<
82 clean:
83         -$(RM) bindtest
84         -$(RM) cpptest
85         -$(RM) *.o
86         -$(RM) *.so
87         -$(RM) *.pyc
89