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