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