2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 ACLOCAL_AMFLAGS = -I m4
15 pkgconfigdir = $(libdir)/pkgconfig
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 # genshader: Program used to convert shaders into C-source files
39 # Make all files include "config.h" by default. This shouldn't cause any
40 # problems and we cannot forget to include it anymore.
42 # Also make the linker discard all unused symbols as we are not building a
45 # When compiling in debug mode, we enable debug symbols so debugging with gdb
46 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
47 # Otherwise, we use standard optimizations -O2.
53 -include $(top_builddir)/config.h \
63 if BUILD_ENABLE_OPTIMIZATIONS
70 # SHL - Static Helper Library
71 # The SHL subsystem contains several small code pieces used all over kmscon and
94 # This library contains the whole event-loop implementation of kmscon. It is
95 # compiled into a separate object to allow using it in several other programs.
99 lib_LTLIBRARIES += libeloop.la
100 include_HEADERS += src/eloop.h
101 pkgconfig_DATA += libeloop.pc
104 libeloop_la_SOURCES = \
112 libeloop_la_SOURCES += \
113 external/dbus-common.h \
114 external/dbus-loop.h \
118 libeloop_la_CPPFLAGS = \
121 libeloop_la_LIBADD = \
123 libeloop_la_LDFLAGS = \
128 # The Terminal-emulator State Machine is a library that implements the whole VTE
129 # layer and everything related to it. It has no external dependencies so it can
130 # be used to implement any kind of terminal emulator or debugger.
134 lib_LTLIBRARIES += libtsm.la
139 pkgconfig_DATA += libtsm.pc
142 libtsm_la_SOURCES = \
153 src/tsm_vte_charsets.c
155 libtsm_la_CPPFLAGS = \
157 libtsm_la_LDFLAGS = \
162 # The uterm library provides helpers to create terminals in user-space. They
163 # are not limited to text-based terminals but rather provide graphics contexts
164 # so arbitrary output can be displayed. Additionally, they provide VT
165 # abstractions and an input layer
168 if BUILD_ENABLE_UTERM
169 lib_LTLIBRARIES += libuterm.la
170 include_HEADERS += src/uterm.h
171 pkgconfig_DATA += libuterm.pc
174 libuterm_la_SOURCES = \
181 src/uterm_monitor.c \
184 src/uterm_input_plain.c \
185 external/imKStoUCS.h \
187 nodist_libuterm_la_SOURCES =
189 libuterm_la_CPPFLAGS = \
198 libuterm_la_LIBADD = \
207 libuterm_la_LDFLAGS = \
210 if BUILD_ENABLE_FBDEV
211 libuterm_la_SOURCES += \
212 src/uterm_video_fbdev.c
216 libuterm_la_SOURCES += \
217 src/uterm_video_drm.c
218 libuterm_la_SOURCES += \
220 src/static_gl_math.c \
221 src/static_gl_shader.c
222 nodist_libuterm_la_SOURCES += \
227 libuterm_la_SOURCES += \
228 src/uterm_video_dumb.c
231 if BUILD_ENABLE_XKBCOMMON
232 libuterm_la_SOURCES += \
233 src/uterm_input_uxkb.c
238 # As there is no need to modify shaders at run-time, we statically compile them
239 # into object files. As autotools would ignore them, we need to add them to
241 # The program that converts the shaders into C-source files is "genshader". It's
242 # pretty simple and just creates a string with the shader source as content.
246 $(srcdir)/src/static_fill.vert \
247 $(srcdir)/src/static_fill.frag \
248 $(srcdir)/src/static_blend.vert \
249 $(srcdir)/src/static_blend.frag \
250 $(srcdir)/src/static_blit.vert \
251 $(srcdir)/src/static_blit.frag \
252 $(srcdir)/src/static_gltex.vert \
253 $(srcdir)/src/static_gltex.frag
260 genshader_SOURCES = \
263 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
264 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
268 # This generates the unifont sources from raw hex-encoded font data.
272 src/text_font_unifont_data.hex
277 src/text_font_unifont_data.c
279 genunifont_SOURCES = \
282 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
283 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
287 # The text-font library is used by kmscon _and_ wlterm but is currently linked
288 # statically as it hasn't been cleaned up entirely.
289 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
292 if BUILD_ENABLE_KMSCON
293 noinst_LTLIBRARIES += libtext-font.la
295 if BUILD_ENABLE_WLTERM
296 noinst_LTLIBRARIES += libtext-font.la
300 libtext_font_la_SOURCES = \
306 nodist_libtext_font_la_SOURCES =
308 if BUILD_ENABLE_UNIFONT
309 libtext_font_la_SOURCES += \
310 src/text_font_unifont.c
311 nodist_libtext_font_la_SOURCES += \
312 src/text_font_unifont_data.c
316 libtext_font_la_SOURCES += \
320 if BUILD_ENABLE_FREETYPE2
321 libtext_font_la_SOURCES += \
322 src/text_font_freetype2.c
325 if BUILD_ENABLE_PANGO
326 libtext_font_la_SOURCES += \
327 src/text_font_pango.c
330 libtext_font_la_CPPFLAGS = \
334 libtext_font_la_LIBADD = \
342 # This static library contains all the source files used in kmscon. We build
343 # them as separate library to allow linking them to the test programs.
344 # Only "main.c" is not included here as it contains the main() function.
347 if BUILD_ENABLE_KMSCON
348 noinst_LTLIBRARIES += libkmscon-core.la
351 libkmscon_core_la_SOURCES = \
359 src/conf.c src/conf.h \
361 src/log.c src/log.h \
362 src/terminal.c src/terminal.h \
363 src/pty.c src/pty.h \
366 nodist_libkmscon_core_la_SOURCES =
368 if BUILD_ENABLE_BBLIT
369 libkmscon_core_la_SOURCES += \
373 if BUILD_ENABLE_BBULK
374 libkmscon_core_la_SOURCES += \
378 if BUILD_ENABLE_GLES2
379 libkmscon_core_la_SOURCES += \
382 src/static_gl_math.c \
383 src/static_gl_shader.c
384 nodist_libkmscon_core_la_SOURCES += \
388 libkmscon_core_la_CPPFLAGS = \
391 libkmscon_core_la_LIBADD = \
400 # These are the sources for the main binaries and test programs. They mostly
401 # consists of a single source file only and include all the libraries that are
402 # built as part of kmscon.
405 if BUILD_ENABLE_KMSCON
406 bin_PROGRAMS += kmscon
423 test_output_SOURCES = tests/test_output.c tests/test_include.h
424 test_output_LDADD = libkmscon-core.la
426 test_vt_SOURCES = tests/test_vt.c
427 test_vt_LDADD = libkmscon-core.la
429 test_input_SOURCES = tests/test_input.c
430 test_input_LDADD = libkmscon-core.la
432 test_key_SOURCES = tests/test_key.c
438 if BUILD_ENABLE_WLTERM
439 bin_PROGRAMS += wlterm