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
45 pygi-foreign-gvariant.c \
46 pygi-foreign-gvariant.h \
65 pygi-signal-closure.c \
66 pygi-signal-closure.h \
67 pygobject-external.h \
71 pygi-invoke-state-struct.h \
74 pygi-marshal-from-py.c \
75 pygi-marshal-from-py.h \
76 pygi-marshal-to-py.c \
77 pygi-marshal-to-py.h \
78 pygi-marshal-cleanup.c \
79 pygi-marshal-cleanup.h
83 $(extension_cppflags) \
84 -I$(top_srcdir)/gi/_glib \
85 -I$(top_srcdir)/gi/_gobject
89 $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
91 $(extension_ldflags) \
92 -export-symbols-regex "init_gi|PyInit__gi"
95 pygi_LTLIBRARIES += _gi_cairo.la
98 _gi_cairo_la_SOURCES = \
100 _gi_cairo_la_CFLAGS = \
103 _gi_cairo_la_CPPFLAGS = \
104 $(extension_cppflags) \
105 -I$(top_srcdir)/gi/_glib \
106 -I$(top_srcdir)/gi/_gobject
107 _gi_cairo_la_LIBADD = \
108 $(extension_libadd) \
111 _gi_cairo_la_LDFLAGS = \
112 $(extension_ldflags) \
113 -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
116 # This is to ensure we have a symlink to the .so in the
117 # build directory, which the Python interpreter can load
118 # directly without having to know how to parse .la files.
120 $(LN_S) .libs/$@ $@ || true
122 # if we build in a separate tree, we need to symlink the *.py files from the
123 # source tree; Python does not accept the extensions and modules in different
126 for f in $(pygi_PYTHON); do \
127 [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
130 all-local: $(LTLIBRARIES:.la=.so) build_pylinks
132 check-local: $(LTLIBRARIES:.la=.so) build_pylinks
134 rm -f $(LTLIBRARIES:.la=.so)