2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 ACLOCAL_AMFLAGS = -I m4
15 pkgconfigdir = $(libdir)/pkgconfig
28 # Make all files include "config.h" by default. This shouldn't cause any
29 # problems and we cannot forget to include it anymore.
31 # Also make the linker discard all unused symbols.
33 # When compiling in debug mode, we enable debug symbols so debugging with gdb
34 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
35 # Otherwise, we use standard optimizations -O2.
41 -include $(top_builddir)/config.h \
50 if BUILD_ENABLE_OPTIMIZATIONS
57 # SHL - Static Helper Library
58 # The SHL subsystem contains several small code pieces used all over kmscon and
61 # Simply include $(SHL_*) in your source-file list. Except for SHL_MISC none of
62 # these have external dependencies. SHL_MISC needs xkbcommon.
87 # This library contains the whole event-loop implementation of kmscon. It is
88 # compiled into a separate object to allow using it in several other programs.
92 lib_LTLIBRARIES += libeloop.la
93 include_HEADERS += src/eloop.h
94 pkgconfig_DATA += src/libeloop.pc
97 libeloop_la_SOURCES = \
104 libeloop_la_CPPFLAGS = \
107 libeloop_la_LDFLAGS = \
111 if BUILD_ENABLE_ELOOP_DBUS
112 libeloop_la_SOURCES += \
113 external/dbus-common.h \
114 external/dbus-loop.h \
116 libeloop_la_CPPFLAGS += \
118 libeloop_la_LIBADD += \
124 # The Terminal-emulator State Machine is a library that implements the whole VTE
125 # layer and everything related to it. It has no external dependencies so it can
126 # be used to implement any kind of terminal emulator or debugger.
140 libtsm_la_SOURCES = \
151 src/tsm_vte_charsets.c
153 libtsm_la_CPPFLAGS = \
156 libtsm_la_LDFLAGS = \
162 # The uterm library provides helpers to create terminals in user-space. They
163 # are not limited to text-based terminals but rather provide graphics contexts
164 # so arbitrary output can be displayed. Additionally, they provide VT
165 # abstractions and an input layer
168 if BUILD_ENABLE_UTERM
169 lib_LTLIBRARIES += libuterm.la
170 include_HEADERS += src/uterm.h
171 pkgconfig_DATA += src/libuterm.pc
174 libuterm_la_SOURCES = \
182 src/uterm_monitor.c \
185 src/uterm_input_uxkb.c
187 nodist_libuterm_la_SOURCES =
189 libuterm_la_CPPFLAGS = \
195 libuterm_la_LDFLAGS = \
198 if BUILD_ENABLE_MULTI_SEAT
199 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
200 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
203 if BUILD_ENABLE_HOTPLUG
204 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
205 libuterm_la_LIBADD += $(UDEV_LIBS)
208 if BUILD_ENABLE_VIDEO_FBDEV
209 libuterm_la_SOURCES += src/uterm_video_fbdev.c
212 if BUILD_ENABLE_VIDEO_DUMB
213 libuterm_la_SOURCES += src/uterm_video_dumb.c
214 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
215 libuterm_la_LIBADD += $(DRM_LIBS)
218 if BUILD_ENABLE_VIDEO_DRM
219 libuterm_la_SOURCES += \
220 src/uterm_video_drm.c \
222 src/static_gl_math.c \
223 src/static_gl_shader.c
224 nodist_libuterm_la_SOURCES += \
226 libuterm_la_CPPFLAGS += \
231 libuterm_la_LIBADD += \
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
257 EXTRA_DIST += $(SHADERS)
258 CLEANFILES += src/static_shaders.c
259 genshader_SOURCES = src/genshader.c
261 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
262 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
266 # This generates the unifont sources from raw hex-encoded font data.
269 UNIFONT = src/text_font_unifont_data.hex
271 EXTRA_DIST += $(UNIFONT)
272 CLEANFILES += src/text_font_unifont_data.c
273 genunifont_SOURCES = src/genunifont.c
275 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
276 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
280 # The text-font library is used by kmscon _and_ wlterm but is currently linked
281 # statically as it hasn't been cleaned up entirely.
282 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
285 if BUILD_ENABLE_KMSCON
286 noinst_LTLIBRARIES += libtext-font.la
288 if BUILD_ENABLE_WLTERM
289 noinst_LTLIBRARIES += libtext-font.la
293 libtext_font_la_SOURCES = \
299 nodist_libtext_font_la_SOURCES =
301 libtext_font_la_CPPFLAGS = \
303 libtext_font_la_LIBADD = \
307 if BUILD_ENABLE_FONT_8X16
308 libtext_font_la_SOURCES += src/text_font_8x16.c
311 if BUILD_ENABLE_FONT_UNIFONT
312 libtext_font_la_SOURCES += src/text_font_unifont.c
313 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
316 if BUILD_ENABLE_FONT_FREETYPE2
317 libtext_font_la_SOURCES += src/text_font_freetype2.c
318 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
319 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
322 if BUILD_ENABLE_FONT_PANGO
323 libtext_font_la_SOURCES += src/text_font_pango.c
324 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
325 libtext_font_la_LIBADD += $(PANGO_LIBS)
330 # These are the sources for the main binaries and test programs. They mostly
331 # consists of a single source file only and include all the libraries that are
332 # built as part of kmscon.
335 if BUILD_ENABLE_KMSCON
336 bin_PROGRAMS += kmscon
360 src/kmscon_terminal.h \
362 src/kmscon_compositor.h \
368 nodist_kmscon_SOURCES =
380 if BUILD_ENABLE_SESSION_DUMMY
381 kmscon_SOURCES += src/kmscon_dummy.c
384 if BUILD_ENABLE_SESSION_TERMINAL
385 kmscon_SOURCES += src/kmscon_terminal.c
386 kmscon_LDADD += libtsm.la
389 if BUILD_ENABLE_SESSION_COMPOSITOR
390 kmscon_SOURCES += src/kmscon_compositor.c
391 kmscon_CPPFLAGS += $(WAYLAND_CFLAGS)
392 kmscon_LDADD += $(WAYLAND_LIBS)
395 if BUILD_ENABLE_RENDERER_BBLIT
396 kmscon_SOURCES += src/text_bblit.c
399 if BUILD_ENABLE_RENDERER_BBULK
400 kmscon_SOURCES += src/text_bbulk.c
403 if BUILD_ENABLE_RENDERER_GLTEX
407 src/static_gl_math.c \
408 src/static_gl_shader.c
409 nodist_kmscon_SOURCES += src/static_shaders.c
410 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
411 kmscon_LDADD += $(GLES2_LIBS)
418 if BUILD_ENABLE_WLTERM
419 bin_PROGRAMS += wlterm
457 test_output_SOURCES = \
458 tests/test_include.h \
460 test_output_LDADD = \
463 test_vt_SOURCES = tests/test_vt.c
466 test_input_SOURCES = tests/test_input.c
469 test_key_SOURCES = tests/test_key.c