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 \
78 # This library contains the whole event-loop implementation of kmscon. It is
79 # compiled into a separate object to allow using it in several other programs.
85 libeloop_la_SOURCES = \
93 libeloop_la_SOURCES += \
94 external/dbus-common.h \
95 external/dbus-loop.h \
99 libeloop_la_CPPFLAGS = \
102 libeloop_la_LIBADD = \
104 libeloop_la_LDFLAGS = \
110 pkgconfig_DATA += libeloop.pc
114 # The uterm library provides helpers to create terminals in user-space. They
115 # are not limited to text-based terminals but rather provide graphics contexts
116 # so arbitrary output can be displayed. Additionally, they provide VT
117 # abstractions and an input layer
123 libuterm_la_SOURCES = \
125 src/uterm_internal.h \
127 src/uterm_monitor.c \
130 src/uterm_input_plain.c \
131 external/imKStoUCS.h \
134 libuterm_la_CPPFLAGS = \
143 libuterm_la_LIBADD = \
151 libkmscon-static.la \
153 libuterm_la_LDFLAGS = \
157 libuterm_la_SOURCES += \
158 src/uterm_video_fbdev.c
162 libuterm_la_SOURCES += \
163 src/uterm_video_drm.c
167 libuterm_la_SOURCES += \
168 src/uterm_video_dumb.c
171 if UTERM_HAVE_XKBCOMMON
172 libuterm_la_SOURCES += \
173 src/uterm_input_uxkb.c
179 pkgconfig_DATA += libuterm.pc
183 # As there is no need to modify shaders at run-time, we statically compile them
184 # into object files. As autotools would ignore them, we need to add them to
186 # The program that converts the shaders into C-source files is "genshader". It's
187 # pretty simple and just creates a string with the shader source as content.
191 $(srcdir)/src/static_fill.vert \
192 $(srcdir)/src/static_fill.frag \
193 $(srcdir)/src/static_blend.vert \
194 $(srcdir)/src/static_blend.frag \
195 $(srcdir)/src/static_blit.vert \
196 $(srcdir)/src/static_blit.frag \
197 $(srcdir)/src/static_gltex.vert \
198 $(srcdir)/src/static_gltex.frag
205 genshader_SOURCES = \
208 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
209 ./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
213 # This generates the unifont sources from raw hex-encoded font data.
217 src/text_font_unifont_data.hex
222 src/text_font_unifont_data.c
224 genunifont_SOURCES = \
227 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
228 ./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
232 # This static library contains all the source files used in kmscon. We build
233 # them as separate library to allow linking them to the test programs.
234 # Only "main.c" is not included here as it contains the main() function.
237 libkmscon_core_la_SOURCES = \
239 src/conf.c src/conf.h \
241 src/console.c src/console.h \
242 src/unicode.c src/unicode.h \
243 src/log.c src/log.h \
244 src/vte.c src/vte.h \
246 src/terminal.c src/terminal.h \
247 src/pty.c src/pty.h \
251 nodist_libkmscon_core_la_SOURCES =
253 if KMSCON_HAVE_UNIFONT
254 libkmscon_core_la_SOURCES += \
255 src/text_font_unifont.c
256 nodist_libkmscon_core_la_SOURCES += \
257 src/text_font_unifont_data.c
261 libkmscon_core_la_SOURCES += \
265 if KMSCON_HAVE_FREETYPE2
266 libkmscon_core_la_SOURCES += \
267 src/text_font_freetype2.c
271 libkmscon_core_la_SOURCES += \
272 src/text_font_pango.c
276 libkmscon_core_la_SOURCES += \
281 libkmscon_core_la_SOURCES += \
286 libkmscon_core_la_SOURCES += \
290 libkmscon_core_la_CPPFLAGS = \
295 libkmscon_core_la_LIBADD = \
305 # This static library contains all small helpers that are used in several other
306 # libraries and programs that are part of kmscon. To avoid putting these small
307 # pieces into a library and thus having to keep backwards compatibility, we
308 # simply link them statically into all other libraries/programs.
311 libkmscon_static_la_SOURCES = \
319 nodist_libkmscon_static_la_SOURCES =
321 libkmscon_static_la_CPPFLAGS = \
325 libkmscon_static_la_LIBADD = \
329 libkmscon_static_la_SOURCES += \
331 src/static_gl_math.c \
332 src/static_gl_shader.c
333 nodist_libkmscon_static_la_SOURCES += \
339 # These are the sources for the main binaries and test programs. They mostly
340 # consists of a single source file only and include all the libraries that are
341 # built as part of kmscon.
344 kmscon_SOURCES = src/main.c
351 test_output_SOURCES = tests/test_output.c tests/test_include.h
352 test_output_LDADD = libkmscon-core.la
354 test_vt_SOURCES = tests/test_vt.c
355 test_vt_LDADD = libkmscon-core.la
357 test_input_SOURCES = tests/test_input.c
358 test_input_LDADD = libkmscon-core.la