Consolidate image loading code and move to shared/
[platform/upstream/weston.git] / src / Makefile.am
1 bin_PROGRAMS = weston
2
3 AM_CPPFLAGS =                                   \
4         -DDATADIR='"$(datadir)"'                \
5         -DMODULEDIR='"$(moduledir)"'            \
6         -DLIBEXECDIR='"$(libexecdir)"'          \
7         -DXSERVER_PATH='"@XSERVER_PATH@"'       \
8         $(COMPOSITOR_CFLAGS)
9
10 weston_LDFLAGS = -export-dynamic
11 weston_CFLAGS = $(GCC_CFLAGS)
12 weston_LDADD =                                                          \
13         $(COMPOSITOR_LIBS) $(DLOPEN_LIBS) $(XSERVER_LAUNCHER_LIBS) -lm  \
14         ../shared/libconfig-parser.la
15
16 weston_SOURCES =                        \
17         compositor.c                            \
18         compositor.h                            \
19         screenshooter.c                         \
20         screenshooter-protocol.c                \
21         screenshooter-server-protocol.h         \
22         util.c                                  \
23         matrix.c                                \
24         matrix.h                                \
25         $(xserver_launcher_sources)
26
27 if ENABLE_SETUID_INSTALL
28 install-exec-hook:
29         chown root $(DESTDIR)$(bindir)/weston
30         chmod u+s $(DESTDIR)$(bindir)/weston
31 endif
32
33 if ENABLE_XSERVER_LAUNCHER
34 xserver_launcher_sources =                      \
35         xserver-launcher.c                      \
36         xserver-protocol.c                      \
37         xserver-server-protocol.h               \
38         hash.c                                  \
39         hash.h
40 endif
41
42 moduledir = @libdir@/weston
43 module_LTLIBRARIES =                            \
44         $(desktop_shell)                        \
45         $(tablet_shell)                 \
46         $(x11_backend)                          \
47         $(drm_backend)                          \
48         $(wayland_backend)                      \
49         $(openwfd_backend)
50
51 if ENABLE_X11_COMPOSITOR
52 x11_backend = x11-backend.la
53 x11_backend_la_LDFLAGS = -module -avoid-version
54 x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \
55         ../shared/libconfig-parser.la
56 x11_backend_la_CFLAGS = $(X11_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
57 x11_backend_la_SOURCES = compositor-x11.c
58 endif
59
60 if ENABLE_DRM_COMPOSITOR
61 drm_backend = drm-backend.la
62 drm_backend_la_LDFLAGS = -module -avoid-version
63 drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS)
64 drm_backend_la_CFLAGS = $(DRM_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
65 drm_backend_la_SOURCES =                        \
66         compositor-drm.c                        \
67         tty.c                                   \
68         evdev.c                                 \
69         evdev.h                                 \
70         libbacklight.c                          \
71         libbacklight.h
72 endif
73
74 if ENABLE_WAYLAND_COMPOSITOR
75 wayland_backend = wayland-backend.la
76 wayland_backend_la_LDFLAGS = -module -avoid-version
77 wayland_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(WAYLAND_COMPOSITOR_LIBS)
78 wayland_backend_la_CFLAGS = $(WAYLAND_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
79 wayland_backend_la_SOURCES = compositor-wayland.c
80 endif
81
82 if ENABLE_OPENWFD_COMPOSITOR
83 openwfd_backend = openwfd-backend.la
84 openwfd_backend_la_LDFLAGS = -module -avoid-version
85 openwfd_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(OPENWFD_COMPOSITOR_LIBS)
86 openwfd_backend_la_CFLAGS = $(OPENWFD_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
87 openwfd_backend_la_SOURCES = compositor-openwfd.c tty.c evdev.c evdev.h
88 endif
89
90 if ENABLE_DESKTOP_SHELL
91 desktop_shell = desktop-shell.la
92 desktop_shell_la_LDFLAGS = -module -avoid-version
93 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS)    \
94         ../shared/libconfig-parser.la
95 desktop_shell_la_CFLAGS = $(GCC_CFLAGS)
96 desktop_shell_la_SOURCES =                      \
97         shell.c                                 \
98         desktop-shell-protocol.c                \
99         desktop-shell-server-protocol.h
100 endif
101
102 if ENABLE_TABLET_SHELL
103 tablet_shell = tablet-shell.la
104 tablet_shell_la_LDFLAGS = -module -avoid-version
105 tablet_shell_la_LIBADD = $(COMPOSITOR_LIBS)
106 tablet_shell_la_CFLAGS = $(GCC_CFLAGS)
107 tablet_shell_la_SOURCES =                       \
108         tablet-shell.c                          \
109         tablet-shell-protocol.c                 \
110         tablet-shell-server-protocol.h
111 endif
112
113 BUILT_SOURCES =                                 \
114         screenshooter-server-protocol.h         \
115         screenshooter-protocol.c                \
116         tablet-shell-protocol.c                 \
117         tablet-shell-server-protocol.h          \
118         xserver-protocol.c                      \
119         xserver-server-protocol.h               \
120         desktop-shell-protocol.c                \
121         desktop-shell-server-protocol.h
122
123 CLEANFILES = $(BUILT_SOURCES)
124
125 @wayland_scanner_rules@