build: simplify extension building
[free-sw/xcb/libxcb] / src / Makefile.am
1 lib_LTLIBRARIES = libxcb.la
2
3 EXTSOURCES =    xproto.c \
4                 bigreq.c \
5                 xc_misc.c
6
7 AM_CFLAGS = $(CWARNFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS)
8 libxcb_la_LIBADD = $(NEEDED_LIBS) $(XDMCP_LIBS)
9 libxcb_la_SOURCES = \
10                 xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \
11                 xcb_list.c xcb_util.c xcb_auth.c c_client.py
12 nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c
13
14 # Explanation for -version-info:
15 # -version-info current:revision:age
16 # The library supports interface (current-age) to interface current.
17 # * If you changed the source code at all, increment revision.
18 # * If you add an interface, increment current and age and set revision to 0.
19 # * If you change or remove an interface, increment current and set revision
20 #   and age to 0.
21 libxcb_la_LDFLAGS = -version-info 2:0:1 -no-undefined
22
23 XCB_LIBS = libxcb.la
24
25 # FIXME: find a way to autogenerate this from the XML files.
26
27 EXTSOURCES += composite.c
28 if BUILD_COMPOSITE
29 lib_LTLIBRARIES += libxcb-composite.la
30 libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -no-undefined
31 libxcb_composite_la_LIBADD = $(XCB_LIBS)
32 nodist_libxcb_composite_la_SOURCES = composite.c composite.h
33 endif
34
35 EXTSOURCES += damage.c
36 if BUILD_DAMAGE
37 lib_LTLIBRARIES += libxcb-damage.la
38 libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -no-undefined
39 libxcb_damage_la_LIBADD = $(XCB_LIBS)
40 nodist_libxcb_damage_la_SOURCES = damage.c damage.h
41 endif
42
43 EXTSOURCES += dpms.c
44 if BUILD_DPMS
45 lib_LTLIBRARIES += libxcb-dpms.la
46 libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -no-undefined
47 libxcb_dpms_la_LIBADD = $(XCB_LIBS)
48 nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h
49 endif
50
51 EXTSOURCES += dri2.c
52 if BUILD_DRI2
53 lib_LTLIBRARIES += libxcb-dri2.la
54 libxcb_dri2_la_LDFLAGS = -version-info 0:0:0 -no-undefined
55 libxcb_dri2_la_LIBADD = $(XCB_LIBS)
56 nodist_libxcb_dri2_la_SOURCES = dri2.c dri2.h
57 endif
58
59 EXTSOURCES += glx.c
60 if BUILD_GLX
61 lib_LTLIBRARIES += libxcb-glx.la
62 libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -no-undefined
63 libxcb_glx_la_LIBADD = $(XCB_LIBS)
64 nodist_libxcb_glx_la_SOURCES = glx.c glx.h
65 endif
66
67 EXTSOURCES += randr.c
68 if BUILD_RANDR
69 lib_LTLIBRARIES += libxcb-randr.la
70 libxcb_randr_la_LDFLAGS = -version-info 1:0:1 -no-undefined
71 libxcb_randr_la_LIBADD = $(XCB_LIBS)
72 nodist_libxcb_randr_la_SOURCES = randr.c randr.h
73 endif
74
75 EXTSOURCES += record.c
76 if BUILD_RECORD
77 lib_LTLIBRARIES += libxcb-record.la
78 libxcb_record_la_LDFLAGS = -version-info 0:0:0 -no-undefined
79 libxcb_record_la_LIBADD = $(XCB_LIBS)
80 nodist_libxcb_record_la_SOURCES = record.c record.h
81 endif
82
83 EXTSOURCES += render.c
84 if BUILD_RENDER
85 lib_LTLIBRARIES += libxcb-render.la
86 libxcb_render_la_LDFLAGS = -version-info 0:0:0 -no-undefined
87 libxcb_render_la_LIBADD = $(XCB_LIBS)
88 nodist_libxcb_render_la_SOURCES = render.c render.h
89 endif
90
91 EXTSOURCES += res.c
92 if BUILD_RESOURCE
93 lib_LTLIBRARIES += libxcb-res.la
94 libxcb_res_la_LDFLAGS = -version-info 0:0:0 -no-undefined
95 libxcb_res_la_LIBADD = $(XCB_LIBS)
96 nodist_libxcb_res_la_SOURCES = res.c res.h
97 endif
98
99 EXTSOURCES += screensaver.c
100 if BUILD_SCREENSAVER
101 lib_LTLIBRARIES += libxcb-screensaver.la
102 libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -no-undefined
103 libxcb_screensaver_la_LIBADD = $(XCB_LIBS)
104 nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h
105 endif
106
107 EXTSOURCES += shape.c
108 if BUILD_SHAPE
109 lib_LTLIBRARIES += libxcb-shape.la
110 libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -no-undefined
111 libxcb_shape_la_LIBADD = $(XCB_LIBS)
112 nodist_libxcb_shape_la_SOURCES = shape.c shape.h
113 endif
114
115 EXTSOURCES += shm.c
116 if BUILD_SHM
117 lib_LTLIBRARIES += libxcb-shm.la
118 libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -no-undefined
119 libxcb_shm_la_LIBADD = $(XCB_LIBS)
120 nodist_libxcb_shm_la_SOURCES = shm.c shm.h
121 endif
122
123 EXTSOURCES += sync.c
124 if BUILD_SYNC
125 lib_LTLIBRARIES += libxcb-sync.la
126 libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined
127 libxcb_sync_la_LIBADD = $(XCB_LIBS)
128 nodist_libxcb_sync_la_SOURCES = sync.c sync.h
129 endif
130
131 EXTSOURCES += xevie.c
132 if BUILD_XEVIE
133 lib_LTLIBRARIES += libxcb-xevie.la
134 libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -no-undefined
135 libxcb_xevie_la_LIBADD = $(XCB_LIBS)
136 nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h
137 endif
138
139 EXTSOURCES += xf86dri.c
140 if BUILD_XFREE86_DRI
141 lib_LTLIBRARIES += libxcb-xf86dri.la
142 libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -no-undefined
143 libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)
144 nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h
145 endif
146
147 EXTSOURCES += xfixes.c
148 if BUILD_XFIXES
149 lib_LTLIBRARIES += libxcb-xfixes.la
150 libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -no-undefined
151 libxcb_xfixes_la_LIBADD = $(XCB_LIBS)
152 nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h
153 endif
154
155 EXTSOURCES += xinerama.c
156 if BUILD_XINERAMA
157 lib_LTLIBRARIES += libxcb-xinerama.la
158 libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -no-undefined
159 libxcb_xinerama_la_LIBADD = $(XCB_LIBS)
160 nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h
161 endif
162
163 EXTSOURCES += xinput.c
164 if BUILD_XINPUT
165 lib_LTLIBRARIES += libxcb-xinput.la
166 libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined
167 libxcb_xinput_la_LIBADD = $(XCB_LIBS)
168 nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h
169 endif
170
171 EXTSOURCES += xprint.c
172 if BUILD_XPRINT
173 lib_LTLIBRARIES += libxcb-xprint.la
174 libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -no-undefined
175 libxcb_xprint_la_LIBADD = $(XCB_LIBS)
176 nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h
177 endif
178
179 EXTSOURCES += xselinux.c
180 if BUILD_SELINUX
181 lib_LTLIBRARIES += libxcb-xselinux.la
182 libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 -no-undefined
183 libxcb_xselinux_la_LIBADD = $(XCB_LIBS)
184 nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h
185 endif
186
187 EXTSOURCES += xtest.c
188 if BUILD_XTEST
189 lib_LTLIBRARIES += libxcb-xtest.la
190 libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -no-undefined
191 libxcb_xtest_la_LIBADD = $(XCB_LIBS)
192 nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h
193 endif
194
195 EXTSOURCES += xv.c
196 if BUILD_XV
197 lib_LTLIBRARIES += libxcb-xv.la
198 libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -no-undefined
199 libxcb_xv_la_LIBADD = $(XCB_LIBS)
200 nodist_libxcb_xv_la_SOURCES = xv.c xv.h
201 endif
202
203 EXTSOURCES += xvmc.c
204 if BUILD_XVMC
205 lib_LTLIBRARIES += libxcb-xvmc.la
206 libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -no-undefined
207 libxcb_xvmc_la_LIBADD = $(XCB_LIBS)
208 nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h
209 endif
210
211
212 EXTHEADERS=$(EXTSOURCES:.c=.h)
213 xcbinclude_HEADERS = xcb.h xcbext.h
214 nodist_xcbinclude_HEADERS = $(EXTHEADERS)
215 noinst_HEADERS = xcbint.h
216
217 BUILT_SOURCES = $(EXTSOURCES)
218 CLEANFILES = $(EXTSOURCES) $(EXTHEADERS)
219
220 $(EXTSOURCES): c_client.py
221         $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)