2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 ACLOCAL_AMFLAGS = -I m4
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
39 noinst_LTLIBRARIES = \
48 # Make all files include "config.h" by default. This shouldn't cause any
49 # problems and we cannot forget to include it anymore.
51 # Also make the linker discard all unused symbols as we are not building a
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.
62 -include $(top_builddir)/config.h \
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
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.
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 \
102 nodist_genshader_SOURCES = \
105 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
106 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
110 # This generates the unifont sources from raw hex-encoded font data.
114 src/text_font_unifont_data.hex
119 src/text_font_unifont_data.c
121 nodist_genunifont_SOURCES = \
124 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
125 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
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.
134 libkmscon_core_la_SOURCES = \
136 src/conf.c src/conf.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 \
143 src/terminal.c src/terminal.h \
144 src/pty.c src/pty.h \
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
157 libkmscon_core_la_SOURCES += \
161 if KMSCON_HAVE_FREETYPE2
162 libkmscon_core_la_SOURCES += \
163 src/text_font_freetype2.c
167 libkmscon_core_la_SOURCES += \
168 src/text_font_pango.c
172 libkmscon_core_la_SOURCES += \
177 libkmscon_core_la_SOURCES += \
182 libkmscon_core_la_SOURCES += \
186 libkmscon_core_la_CPPFLAGS = \
191 libkmscon_core_la_LIBADD = \
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
207 libuterm_la_SOURCES = \
209 src/uterm_internal.h \
211 src/uterm_monitor.c \
214 src/uterm_input_plain.c \
215 external/imKStoUCS.h \
218 libuterm_la_CPPFLAGS = \
227 libuterm_la_LIBADD = \
235 libkmscon-static.la \
237 libuterm_la_LDFLAGS = \
241 libuterm_la_SOURCES += \
242 src/uterm_video_fbdev.c
246 libuterm_la_SOURCES += \
247 src/uterm_video_drm.c
251 libuterm_la_SOURCES += \
252 src/uterm_video_dumb.c
255 if UTERM_HAVE_XKBCOMMON
256 libuterm_la_SOURCES += \
257 src/uterm_input_uxkb.c
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.
269 libeloop_la_SOURCES = \
274 libeloop_la_SOURCES += \
275 external/dbus-loop.h \
279 libeloop_la_CPPFLAGS = \
282 libeloop_la_LIBADD = \
283 libkmscon-static.la \
285 libeloop_la_LDFLAGS = \
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.
299 libkmscon_static_la_SOURCES = \
306 libkmscon_static_la_CPPFLAGS = \
310 libkmscon_static_la_LIBADD = \
314 nodist_libkmscon_static_la_SOURCES = \
316 src/static_gl_math.c \
317 src/static_gl_shader.c \
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.
328 kmscon_SOURCES = src/main.c
335 test_output_SOURCES = tests/test_output.c tests/test_include.h
336 test_output_LDADD = libkmscon-core.la
338 test_vt_SOURCES = tests/test_vt.c
339 test_vt_LDADD = libkmscon-core.la
341 test_input_SOURCES = tests/test_input.c
342 test_input_LDADD = libkmscon-core.la
344 fakevt_SOURCES = tools/fakevt.c
345 fakevt_LDADD = libkmscon-core.la