autotools: Don't use wayland-scanner.m4
[platform/upstream/weston.git] / src / Makefile.am
1 bin_PROGRAMS = weston                           \
2         $(weston_launch)
3
4 AM_CPPFLAGS =                                   \
5         -I$(top_srcdir)/shared                  \
6         -DDATADIR='"$(datadir)"'                \
7         -DMODULEDIR='"$(moduledir)"'            \
8         -DLIBEXECDIR='"$(libexecdir)"'          \
9         -DIN_WESTON
10
11 weston_LDFLAGS = -export-dynamic
12 weston_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS)
13 weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \
14         $(DLOPEN_LIBS) -lm ../shared/libshared.la
15
16 weston_SOURCES =                                \
17         git-version.h                           \
18         log.c                                   \
19         compositor.c                            \
20         compositor.h                            \
21         input.c                                 \
22         data-device.c                           \
23         filter.c                                \
24         filter.h                                \
25         screenshooter.c                         \
26         screenshooter-protocol.c                \
27         screenshooter-server-protocol.h         \
28         clipboard.c                             \
29         text-cursor-position-protocol.c         \
30         text-cursor-position-server-protocol.h  \
31         zoom.c                                  \
32         text-backend.c                          \
33         text-protocol.c                         \
34         text-server-protocol.h                  \
35         input-method-protocol.c                 \
36         input-method-server-protocol.h          \
37         workspaces-protocol.c                   \
38         workspaces-server-protocol.h            \
39         subsurface-protocol.c                   \
40         subsurface-server-protocol.h            \
41         bindings.c                              \
42         animation.c                             \
43         gl-renderer.h                           \
44         noop-renderer.c                         \
45         pixman-renderer.c                       \
46         pixman-renderer.h                       \
47         ../shared/matrix.c                      \
48         ../shared/matrix.h                      \
49         ../shared/zalloc.h                      \
50         weston-launch.h                         \
51         weston-egl-ext.h
52
53 if ENABLE_EGL
54 weston_SOURCES +=                               \
55         gl-renderer.c
56 endif
57
58 git-version.h : .FORCE
59         $(AM_V_GEN)(echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@-new; \
60         cmp -s $@ $@-new || cp $@-new $@; \
61         rm $@-new)
62
63 .FORCE :
64
65 if ENABLE_XWAYLAND
66 SUBDIRS = xwayland
67 endif
68
69 DIST_SUBDIRS = xwayland
70
71
72 if BUILD_WESTON_LAUNCH
73 weston_launch = weston-launch
74 weston_launch_SOURCES = weston-launch.c weston-launch.h
75 weston_launch_CFLAGS= $(GCC_CFLAGS)
76 weston_launch_CPPFLAGS = $(WESTON_LAUNCH_CFLAGS) $(SYSTEMD_LOGIN_CFLAGS) \
77                  -DBINDIR='"$(bindir)"'
78 weston_launch_LDADD = $(WESTON_LAUNCH_LIBS) $(SYSTEMD_LOGIN_LIBS)
79
80 if ENABLE_SETUID_INSTALL
81 install-exec-hook:
82         chown root $(DESTDIR)$(bindir)/weston-launch
83         chmod u+s $(DESTDIR)$(bindir)/weston-launch
84 endif
85
86 endif # BUILD_WESTON_LAUNCH
87
88 pkgconfigdir = $(libdir)/pkgconfig
89 pkgconfig_DATA = weston.pc
90
91 westonincludedir = $(includedir)/weston
92 westoninclude_HEADERS =                         \
93         version.h                               \
94         compositor.h                            \
95         ../shared/matrix.h                      \
96         ../shared/config-parser.h               \
97         ../shared/zalloc.h
98
99 moduledir = $(libdir)/weston
100 module_LTLIBRARIES =                            \
101         $(desktop_shell)                        \
102         $(tablet_shell)                         \
103         $(cms_static)                           \
104         $(cms_colord)                           \
105         $(x11_backend)                          \
106         $(drm_backend)                          \
107         $(wayland_backend)                      \
108         $(headless_backend)                     \
109         $(fbdev_backend)                        \
110         $(rdp_backend)
111
112 noinst_LTLIBRARIES =
113
114 if INSTALL_RPI_COMPOSITOR
115 module_LTLIBRARIES += $(rpi_backend)
116 else
117 noinst_LTLIBRARIES += $(rpi_backend)
118 endif
119
120 if ENABLE_X11_COMPOSITOR
121 x11_backend = x11-backend.la
122 x11_backend_la_LDFLAGS = -module -avoid-version
123 x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \
124         ../shared/libshared-cairo.la
125 x11_backend_la_CFLAGS =                         \
126         $(COMPOSITOR_CFLAGS)                    \
127         $(PIXMAN_CFLAGS)                        \
128         $(CAIRO_CFLAGS)                         \
129         $(X11_COMPOSITOR_CFLAGS)                \
130         $(GCC_CFLAGS)
131 x11_backend_la_SOURCES = compositor-x11.c
132 endif
133
134 if ENABLE_DRM_COMPOSITOR
135 drm_backend = drm-backend.la
136 drm_backend_la_LDFLAGS = -module -avoid-version
137 drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS) \
138         ../shared/libshared.la -lrt
139 drm_backend_la_CFLAGS =                         \
140         $(COMPOSITOR_CFLAGS)                    \
141         $(DRM_COMPOSITOR_CFLAGS)                \
142         $(GCC_CFLAGS)
143 drm_backend_la_SOURCES =                        \
144         compositor-drm.c                        \
145         tty.c                                   \
146         udev-seat.c                             \
147         udev-seat.h                             \
148         evdev.c                                 \
149         evdev.h                                 \
150         evdev-touchpad.c                        \
151         launcher-util.c                         \
152         launcher-util.h                         \
153         libbacklight.c                          \
154         libbacklight.h
155 endif
156
157 if ENABLE_WAYLAND_COMPOSITOR
158 wayland_backend = wayland-backend.la
159 wayland_backend_la_LDFLAGS = -module -avoid-version
160 wayland_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(WAYLAND_COMPOSITOR_LIBS) \
161         ../shared/libshared-cairo.la
162 wayland_backend_la_CFLAGS =                     \
163         $(COMPOSITOR_CFLAGS)                    \
164         $(PIXMAN_CFLAGS)                        \
165         $(CAIRO_CFLAGS)                         \
166         $(WAYLAND_COMPOSITOR_CFLAGS)            \
167         $(GCC_CFLAGS)
168 wayland_backend_la_SOURCES = compositor-wayland.c
169 endif
170
171 if ENABLE_RPI_COMPOSITOR
172 rpi_backend = rpi-backend.la
173 rpi_backend_la_LDFLAGS = -module -avoid-version
174 rpi_backend_la_LIBADD = $(COMPOSITOR_LIBS)      \
175         $(RPI_COMPOSITOR_LIBS)                  \
176         $(RPI_BCM_HOST_LIBS)                    \
177         ../shared/libshared.la
178 rpi_backend_la_CFLAGS =                         \
179         $(GCC_CFLAGS)                           \
180         $(COMPOSITOR_CFLAGS)                    \
181         $(RPI_COMPOSITOR_CFLAGS)                \
182         $(RPI_BCM_HOST_CFLAGS)
183 rpi_backend_la_SOURCES =                        \
184         compositor-rpi.c                        \
185         rpi-renderer.c                          \
186         rpi-renderer.h                          \
187         rpi-bcm-stubs.h                         \
188         tty.c                                   \
189         evdev.c                                 \
190         evdev.h                                 \
191         evdev-touchpad.c
192 endif
193
194 if ENABLE_HEADLESS_COMPOSITOR
195 headless_backend = headless-backend.la
196 headless_backend_la_LDFLAGS = -module -avoid-version
197 headless_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
198         ../shared/libshared.la
199 headless_backend_la_CFLAGS =                    \
200         $(COMPOSITOR_CFLAGS)                    \
201         $(GCC_CFLAGS)
202 headless_backend_la_SOURCES = compositor-headless.c
203 endif
204
205 if ENABLE_FBDEV_COMPOSITOR
206 fbdev_backend = fbdev-backend.la
207 fbdev_backend_la_LDFLAGS = -module -avoid-version
208 fbdev_backend_la_LIBADD = \
209         $(COMPOSITOR_LIBS) \
210         $(FBDEV_COMPOSITOR_LIBS) \
211         ../shared/libshared.la
212 fbdev_backend_la_CFLAGS = \
213         $(COMPOSITOR_CFLAGS) \
214         $(FBDEV_COMPOSITOR_CFLAGS) \
215         $(PIXMAN_CFLAGS) \
216         $(GCC_CFLAGS)
217 fbdev_backend_la_SOURCES = \
218         compositor-fbdev.c \
219         tty.c \
220         udev-seat.c \
221         udev-seat.h \
222         evdev.c \
223         evdev.h \
224         evdev-touchpad.c \
225         launcher-util.c
226 endif
227
228 if ENABLE_RDP_COMPOSITOR
229 rdp_backend = rdp-backend.la
230 rdp_backend_la_LDFLAGS = -module -avoid-version
231 rdp_backend_la_LIBADD = $(COMPOSITOR_LIBS) \
232         $(RDP_COMPOSITOR_LIBS) \
233         ../shared/libshared.la
234 rdp_backend_la_CFLAGS =                 \
235         $(COMPOSITOR_CFLAGS)                    \
236         $(RDP_COMPOSITOR_CFLAGS) \
237         $(GCC_CFLAGS)
238 rdp_backend_la_SOURCES = compositor-rdp.c
239 endif
240
241 if ENABLE_DESKTOP_SHELL
242 desktop_shell = desktop-shell.la
243 desktop_shell_la_LDFLAGS = -module -avoid-version
244 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS)    \
245         ../shared/libshared.la
246 desktop_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
247 desktop_shell_la_SOURCES =                      \
248         shell.c                                 \
249         desktop-shell-protocol.c                \
250         desktop-shell-server-protocol.h
251 endif
252
253 if ENABLE_TABLET_SHELL
254 tablet_shell = tablet-shell.la
255 tablet_shell_la_LDFLAGS = -module -avoid-version
256 tablet_shell_la_LIBADD = $(COMPOSITOR_LIBS)
257 tablet_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
258 tablet_shell_la_SOURCES =                       \
259         tablet-shell.c                          \
260         tablet-shell-protocol.c                 \
261         tablet-shell-server-protocol.h
262 endif
263
264 if HAVE_LCMS
265 cms_static = cms-static.la
266 cms_static_la_LDFLAGS = -module -avoid-version
267 cms_static_la_LIBADD = $(COMPOSITOR_LIBS) $(LCMS_LIBS) ../shared/libshared.la
268 cms_static_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS)
269 cms_static_la_SOURCES =                         \
270         cms-static.c                            \
271         cms-helper.c                            \
272         cms-helper.h
273 if ENABLE_COLORD
274 cms_colord = cms-colord.la
275 cms_colord_la_LDFLAGS = -module -avoid-version
276 cms_colord_la_LIBADD = $(COMPOSITOR_LIBS) $(COLORD_LIBS)
277 cms_colord_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS)
278 cms_colord_la_SOURCES =                         \
279         cms-colord.c                            \
280         cms-helper.c                            \
281         cms-helper.h
282 endif
283 endif
284
285 noinst_PROGRAMS = spring-tool
286
287 spring_tool_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
288 spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm
289 spring_tool_SOURCES =                           \
290         spring-tool.c                           \
291         animation.c                             \
292         ../shared/matrix.c                      \
293         ../shared/matrix.h                      \
294         compositor.h
295
296 BUILT_SOURCES =                                 \
297         screenshooter-server-protocol.h         \
298         screenshooter-protocol.c                \
299         text-cursor-position-server-protocol.h  \
300         text-cursor-position-protocol.c         \
301         tablet-shell-protocol.c                 \
302         tablet-shell-server-protocol.h          \
303         desktop-shell-protocol.c                \
304         desktop-shell-server-protocol.h         \
305         text-protocol.c                         \
306         text-server-protocol.h                  \
307         input-method-protocol.c                 \
308         input-method-server-protocol.h          \
309         workspaces-server-protocol.h            \
310         workspaces-protocol.c                   \
311         subsurface-server-protocol.h            \
312         subsurface-protocol.c                   \
313         git-version.h
314
315 CLEANFILES = $(BUILT_SOURCES)
316
317 wayland_protocoldir = $(top_srcdir)/protocol
318 include $(top_srcdir)/wayland-scanner.mk