3841075575999a4db9ff4ad585868d78be8cbec3
[platform/upstream/pygobject2.git] / gi / Makefile.am
1 PLATFORM_VERSION = 3.0
2
3 SUBDIRS = \
4         repository \
5         overrides
6
7 extension_cppflags = \
8         $(PYTHON_INCLUDES) \
9         -DPY_SSIZE_T_CLEAN
10
11 extension_ldflags = \
12         -module \
13         -avoid-version \
14         -shrext $(PYTHON_SO)
15
16 if OS_WIN32
17 # Windows requires Python modules to be explicitly linked to libpython.
18 # Extension modules are shared libaries (.dll), but need to be
19 # called .pyd for Python to load it as an extension module.
20 extension_libadd = \
21         $(PYTHON_LIBS)
22
23 extension_ldflags += \
24         -no-undefined
25 endif
26
27 pkgincludedir = $(includedir)/pygobject-$(PLATFORM_VERSION)
28 if WITH_COMMON
29 pkginclude_HEADERS = pygobject.h
30 endif
31
32 pygidir = $(pyexecdir)/gi
33
34 pygi_LTLIBRARIES = _gi.la
35
36 _gi_la_SOURCES = \
37         gobjectmodule.c \
38         gobjectmodule.h \
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.h \
48         pygobject-internal.h \
49         pygobject-object.c \
50         pygobject-object.h \
51         pygparamspec.c \
52         pygparamspec.h \
53         pygpointer.c \
54         pygpointer.h \
55         pygtype.c \
56         pygtype.h \
57         pygoptioncontext.c \
58         pygoptioncontext.h \
59         pygoptiongroup.c \
60         pygoptiongroup.h \
61         pygspawn.c \
62         pygspawn.h \
63         pyglib.c \
64         pyglib.h \
65         pyglib-python-compat.h \
66         gimodule.c \
67         pygi-repository.c \
68         pygi-repository.h \
69         pygi-info.c \
70         pygi-info.h \
71         pygi-foreign.c \
72         pygi-foreign.h \
73         pygi-foreign-api.h \
74         pygi-struct.c \
75         pygi-struct.h \
76         pygi-source.c \
77         pygi-source.h \
78         pygi-argument.c \
79         pygi-argument.h \
80         pygi-resulttuple.c \
81         pygi-resulttuple.h \
82         pygi-type.c \
83         pygi-type.h \
84         pygi-boxed.c \
85         pygi-boxed.h \
86         pygi-closure.c \
87         pygi-closure.h \
88         pygi-ccallback.c \
89         pygi-ccallback.h \
90         pygi-util.c \
91         pygi-util.h \
92         pygi-property.c \
93         pygi-property.h \
94         pygi-signal-closure.c \
95         pygi-signal-closure.h \
96         pygi-invoke.c \
97         pygi-invoke.h \
98         pygi-invoke-state-struct.h \
99         pygi-cache.h \
100         pygi-cache.c \
101         pygi-marshal-cleanup.c \
102         pygi-marshal-cleanup.h \
103         pygi-basictype.c \
104         pygi-basictype.h \
105         pygi-list.c \
106         pygi-list.h \
107         pygi-array.c \
108         pygi-array.h \
109         pygi-error.c \
110         pygi-error.h \
111         pygi-object.c \
112         pygi-object.h \
113         pygi-value.c \
114         pygi-value.h \
115         pygi-enum-marshal.c \
116         pygi-enum-marshal.h \
117         pygi-struct-marshal.c \
118         pygi-struct-marshal.h \
119         pygi-hashtable.c \
120         pygi-hashtable.h
121 _gi_la_CFLAGS = \
122         $(CODE_COVERAGE_CFLAGS) \
123         $(WARN_CFLAGS) \
124         $(extension_cppflags) \
125         $(GLIB_CFLAGS) \
126         $(GI_CFLAGS)
127 _gi_la_CPPFLAGS = \
128         $(CODE_COVERAGE_CPPFLAGS) \
129         $(extension_cppflags)
130 _gi_la_LIBADD = \
131         $(CODE_COVERAGE_LIBS) \
132         $(extension_libadd) \
133         $(GLIB_LIBS) \
134         $(GI_LIBS) \
135         $(FFI_LIBS)
136 _gi_la_LDFLAGS = \
137         $(WARN_LDFLAGS) \
138         $(extension_ldflags) \
139         -export-symbols-regex "init_gi|PyInit__gi"
140
141 if ENABLE_CAIRO
142 pygi_LTLIBRARIES += _gi_cairo.la
143 endif
144
145 _gi_cairo_la_SOURCES = \
146         pygi-foreign-cairo.c
147 _gi_cairo_la_CFLAGS = \
148         $(CODE_COVERAGE_CFLAGS) \
149         $(WARN_CFLAGS) \
150         $(GI_CFLAGS) \
151         $(CAIRO_CFLAGS) \
152         $(PYCAIRO_CFLAGS)
153 _gi_cairo_la_CPPFLAGS = \
154         $(CODE_COVERAGE_CPPFLAGS) \
155         $(extension_cppflags)
156 _gi_cairo_la_LIBADD = \
157         $(CODE_COVERAGE_LIBS) \
158         $(extension_libadd) \
159         $(GI_LIBS) \
160         $(CAIRO_LIBS) \
161         $(PYCAIRO_LIBS)
162 _gi_cairo_la_LDFLAGS = \
163         $(WARN_LDFLAGS) \
164         $(extension_ldflags) \
165         -export-symbols-regex "init_gi_cairo|PyInit__gi_cairo"
166
167
168 # This is to ensure we have a symlink to the .so in the
169 # build directory, which the Python interpreter can load
170 # directly without having to know how to parse .la files.
171 %$(PYTHON_SO): %.la
172         $(LN_S) -f .libs/$@ $@
173
174 all-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
175
176 check-local: $(LTLIBRARIES:.la=$(PYTHON_SO))
177 clean-local:
178         rm -f $(LTLIBRARIES:.la=$(PYTHON_SO))