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
99 # This library contains the whole event-loop implementation of kmscon. It is
100 # compiled into a separate object to allow using it in several other programs.
106 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 = \
132 pkgconfig_DATA += libeloop.pc
136 # The uterm library provides helpers to create terminals in user-space. They
137 # are not limited to text-based terminals but rather provide graphics contexts
138 # so arbitrary output can be displayed. Additionally, they provide VT
139 # abstractions and an input layer
145 libuterm_la_SOURCES = \
148 src/uterm_keysyms.h \
152 src/uterm_monitor.c \
155 src/uterm_input_plain.c \
156 external/imKStoUCS.h \
159 libuterm_la_CPPFLAGS = \
168 libuterm_la_LIBADD = \
176 libkmscon-static.la \
178 libuterm_la_LDFLAGS = \
182 libuterm_la_SOURCES += \
183 src/uterm_video_fbdev.c
187 libuterm_la_SOURCES += \
188 src/uterm_video_drm.c
192 libuterm_la_SOURCES += \
193 src/uterm_video_dumb.c
196 if UTERM_HAVE_XKBCOMMON
197 libuterm_la_SOURCES += \
198 src/uterm_input_uxkb.c
205 pkgconfig_DATA += libuterm.pc
209 # As there is no need to modify shaders at run-time, we statically compile them
210 # into object files. As autotools would ignore them, we need to add them to
212 # The program that converts the shaders into C-source files is "genshader". It's
213 # pretty simple and just creates a string with the shader source as content.
217 $(srcdir)/src/static_fill.vert \
218 $(srcdir)/src/static_fill.frag \
219 $(srcdir)/src/static_blend.vert \
220 $(srcdir)/src/static_blend.frag \
221 $(srcdir)/src/static_blit.vert \
222 $(srcdir)/src/static_blit.frag \
223 $(srcdir)/src/static_gltex.vert \
224 $(srcdir)/src/static_gltex.frag
231 genshader_SOURCES = \
234 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
235 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
239 # This generates the unifont sources from raw hex-encoded font data.
243 src/text_font_unifont_data.hex
248 src/text_font_unifont_data.c
250 genunifont_SOURCES = \
253 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
254 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
258 # This static library contains all the source files used in kmscon. We build
259 # them as separate library to allow linking them to the test programs.
260 # Only "main.c" is not included here as it contains the main() function.
263 libkmscon_core_la_SOURCES = \
270 src/conf.c src/conf.h \
272 src/console.c src/console.h \
273 src/unicode.c src/unicode.h \
274 src/log.c src/log.h \
275 src/vte.c src/vte.h \
277 src/terminal.c src/terminal.h \
278 src/pty.c src/pty.h \
282 nodist_libkmscon_core_la_SOURCES =
284 if KMSCON_HAVE_UNIFONT
285 libkmscon_core_la_SOURCES += \
286 src/text_font_unifont.c
287 nodist_libkmscon_core_la_SOURCES += \
288 src/text_font_unifont_data.c
292 libkmscon_core_la_SOURCES += \
296 if KMSCON_HAVE_FREETYPE2
297 libkmscon_core_la_SOURCES += \
298 src/text_font_freetype2.c
302 libkmscon_core_la_SOURCES += \
303 src/text_font_pango.c
307 libkmscon_core_la_SOURCES += \
312 libkmscon_core_la_SOURCES += \
317 libkmscon_core_la_SOURCES += \
321 libkmscon_core_la_CPPFLAGS = \
326 libkmscon_core_la_LIBADD = \
336 # This static library contains all small helpers that are used in several other
337 # libraries and programs that are part of kmscon. To avoid putting these small
338 # pieces into a library and thus having to keep backwards compatibility, we
339 # simply link them statically into all other libraries/programs.
342 libkmscon_static_la_SOURCES = \
345 nodist_libkmscon_static_la_SOURCES =
347 libkmscon_static_la_CPPFLAGS = \
351 libkmscon_static_la_LIBADD = \
355 libkmscon_static_la_SOURCES += \
357 src/static_gl_math.c \
358 src/static_gl_shader.c
359 nodist_libkmscon_static_la_SOURCES += \
365 # These are the sources for the main binaries and test programs. They mostly
366 # consists of a single source file only and include all the libraries that are
367 # built as part of kmscon.
379 test_output_SOURCES = tests/test_output.c tests/test_include.h
380 test_output_LDADD = libkmscon-core.la
382 test_vt_SOURCES = tests/test_vt.c
383 test_vt_LDADD = libkmscon-core.la
385 test_input_SOURCES = tests/test_input.c
386 test_input_LDADD = libkmscon-core.la