build: introduce GCC_CXXFLAGS
[profile/ivi/weston-ivi-shell.git] / src / Makefile.am
1 bin_PROGRAMS = weston                           \
2         $(weston_launch)
3
4 AM_CPPFLAGS =                                   \
5         -DDATADIR='"$(datadir)"'                \
6         -DMODULEDIR='"$(moduledir)"'            \
7         -DLIBEXECDIR='"$(libexecdir)"'
8
9 weston_LDFLAGS = -export-dynamic
10 weston_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
11 weston_LDADD = $(COMPOSITOR_LIBS) $(DLOPEN_LIBS) -lm ../shared/libshared.la
12
13 weston_SOURCES =                                \
14         compositor.c                            \
15         compositor.h                            \
16         filter.c                                \
17         filter.h                                \
18         screenshooter.c                         \
19         screenshooter-protocol.c                \
20         screenshooter-server-protocol.h         \
21         text-cursor-position.c                  \
22         text-cursor-position-protocol.c         \
23         text-cursor-position-server-protocol.h  \
24         util.c                                  \
25         matrix.c                                \
26         matrix.h                                \
27         weston-launch.h                         \
28         weston-egl-ext.h
29
30 if ENABLE_XWAYLAND
31 SUBDIRS = xwayland
32 endif
33
34 DIST_SUBDIRS = xwayland
35
36
37 if BUILD_WESTON_LAUNCH
38 weston_launch = weston-launch
39 weston_launch_SOURCES = weston-launch.c weston-launch.h
40 weston_launch_CFLAGS= $(GCC_CFLAGS)
41 weston_launch_CPPFLAGS = $(WESTON_LAUNCH_CFLAGS) $(SYSTEMD_LOGIN_CFLAGS) \
42                  -DBINDIR='"$(bindir)"'
43 weston_launch_LDADD = $(WESTON_LAUNCH_LIBS) $(SYSTEMD_LOGIN_LIBS)
44
45 if ENABLE_SETUID_INSTALL
46 install-exec-hook:
47         chown root $(DESTDIR)$(bindir)/weston-launch
48         chmod u+s $(DESTDIR)$(bindir)/weston-launch
49 endif
50
51 else # BUILD_WESTON_LAUNCH
52
53 if ENABLE_SETUID_INSTALL
54 install-exec-hook:
55         chown root $(DESTDIR)$(bindir)/weston
56         chmod u+s $(DESTDIR)$(bindir)/weston
57 endif
58
59 endif # BUILD_WESTON_LAUNCH
60
61 moduledir = @libdir@/weston
62 module_LTLIBRARIES =                            \
63         $(desktop_shell)                        \
64         $(tablet_shell)                         \
65         $(x11_backend)                          \
66         $(drm_backend)                          \
67         $(wayland_backend)                      \
68         $(openwfd_backend)
69
70 # Do not install, since the binary produced via autotools is unusable.
71 # The real backend is built by the Android build system.
72 noinst_LTLIBRARIES = $(android_backend)
73
74 if ENABLE_X11_COMPOSITOR
75 x11_backend = x11-backend.la
76 x11_backend_la_LDFLAGS = -module -avoid-version
77 x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \
78         ../shared/libshared.la
79 x11_backend_la_CFLAGS =                         \
80         $(COMPOSITOR_CFLAGS)                    \
81         $(X11_COMPOSITOR_CFLAGS)                \
82         $(GCC_CFLAGS)
83 x11_backend_la_SOURCES = compositor-x11.c
84 endif
85
86 if ENABLE_DRM_COMPOSITOR
87 drm_backend = drm-backend.la
88 drm_backend_la_LDFLAGS = -module -avoid-version
89 drm_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(DRM_COMPOSITOR_LIBS) \
90         ../shared/libshared.la
91 drm_backend_la_CFLAGS =                         \
92         $(COMPOSITOR_CFLAGS)                    \
93         $(DRM_COMPOSITOR_CFLAGS)                \
94         $(GCC_CFLAGS)
95 drm_backend_la_SOURCES =                        \
96         compositor-drm.c                        \
97         tty.c                                   \
98         evdev.c                                 \
99         evdev.h                                 \
100         evdev-private.h                         \
101         evdev-touchpad.c                        \
102         launcher-util.c                         \
103         launcher-util.h                         \
104         libbacklight.c                          \
105         libbacklight.h
106 endif
107
108 if ENABLE_WAYLAND_COMPOSITOR
109 wayland_backend = wayland-backend.la
110 wayland_backend_la_LDFLAGS = -module -avoid-version
111 wayland_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(WAYLAND_COMPOSITOR_LIBS) \
112         ../shared/libshared.la
113 wayland_backend_la_CFLAGS =                     \
114         $(COMPOSITOR_CFLAGS)                    \
115         $(WAYLAND_COMPOSITOR_CFLAGS)            \
116         $(GCC_CFLAGS)
117 wayland_backend_la_SOURCES = compositor-wayland.c
118 endif
119
120 if ENABLE_OPENWFD_COMPOSITOR
121 openwfd_backend = openwfd-backend.la
122 openwfd_backend_la_LDFLAGS = -module -avoid-version
123 openwfd_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(OPENWFD_COMPOSITOR_LIBS)
124 openwfd_backend_la_CFLAGS = $(OPENWFD_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
125 openwfd_backend_la_SOURCES = compositor-openwfd.c tty.c evdev.c evdev.h
126 endif
127
128 if ENABLE_ANDROID_COMPOSITOR
129 android_backend = android-backend.la
130 android_backend_la_LDFLAGS = -module -avoid-version
131 android_backend_la_LIBADD = $(COMPOSITOR_LIBS)
132 android_backend_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
133 android_backend_la_CXXFLAGS = $(GCC_CXXFLAGS) $(COMPOSITOR_CFLAGS)
134 android_backend_la_SOURCES = \
135         compositor-android.c \
136         android-framebuffer.cpp \
137         android-framebuffer.h
138 endif
139
140 if ENABLE_DESKTOP_SHELL
141 desktop_shell = desktop-shell.la
142 desktop_shell_la_LDFLAGS = -module -avoid-version
143 desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS)    \
144         ../shared/libshared.la
145 desktop_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
146 desktop_shell_la_SOURCES =                      \
147         shell.c                                 \
148         desktop-shell-protocol.c                \
149         desktop-shell-server-protocol.h
150 endif
151
152 if ENABLE_TABLET_SHELL
153 tablet_shell = tablet-shell.la
154 tablet_shell_la_LDFLAGS = -module -avoid-version
155 tablet_shell_la_LIBADD = $(COMPOSITOR_LIBS)
156 tablet_shell_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
157 tablet_shell_la_SOURCES =                       \
158         tablet-shell.c                          \
159         tablet-shell-protocol.c                 \
160         tablet-shell-server-protocol.h
161 endif
162
163 BUILT_SOURCES =                                 \
164         screenshooter-server-protocol.h         \
165         screenshooter-protocol.c                \
166         text-cursor-position-server-protocol.h  \
167         text-cursor-position-protocol.c         \
168         tablet-shell-protocol.c                 \
169         tablet-shell-server-protocol.h          \
170         desktop-shell-protocol.c                \
171         desktop-shell-server-protocol.h
172
173 CLEANFILES = $(BUILT_SOURCES)
174
175 @wayland_scanner_rules@