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
96 # This library contains the whole event-loop implementation of kmscon. It is
97 # compiled into a separate object to allow using it in several other programs.
100 if BUILD_ENABLE_ELOOP
101 lib_LTLIBRARIES += libeloop.la
102 include_HEADERS += src/eloop.h
103 pkgconfig_DATA += libeloop.pc
106 libeloop_la_SOURCES = \
114 libeloop_la_SOURCES += \
115 external/dbus-common.h \
116 external/dbus-loop.h \
120 libeloop_la_CPPFLAGS = \
123 libeloop_la_LIBADD = \
125 libeloop_la_LDFLAGS = \
130 # The Terminal-emulator State Machine is a library that implements the whole VTE
131 # layer and everything related to it. It has no external dependencies so it can
132 # be used to implement any kind of terminal emulator or debugger.
136 lib_LTLIBRARIES += libtsm.la
141 pkgconfig_DATA += libtsm.pc
144 libtsm_la_SOURCES = \
155 src/tsm_vte_charsets.c
157 libtsm_la_CPPFLAGS = \
160 libtsm_la_LDFLAGS = \
166 # The uterm library provides helpers to create terminals in user-space. They
167 # are not limited to text-based terminals but rather provide graphics contexts
168 # so arbitrary output can be displayed. Additionally, they provide VT
169 # abstractions and an input layer
172 if BUILD_ENABLE_UTERM
173 lib_LTLIBRARIES += libuterm.la
174 include_HEADERS += src/uterm.h
175 pkgconfig_DATA += libuterm.pc
178 libuterm_la_SOURCES = \
186 src/uterm_monitor.c \
189 src/uterm_input_uxkb.c \
190 src/uterm_input_plain.c \
191 external/imKStoUCS.h \
193 nodist_libuterm_la_SOURCES =
195 libuterm_la_CPPFLAGS = \
204 libuterm_la_LIBADD = \
213 libuterm_la_LDFLAGS = \
216 if BUILD_ENABLE_FBDEV
217 libuterm_la_SOURCES += \
218 src/uterm_video_fbdev.c
222 libuterm_la_SOURCES += \
223 src/uterm_video_drm.c
224 libuterm_la_SOURCES += \
226 src/static_gl_math.c \
227 src/static_gl_shader.c
228 nodist_libuterm_la_SOURCES += \
233 libuterm_la_SOURCES += \
234 src/uterm_video_dumb.c
239 # As there is no need to modify shaders at run-time, we statically compile them
240 # into object files. As autotools would ignore them, we need to add them to
242 # The program that converts the shaders into C-source files is "genshader". It's
243 # pretty simple and just creates a string with the shader source as content.
247 $(srcdir)/src/static_fill.vert \
248 $(srcdir)/src/static_fill.frag \
249 $(srcdir)/src/static_blend.vert \
250 $(srcdir)/src/static_blend.frag \
251 $(srcdir)/src/static_blit.vert \
252 $(srcdir)/src/static_blit.frag \
253 $(srcdir)/src/static_gltex.vert \
254 $(srcdir)/src/static_gltex.frag
261 genshader_SOURCES = \
264 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
265 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
269 # This generates the unifont sources from raw hex-encoded font data.
273 src/text_font_unifont_data.hex
278 src/text_font_unifont_data.c
280 genunifont_SOURCES = \
283 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
284 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
288 # The text-font library is used by kmscon _and_ wlterm but is currently linked
289 # statically as it hasn't been cleaned up entirely.
290 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
293 if BUILD_ENABLE_KMSCON
294 noinst_LTLIBRARIES += libtext-font.la
296 if BUILD_ENABLE_WLTERM
297 noinst_LTLIBRARIES += libtext-font.la
301 libtext_font_la_SOURCES = \
307 nodist_libtext_font_la_SOURCES =
309 if BUILD_ENABLE_UNIFONT
310 libtext_font_la_SOURCES += \
311 src/text_font_unifont.c
312 nodist_libtext_font_la_SOURCES += \
313 src/text_font_unifont_data.c
317 libtext_font_la_SOURCES += \
321 if BUILD_ENABLE_FREETYPE2
322 libtext_font_la_SOURCES += \
323 src/text_font_freetype2.c
326 if BUILD_ENABLE_PANGO
327 libtext_font_la_SOURCES += \
328 src/text_font_pango.c
331 libtext_font_la_CPPFLAGS = \
335 libtext_font_la_LIBADD = \
343 # This static library contains all the source files used in kmscon. We build
344 # them as separate library to allow linking them to the test programs.
345 # Only "main.c" is not included here as it contains the main() function.
348 if BUILD_ENABLE_KMSCON
349 noinst_LTLIBRARIES += libkmscon-core.la
352 libkmscon_core_la_SOURCES = \
361 src/conf.c src/conf.h \
363 src/log.c src/log.h \
364 src/terminal.c src/terminal.h \
365 src/pty.c src/pty.h \
368 nodist_libkmscon_core_la_SOURCES =
370 if BUILD_ENABLE_BBLIT
371 libkmscon_core_la_SOURCES += \
375 if BUILD_ENABLE_BBULK
376 libkmscon_core_la_SOURCES += \
380 if BUILD_ENABLE_GLES2
381 libkmscon_core_la_SOURCES += \
384 src/static_gl_math.c \
385 src/static_gl_shader.c
386 nodist_libkmscon_core_la_SOURCES += \
390 libkmscon_core_la_CPPFLAGS = \
394 libkmscon_core_la_LIBADD = \
404 # These are the sources for the main binaries and test programs. They mostly
405 # consists of a single source file only and include all the libraries that are
406 # built as part of kmscon.
409 if BUILD_ENABLE_KMSCON
410 bin_PROGRAMS += kmscon
432 test_output_SOURCES = tests/test_output.c tests/test_include.h
433 test_output_LDADD = libkmscon-core.la
435 test_vt_SOURCES = tests/test_vt.c
436 test_vt_LDADD = libkmscon-core.la
438 test_input_SOURCES = tests/test_input.c
439 test_input_LDADD = libkmscon-core.la
441 test_key_SOURCES = tests/test_key.c
447 if BUILD_ENABLE_WLTERM
448 bin_PROGRAMS += wlterm