fakevt: remove unused tool
[platform/upstream/kmscon.git] / Makefile.am
1 #
2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
4 #
5
6 ACLOCAL_AMFLAGS = -I m4
7 SUBDIRS = \
8         .
9 include_HEADERS =
10 EXTRA_DIST = \
11         README \
12         COPYING \
13         NEWS
14 CLEANFILES =
15 pkgconfigdir = $(libdir)/pkgconfig
16 pkgconfig_DATA =
17
18 #
19 # Build targets
20 #
21 # kmscon: Main kmscon program
22 # test_output: Test program for the display graphics subsystem
23 # test_vt: Test program for the VT subsystem
24 # test_input: Test program for the input subsystem
25 # libkmscon-core: Static core library for kmscon and test programs
26 # libkmscon-static: Static library for all subsystems
27 # genshader: Program used to convert shaders into C-source files
28 #
29
30 bin_PROGRAMS = \
31         kmscon
32 check_PROGRAMS = \
33         test_output \
34         test_vt \
35         test_input
36 noinst_PROGRAMS = \
37         genshader \
38         genunifont
39 noinst_LTLIBRARIES = \
40         libkmscon-core.la \
41         libkmscon-static.la
42 lib_LTLIBRARIES =
43
44 #
45 # Default CFlags
46 # Make all files include "config.h" by default. This shouldn't cause any
47 # problems and we cannot forget to include it anymore.
48 #
49 # Also make the linker discard all unused symbols as we are not building a
50 # shared library.
51 #
52 # When compiling in debug mode, we enable debug symbols so debugging with gdb
53 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
54 # Otherwise, we use standard optimizations -O2.
55 #
56
57 AM_CFLAGS = \
58         -Wall
59 AM_CPPFLAGS = \
60         -include $(top_builddir)/config.h \
61         -I $(srcdir)/src \
62         -I $(srcdir)/external
63 AM_LDFLAGS = \
64         -Wl,--as-needed
65
66 if DEBUG
67 AM_CFLAGS += -g
68 endif
69
70 if OPTIMIZATIONS
71 AM_CFLAGS += -O2
72 else
73 AM_CFLAGS += -O0
74 endif
75
76 #
77 # libeloop
78 # This library contains the whole event-loop implementation of kmscon. It is
79 # compiled into a separate object to allow using it in several other programs.
80 #
81
82 lib_LTLIBRARIES += \
83         libeloop.la
84
85 libeloop_la_SOURCES = \
86         src/static_llog.h \
87         src/static_dlist.h \
88         src/static_hook.h \
89         src/eloop.h \
90         src/eloop.c
91
92 if EV_HAVE_DBUS
93 libeloop_la_SOURCES += \
94         external/dbus-common.h \
95         external/dbus-loop.h \
96         external/dbus-loop.c
97 endif
98
99 libeloop_la_CPPFLAGS = \
100         $(AM_CPPFLAGS) \
101         $(DBUS_CFLAGS)
102 libeloop_la_LIBADD = \
103         $(DBUS_LIBS)
104 libeloop_la_LDFLAGS = \
105         -version-info 1:0:0
106
107 include_HEADERS += \
108         src/eloop.h
109
110 pkgconfig_DATA += libeloop.pc
111
112 #
113 # libuterm
114 # The uterm library provides helpers to create terminals in user-space. They
115 # are not limited to text-based terminals but rather provide graphics contexts
116 # so arbitrary output can be displayed. Additionally, they provide VT
117 # abstractions and an input layer
118 #
119
120 lib_LTLIBRARIES += \
121         libuterm.la
122
123 libuterm_la_SOURCES = \
124         src/uterm.h \
125         src/uterm_internal.h \
126         src/uterm_video.c \
127         src/uterm_monitor.c \
128         src/uterm_vt.c \
129         src/uterm_input.c \
130         src/uterm_input_plain.c \
131         external/imKStoUCS.h \
132         external/imKStoUCS.c
133
134 libuterm_la_CPPFLAGS = \
135         $(AM_CPPFLAGS) \
136         $(SYSTEMD_CFLAGS) \
137         $(DRM_CFLAGS) \
138         $(EGL_CFLAGS) \
139         $(GBM_CFLAGS) \
140         $(GLES2_CFLAGS) \
141         $(UDEV_CFLAGS) \
142         $(XKBCOMMON_CFLAGS)
143 libuterm_la_LIBADD = \
144         $(SYSTEMD_LIBS) \
145         $(DRM_LIBS) \
146         $(EGL_LIBS) \
147         $(GBM_LIBS) \
148         $(GLES2_LIBS) \
149         $(UDEV_LIBS) \
150         $(XKBCOMMON_LIBS) \
151         libkmscon-static.la \
152         libeloop.la
153 libuterm_la_LDFLAGS = \
154         -version-info 1:0:0
155
156 if UTERM_HAVE_FBDEV
157 libuterm_la_SOURCES += \
158         src/uterm_video_fbdev.c
159 endif
160
161 if UTERM_HAVE_DRM
162 libuterm_la_SOURCES += \
163         src/uterm_video_drm.c
164 endif
165
166 if UTERM_HAVE_DUMB
167 libuterm_la_SOURCES += \
168         src/uterm_video_dumb.c
169 endif
170
171 if UTERM_HAVE_XKBCOMMON
172 libuterm_la_SOURCES += \
173         src/uterm_input_uxkb.c
174 endif
175
176 include_HEADERS += \
177         src/uterm.h
178
179 pkgconfig_DATA += libuterm.pc
180
181 #
182 # Shaders
183 # As there is no need to modify shaders at run-time, we statically compile them
184 # into object files. As autotools would ignore them, we need to add them to
185 # EXTRA_DIST.
186 # The program that converts the shaders into C-source files is "genshader". It's
187 # pretty simple and just creates a string with the shader source as content.
188 #
189
190 SHADERS = \
191         $(srcdir)/src/static_fill.vert \
192         $(srcdir)/src/static_fill.frag \
193         $(srcdir)/src/static_blend.vert \
194         $(srcdir)/src/static_blend.frag \
195         $(srcdir)/src/static_blit.vert \
196         $(srcdir)/src/static_blit.frag \
197         $(srcdir)/src/static_gltex.vert \
198         $(srcdir)/src/static_gltex.frag
199
200 EXTRA_DIST += \
201         $(SHADERS)
202 CLEANFILES += \
203         src/static_shaders.c
204
205 genshader_SOURCES = \
206         src/genshader.c
207
208 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
209         ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
210
211 #
212 # Unifont Generator
213 # This generates the unifont sources from raw hex-encoded font data.
214 #
215
216 UNIFONT = \
217         src/text_font_unifont_data.hex
218
219 EXTRA_DIST += \
220         $(UNIFONT)
221 CLEANFILES += \
222         src/text_font_unifont_data.c
223
224 genunifont_SOURCES = \
225         src/genunifont.c
226
227 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
228         ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
229
230 #
231 # libkmscon-core
232 # This static library contains all the source files used in kmscon. We build
233 # them as separate library to allow linking them to the test programs.
234 # Only "main.c" is not included here as it contains the main() function.
235 #
236
237 libkmscon_core_la_SOURCES = \
238         src/main.h \
239         src/conf.c src/conf.h \
240         src/ui.c src/ui.h \
241         src/console.c src/console.h \
242         src/unicode.c src/unicode.h \
243         src/log.c src/log.h \
244         src/vte.c src/vte.h \
245         src/vte_charsets.c \
246         src/terminal.c src/terminal.h \
247         src/pty.c src/pty.h \
248         src/text.h \
249         src/text.c \
250         src/text_font.c
251 nodist_libkmscon_core_la_SOURCES =
252
253 if KMSCON_HAVE_UNIFONT
254 libkmscon_core_la_SOURCES += \
255         src/text_font_unifont.c
256 nodist_libkmscon_core_la_SOURCES += \
257         src/text_font_unifont_data.c
258 endif
259
260 if KMSCON_HAVE_8X16
261 libkmscon_core_la_SOURCES += \
262         src/text_font_8x16.c
263 endif
264
265 if KMSCON_HAVE_FREETYPE2
266 libkmscon_core_la_SOURCES += \
267         src/text_font_freetype2.c
268 endif
269
270 if KMSCON_HAVE_PANGO
271 libkmscon_core_la_SOURCES += \
272         src/text_font_pango.c
273 endif
274
275 if KMSCON_HAVE_BBLIT
276 libkmscon_core_la_SOURCES += \
277         src/text_bblit.c
278 endif
279
280 if KMSCON_HAVE_BBULK
281 libkmscon_core_la_SOURCES += \
282         src/text_bbulk.c
283 endif
284
285 if KMSCON_HAVE_GLES2
286 libkmscon_core_la_SOURCES += \
287         src/text_gltex.c
288 endif
289
290 libkmscon_core_la_CPPFLAGS = \
291         $(AM_CPPFLAGS) \
292         $(GLES2_CFLAGS) \
293         $(PANGO_CFLAGS) \
294         $(FREETYPE2_CFLAGS)
295 libkmscon_core_la_LIBADD = \
296         $(GLES2_LIBS) \
297         $(PANGO_LIBS) \
298         $(FREETYPE2_LIBS) \
299         -lpthread \
300         libeloop.la \
301         libuterm.la
302
303 #
304 # libkmscon-static
305 # This static library contains all small helpers that are used in several other
306 # libraries and programs that are part of kmscon. To avoid putting these small
307 # pieces into a library and thus having to keep backwards compatibility, we
308 # simply link them statically into all other libraries/programs.
309 #
310
311 libkmscon_static_la_SOURCES = \
312         src/static_llog.h \
313         src/static_dlist.h \
314         src/static_hook.h \
315         src/static_misc.h \
316         src/static_misc.c \
317         external/htable.h \
318         external/htable.c
319 nodist_libkmscon_static_la_SOURCES =
320
321 libkmscon_static_la_CPPFLAGS = \
322         $(AM_CPPFLAGS) \
323         $(GLES2_CFLAGS)
324
325 libkmscon_static_la_LIBADD = \
326         $(GLES2_LIBS)
327
328 if KMSCON_HAVE_GLES2
329 libkmscon_static_la_SOURCES += \
330         src/static_gl.h \
331         src/static_gl_math.c \
332         src/static_gl_shader.c
333 nodist_libkmscon_static_la_SOURCES += \
334         src/static_shaders.c
335 endif
336
337 #
338 # Binaries
339 # These are the sources for the main binaries and test programs. They mostly
340 # consists of a single source file only and include all the libraries that are
341 # built as part of kmscon.
342 #
343
344 kmscon_SOURCES = src/main.c
345 kmscon_LDADD = \
346         libuterm.la \
347         libeloop.la \
348         libkmscon-core.la \
349         libkmscon-static.la
350
351 test_output_SOURCES = tests/test_output.c tests/test_include.h
352 test_output_LDADD = libkmscon-core.la
353
354 test_vt_SOURCES = tests/test_vt.c
355 test_vt_LDADD = libkmscon-core.la
356
357 test_input_SOURCES = tests/test_input.c
358 test_input_LDADD = libkmscon-core.la