Imported Upstream version 3.7.3
[platform/upstream/python-gobject.git] / gi / _gobject / Makefile.am
1 AUTOMAKE_OPTIONS = 1.7
2 PLATFORM_VERSION = 3.0
3
4 pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
5 pkginclude_HEADERS = pygobject.h
6
7 extension_cppflags = \
8         $(PYTHON_INCLUDES) \
9         -DPY_SSIZE_T_CLEAN
10
11 extension_ldflags = \
12         -module \
13         -avoid-version
14
15 if OS_WIN32
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.
19 extension_libadd = \
20         $(PYTHON_LIBS)
21
22 extension_ldflags += \
23         -no-undefined \
24         -shrext ".pyd"
25 endif
26
27 pygobjectdir = $(pyexecdir)/gi/_gobject
28
29 pygobject_PYTHON = \
30         __init__.py \
31         constants.py \
32         propertyhelper.py \
33         signalhelper.py
34
35 pygobject_LTLIBRARIES = _gobject.la
36
37 _gobject_la_SOURCES = \
38         gobjectmodule.c \
39         pygboxed.c \
40         pygboxed.h \
41         pygenum.c \
42         pygenum.h \
43         pygflags.c \
44         pygflags.h \
45         pyginterface.c \
46         pyginterface.h \
47         pygobject.c \
48         pygobject.h \
49         pygobject-private.h \
50         pygparamspec.c \
51         pygparamspec.h \
52         pygpointer.c \
53         pygpointer.h \
54         pygtype.c \
55         pygtype.h
56 _gobject_la_CFLAGS = \
57         $(extension_cppflags) \
58         -I$(top_srcdir)/gi/_glib \
59         -I$(top_srcdir)/gi \
60         $(GLIB_CFLAGS) \
61         $(GI_CFLAGS)
62 _gi_la_CPPFLAGS = \
63         $(extension_cppflags)
64 _gobject_la_LIBADD = \
65         $(extension_libadd) \
66         $(GLIB_LIBS) \
67         $(GI_LIBS) \
68         $(top_builddir)/gi/_glib/libpyglib-gi-2.0-@PYTHON_BASENAME@.la
69 _gobject_la_LDFLAGS = \
70         $(extension_ldflags) \
71         -export-symbols-regex "_gobject|PyInit__gobject"
72
73 # if we build in a separate tree, we need to symlink the *.py files from the
74 # source tree; Python does not accept the extensions and modules in different
75 # paths
76 build_pylinks:
77         for f in $(pygobject_PYTHON); do \
78             [ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
79         done
80
81
82 all: $(pygobject_LTLIBRARIES:.la=.so) build_pylinks
83 check-local: $(pygobject_LTLIBRARIES:.la=.so) build_pylinks
84 clean-local:
85         rm -f $(pygobject_LTLIBRARIES:.la=.so)
86 .la.so:
87         $(LN_S) -f .libs/$@ $@