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 # libkmscon-static: Static library for all subsystems
27 # genshader: Program used to convert shaders into C-source files
39 noinst_LTLIBRARIES = \
46 # Make all files include "config.h" by default. This shouldn't cause any
47 # problems and we cannot forget to include it anymore.
49 # Also make the linker discard all unused symbols as we are not building a
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.
60 -include $(top_builddir)/config.h \
77 # SHL - Static Helper Library
78 # 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.
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 = \
129 pkgconfig_DATA += libeloop.pc
133 # The uterm library provides helpers to create terminals in user-space. They
134 # are not limited to text-based terminals but rather provide graphics contexts
135 # so arbitrary output can be displayed. Additionally, they provide VT
136 # abstractions and an input layer
142 libuterm_la_SOURCES = \
145 src/uterm_keysyms.h \
149 src/uterm_monitor.c \
152 src/uterm_input_plain.c \
153 external/imKStoUCS.h \
156 libuterm_la_CPPFLAGS = \
165 libuterm_la_LIBADD = \
173 libkmscon-static.la \
175 libuterm_la_LDFLAGS = \
179 libuterm_la_SOURCES += \
180 src/uterm_video_fbdev.c
184 libuterm_la_SOURCES += \
185 src/uterm_video_drm.c
189 libuterm_la_SOURCES += \
190 src/uterm_video_dumb.c
193 if UTERM_HAVE_XKBCOMMON
194 libuterm_la_SOURCES += \
195 src/uterm_input_uxkb.c
202 pkgconfig_DATA += libuterm.pc
206 # As there is no need to modify shaders at run-time, we statically compile them
207 # into object files. As autotools would ignore them, we need to add them to
209 # The program that converts the shaders into C-source files is "genshader". It's
210 # pretty simple and just creates a string with the shader source as content.
214 $(srcdir)/src/static_fill.vert \
215 $(srcdir)/src/static_fill.frag \
216 $(srcdir)/src/static_blend.vert \
217 $(srcdir)/src/static_blend.frag \
218 $(srcdir)/src/static_blit.vert \
219 $(srcdir)/src/static_blit.frag \
220 $(srcdir)/src/static_gltex.vert \
221 $(srcdir)/src/static_gltex.frag
228 genshader_SOURCES = \
231 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
232 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
236 # This generates the unifont sources from raw hex-encoded font data.
240 src/text_font_unifont_data.hex
245 src/text_font_unifont_data.c
247 genunifont_SOURCES = \
250 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
251 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
255 # This static library contains all the source files used in kmscon. We build
256 # them as separate library to allow linking them to the test programs.
257 # Only "main.c" is not included here as it contains the main() function.
260 libkmscon_core_la_SOURCES = \
267 src/conf.c src/conf.h \
269 src/console.c src/console.h \
270 src/unicode.c src/unicode.h \
271 src/log.c src/log.h \
272 src/vte.c src/vte.h \
274 src/terminal.c src/terminal.h \
275 src/pty.c src/pty.h \
279 nodist_libkmscon_core_la_SOURCES =
281 if KMSCON_HAVE_UNIFONT
282 libkmscon_core_la_SOURCES += \
283 src/text_font_unifont.c
284 nodist_libkmscon_core_la_SOURCES += \
285 src/text_font_unifont_data.c
289 libkmscon_core_la_SOURCES += \
293 if KMSCON_HAVE_FREETYPE2
294 libkmscon_core_la_SOURCES += \
295 src/text_font_freetype2.c
299 libkmscon_core_la_SOURCES += \
300 src/text_font_pango.c
304 libkmscon_core_la_SOURCES += \
309 libkmscon_core_la_SOURCES += \
314 libkmscon_core_la_SOURCES += \
318 libkmscon_core_la_CPPFLAGS = \
323 libkmscon_core_la_LIBADD = \
333 # This static library contains all small helpers that are used in several other
334 # libraries and programs that are part of kmscon. To avoid putting these small
335 # pieces into a library and thus having to keep backwards compatibility, we
336 # simply link them statically into all other libraries/programs.
339 libkmscon_static_la_SOURCES = \
342 nodist_libkmscon_static_la_SOURCES =
344 libkmscon_static_la_CPPFLAGS = \
348 libkmscon_static_la_LIBADD = \
352 libkmscon_static_la_SOURCES += \
354 src/static_gl_math.c \
355 src/static_gl_shader.c
356 nodist_libkmscon_static_la_SOURCES += \
362 # These are the sources for the main binaries and test programs. They mostly
363 # consists of a single source file only and include all the libraries that are
364 # built as part of kmscon.
376 test_output_SOURCES = tests/test_output.c tests/test_include.h
377 test_output_LDADD = libkmscon-core.la
379 test_vt_SOURCES = tests/test_vt.c
380 test_vt_LDADD = libkmscon-core.la
382 test_input_SOURCES = tests/test_input.c
383 test_input_LDADD = libkmscon-core.la