16 # Windows requires Python modules to be explicitly linked to libpython.
17 # Extension modules are shared libaries (.dll), but need to be
18 # called .pyd for Python to load it as an extension module.
22 extension_ldflags += \
27 pygidir = $(pyexecdir)/gi
36 pygi_LTLIBRARIES = _gi.la
63 pygi-signal-closure.c \
64 pygi-signal-closure.h \
65 pygobject-external.h \
69 pygi-invoke-state-struct.h \
72 pygi-marshal-from-py.c \
73 pygi-marshal-from-py.h \
74 pygi-marshal-to-py.c \
75 pygi-marshal-to-py.h \
76 pygi-marshal-cleanup.c \
77 pygi-marshal-cleanup.h
81 $(extension_cppflags) \
82 -I$(top_srcdir)/gi/_glib \
83 -I$(top_srcdir)/gi/_gobject
87 $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
89 $(extension_ldflags) \
90 -export-symbols-regex "init_gi|PyInit__gi"
93 pygi_LTLIBRARIES += _gi_cairo.la
96 _gi_cairo_la_SOURCES = \
98 _gi_cairo_la_CFLAGS = \
101 _gi_cairo_la_CPPFLAGS = \
102 $(extension_cppflags) \
103 -I$(top_srcdir)/gi/_glib \
104 -I$(top_srcdir)/gi/_gobject
105 _gi_cairo_la_LIBADD = \
106 $(extension_libadd) \
109 _gi_cairo_la_LDFLAGS = \
110 $(extension_ldflags) \
111 -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
114 # This is to ensure we have a symlink to the .so in the
115 # build directory, which the Python interpreter can load
116 # directly without having to know how to parse .la files.
118 $(LN_S) -f .libs/$@ $@
120 # if we build in a separate tree, we need to symlink the *.py files from the
121 # source tree; Python does not accept the extensions and modules in different
124 for f in $(pygi_PYTHON); do \
125 [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
128 all-local: $(LTLIBRARIES:.la=.so) build_pylinks
130 check-local: $(LTLIBRARIES:.la=.so) build_pylinks
132 rm -f $(LTLIBRARIES:.la=.so)