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 = \
183 src/uterm_monitor.c \
186 src/uterm_input_uxkb.c
188 nodist_libuterm_la_SOURCES =
190 libuterm_la_CPPFLAGS = \
196 libuterm_la_LDFLAGS = \
199 if BUILD_ENABLE_MULTI_SEAT
200 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
201 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
204 if BUILD_ENABLE_HOTPLUG
205 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
206 libuterm_la_LIBADD += $(UDEV_LIBS)
209 if BUILD_ENABLE_PCIACCESS
210 libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
211 libuterm_la_LIBADD += $(PCIACCESS_LIBS)
212 libuterm_la_SOURCES += src/uterm_pci.c
215 if BUILD_ENABLE_VIDEO_FBDEV
216 libuterm_la_SOURCES += src/uterm_video_fbdev.c
219 if BUILD_ENABLE_VIDEO_DUMB
220 libuterm_la_SOURCES += src/uterm_video_dumb.c
221 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
222 libuterm_la_LIBADD += $(DRM_LIBS)
225 if BUILD_ENABLE_VIDEO_DRM
226 libuterm_la_SOURCES += \
227 src/uterm_video_drm.c \
229 src/static_gl_math.c \
230 src/static_gl_shader.c
231 nodist_libuterm_la_SOURCES += \
233 libuterm_la_CPPFLAGS += \
238 libuterm_la_LIBADD += \
247 # As there is no need to modify shaders at run-time, we statically compile them
248 # into object files. As autotools would ignore them, we need to add them to
250 # The program that converts the shaders into C-source files is "genshader". It's
251 # pretty simple and just creates a string with the shader source as content.
255 $(srcdir)/src/static_fill.vert \
256 $(srcdir)/src/static_fill.frag \
257 $(srcdir)/src/static_blend.vert \
258 $(srcdir)/src/static_blend.frag \
259 $(srcdir)/src/static_blit.vert \
260 $(srcdir)/src/static_blit.frag \
261 $(srcdir)/src/static_gltex.vert \
262 $(srcdir)/src/static_gltex.frag
264 EXTRA_DIST += $(SHADERS)
265 CLEANFILES += src/static_shaders.c
266 genshader_SOURCES = src/genshader.c
268 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
269 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
273 # This generates the unifont sources from raw hex-encoded font data.
276 UNIFONT = src/text_font_unifont_data.hex
278 EXTRA_DIST += $(UNIFONT)
279 CLEANFILES += src/text_font_unifont_data.c
280 genunifont_SOURCES = src/genunifont.c
282 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
283 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
287 # The text-font library is used by kmscon _and_ wlterm but is currently linked
288 # statically as it hasn't been cleaned up entirely.
289 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
292 if BUILD_ENABLE_KMSCON
293 noinst_LTLIBRARIES += libtext-font.la
295 if BUILD_ENABLE_WLTERM
296 noinst_LTLIBRARIES += libtext-font.la
300 libtext_font_la_SOURCES = \
306 nodist_libtext_font_la_SOURCES =
308 libtext_font_la_CPPFLAGS = \
310 libtext_font_la_LIBADD = \
314 if BUILD_ENABLE_FONT_8X16
315 libtext_font_la_SOURCES += src/text_font_8x16.c
318 if BUILD_ENABLE_FONT_UNIFONT
319 libtext_font_la_SOURCES += src/text_font_unifont.c
320 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
323 if BUILD_ENABLE_FONT_FREETYPE2
324 libtext_font_la_SOURCES += src/text_font_freetype2.c
325 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
326 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
329 if BUILD_ENABLE_FONT_PANGO
330 libtext_font_la_SOURCES += src/text_font_pango.c
331 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
332 libtext_font_la_LIBADD += $(PANGO_LIBS)
337 # These are the sources for the main binaries and test programs. They mostly
338 # consists of a single source file only and include all the libraries that are
339 # built as part of kmscon.
342 if BUILD_ENABLE_KMSCON
343 bin_PROGRAMS += kmscon
367 src/kmscon_terminal.h \
369 src/kmscon_compositor.h \
375 nodist_kmscon_SOURCES =
387 if BUILD_ENABLE_SESSION_DUMMY
388 kmscon_SOURCES += src/kmscon_dummy.c
391 if BUILD_ENABLE_SESSION_TERMINAL
392 kmscon_SOURCES += src/kmscon_terminal.c
393 kmscon_LDADD += libtsm.la
396 if BUILD_ENABLE_SESSION_CDEV
397 kmscon_SOURCES += src/kmscon_cdev.c
398 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
399 kmscon_LDADD += $(FUSE_LIBS)
402 if BUILD_ENABLE_SESSION_COMPOSITOR
403 kmscon_SOURCES += src/kmscon_compositor.c
404 kmscon_CPPFLAGS += $(WAYLAND_CFLAGS)
405 kmscon_LDADD += $(WAYLAND_LIBS)
408 if BUILD_ENABLE_RENDERER_BBLIT
409 kmscon_SOURCES += src/text_bblit.c
412 if BUILD_ENABLE_RENDERER_BBULK
413 kmscon_SOURCES += src/text_bbulk.c
416 if BUILD_ENABLE_RENDERER_GLTEX
420 src/static_gl_math.c \
421 src/static_gl_shader.c
422 nodist_kmscon_SOURCES += src/static_shaders.c
423 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
424 kmscon_LDADD += $(GLES2_LIBS)
431 if BUILD_ENABLE_WLTERM
432 bin_PROGRAMS += wlterm
470 test_output_SOURCES = \
471 tests/test_include.h \
473 test_output_LDADD = \
476 test_vt_SOURCES = tests/test_vt.c
479 test_input_SOURCES = tests/test_input.c
482 test_key_SOURCES = tests/test_key.c