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
97 # This library contains the whole event-loop implementation of kmscon. It is
98 # compiled into a separate object to allow using it in several other programs.
101 if BUILD_ENABLE_ELOOP
102 lib_LTLIBRARIES += libeloop.la
103 include_HEADERS += src/eloop.h
104 pkgconfig_DATA += libeloop.pc
107 libeloop_la_SOURCES = \
115 libeloop_la_SOURCES += \
116 external/dbus-common.h \
117 external/dbus-loop.h \
121 libeloop_la_CPPFLAGS = \
124 libeloop_la_LIBADD = \
126 libeloop_la_LDFLAGS = \
131 # The Terminal-emulator State Machine is a library that implements the whole VTE
132 # layer and everything related to it. It has no external dependencies so it can
133 # be used to implement any kind of terminal emulator or debugger.
137 lib_LTLIBRARIES += libtsm.la
142 pkgconfig_DATA += libtsm.pc
145 libtsm_la_SOURCES = \
156 src/tsm_vte_charsets.c
158 libtsm_la_CPPFLAGS = \
161 libtsm_la_LDFLAGS = \
167 # The uterm library provides helpers to create terminals in user-space. They
168 # are not limited to text-based terminals but rather provide graphics contexts
169 # so arbitrary output can be displayed. Additionally, they provide VT
170 # abstractions and an input layer
173 if BUILD_ENABLE_UTERM
174 lib_LTLIBRARIES += libuterm.la
175 include_HEADERS += src/uterm.h
176 pkgconfig_DATA += libuterm.pc
179 libuterm_la_SOURCES = \
187 src/uterm_monitor.c \
190 src/uterm_input_uxkb.c \
191 src/uterm_input_plain.c \
192 external/imKStoUCS.h \
194 nodist_libuterm_la_SOURCES =
196 libuterm_la_CPPFLAGS = \
205 libuterm_la_LIBADD = \
214 libuterm_la_LDFLAGS = \
217 if BUILD_ENABLE_FBDEV
218 libuterm_la_SOURCES += \
219 src/uterm_video_fbdev.c
223 libuterm_la_SOURCES += \
224 src/uterm_video_drm.c
225 libuterm_la_SOURCES += \
227 src/static_gl_math.c \
228 src/static_gl_shader.c
229 nodist_libuterm_la_SOURCES += \
234 libuterm_la_SOURCES += \
235 src/uterm_video_dumb.c
240 # As there is no need to modify shaders at run-time, we statically compile them
241 # into object files. As autotools would ignore them, we need to add them to
243 # The program that converts the shaders into C-source files is "genshader". It's
244 # pretty simple and just creates a string with the shader source as content.
248 $(srcdir)/src/static_fill.vert \
249 $(srcdir)/src/static_fill.frag \
250 $(srcdir)/src/static_blend.vert \
251 $(srcdir)/src/static_blend.frag \
252 $(srcdir)/src/static_blit.vert \
253 $(srcdir)/src/static_blit.frag \
254 $(srcdir)/src/static_gltex.vert \
255 $(srcdir)/src/static_gltex.frag
262 genshader_SOURCES = \
265 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
266 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
270 # This generates the unifont sources from raw hex-encoded font data.
274 src/text_font_unifont_data.hex
279 src/text_font_unifont_data.c
281 genunifont_SOURCES = \
284 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
285 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
289 # The text-font library is used by kmscon _and_ wlterm but is currently linked
290 # statically as it hasn't been cleaned up entirely.
291 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
294 if BUILD_ENABLE_KMSCON
295 noinst_LTLIBRARIES += libtext-font.la
297 if BUILD_ENABLE_WLTERM
298 noinst_LTLIBRARIES += libtext-font.la
302 libtext_font_la_SOURCES = \
308 nodist_libtext_font_la_SOURCES =
310 if BUILD_ENABLE_UNIFONT
311 libtext_font_la_SOURCES += \
312 src/text_font_unifont.c
313 nodist_libtext_font_la_SOURCES += \
314 src/text_font_unifont_data.c
318 libtext_font_la_SOURCES += \
322 if BUILD_ENABLE_FREETYPE2
323 libtext_font_la_SOURCES += \
324 src/text_font_freetype2.c
327 if BUILD_ENABLE_PANGO
328 libtext_font_la_SOURCES += \
329 src/text_font_pango.c
332 libtext_font_la_CPPFLAGS = \
336 libtext_font_la_LIBADD = \
344 # This static library contains all the source files used in kmscon. We build
345 # them as separate library to allow linking them to the test programs.
346 # Only "main.c" is not included here as it contains the main() function.
349 if BUILD_ENABLE_KMSCON
350 noinst_LTLIBRARIES += libkmscon-core.la
353 libkmscon_core_la_SOURCES = \
362 src/conf.c src/conf.h \
364 src/log.c src/log.h \
365 src/terminal.c src/terminal.h \
366 src/pty.c src/pty.h \
369 nodist_libkmscon_core_la_SOURCES =
371 if BUILD_ENABLE_BBLIT
372 libkmscon_core_la_SOURCES += \
376 if BUILD_ENABLE_BBULK
377 libkmscon_core_la_SOURCES += \
381 if BUILD_ENABLE_GLES2
382 libkmscon_core_la_SOURCES += \
385 src/static_gl_math.c \
386 src/static_gl_shader.c
387 nodist_libkmscon_core_la_SOURCES += \
391 libkmscon_core_la_CPPFLAGS = \
395 libkmscon_core_la_LIBADD = \
406 # These are the sources for the main binaries and test programs. They mostly
407 # consists of a single source file only and include all the libraries that are
408 # built as part of kmscon.
411 if BUILD_ENABLE_KMSCON
412 bin_PROGRAMS += kmscon
434 test_output_SOURCES = tests/test_output.c tests/test_include.h
435 test_output_LDADD = libkmscon-core.la
437 test_vt_SOURCES = tests/test_vt.c
438 test_vt_LDADD = libkmscon-core.la
440 test_input_SOURCES = tests/test_input.c
441 test_input_LDADD = libkmscon-core.la
443 test_key_SOURCES = tests/test_key.c
449 if BUILD_ENABLE_WLTERM
450 bin_PROGRAMS += wlterm