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 += docs/pc/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 += docs/pc/libuterm.pc
174 libuterm_la_SOURCES = \
182 src/uterm_systemd.h \
184 src/uterm_monitor.c \
187 src/uterm_input_uxkb.c
189 nodist_libuterm_la_SOURCES =
191 libuterm_la_CPPFLAGS = \
197 libuterm_la_LDFLAGS = \
200 if BUILD_ENABLE_MULTI_SEAT
201 libuterm_la_SOURCES += src/uterm_systemd.c
202 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
203 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
206 if BUILD_ENABLE_HOTPLUG
207 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
208 libuterm_la_LIBADD += $(UDEV_LIBS)
211 if BUILD_ENABLE_PCIACCESS
212 libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
213 libuterm_la_LIBADD += $(PCIACCESS_LIBS)
214 libuterm_la_SOURCES += src/uterm_pci.c
217 if BUILD_ENABLE_VIDEO_FBDEV
218 libuterm_la_SOURCES += src/uterm_video_fbdev.c
221 if BUILD_ENABLE_VIDEO_DUMB
222 libuterm_la_SOURCES += src/uterm_video_dumb.c
223 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
224 libuterm_la_LIBADD += $(DRM_LIBS)
227 if BUILD_ENABLE_VIDEO_DRM
228 libuterm_la_SOURCES += \
229 src/uterm_video_drm.c \
231 src/static_gl_math.c \
232 src/static_gl_shader.c
233 nodist_libuterm_la_SOURCES += \
235 libuterm_la_CPPFLAGS += \
240 libuterm_la_LIBADD += \
249 # As there is no need to modify shaders at run-time, we statically compile them
250 # into object files. As autotools would ignore them, we need to add them to
252 # The program that converts the shaders into C-source files is "genshader". It's
253 # pretty simple and just creates a string with the shader source as content.
257 $(srcdir)/src/static_fill.vert \
258 $(srcdir)/src/static_fill.frag \
259 $(srcdir)/src/static_blend.vert \
260 $(srcdir)/src/static_blend.frag \
261 $(srcdir)/src/static_blit.vert \
262 $(srcdir)/src/static_blit.frag \
263 $(srcdir)/src/static_gltex.vert \
264 $(srcdir)/src/static_gltex.frag
266 EXTRA_DIST += $(SHADERS)
267 CLEANFILES += src/static_shaders.c
268 genshader_SOURCES = src/genshader.c
270 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
271 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
275 # This generates the unifont sources from raw hex-encoded font data.
278 UNIFONT = src/text_font_unifont_data.hex
280 EXTRA_DIST += $(UNIFONT)
281 CLEANFILES += src/text_font_unifont_data.c
282 genunifont_SOURCES = src/genunifont.c
284 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
285 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
289 # The text-font library is used by kmscon _and_ wlterm but is currently linked
290 # statically as it hasn't been cleaned up entirely.
291 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
294 if BUILD_ENABLE_KMSCON
295 noinst_LTLIBRARIES += libtext-font.la
297 if BUILD_ENABLE_WLTERM
298 noinst_LTLIBRARIES += libtext-font.la
302 libtext_font_la_SOURCES = \
308 nodist_libtext_font_la_SOURCES =
310 libtext_font_la_CPPFLAGS = \
312 libtext_font_la_LIBADD = \
316 if BUILD_ENABLE_FONT_8X16
317 libtext_font_la_SOURCES += src/text_font_8x16.c
320 if BUILD_ENABLE_FONT_UNIFONT
321 libtext_font_la_SOURCES += src/text_font_unifont.c
322 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
325 if BUILD_ENABLE_FONT_FREETYPE2
326 libtext_font_la_SOURCES += src/text_font_freetype2.c
327 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
328 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
331 if BUILD_ENABLE_FONT_PANGO
332 libtext_font_la_SOURCES += src/text_font_pango.c
333 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
334 libtext_font_la_LIBADD += $(PANGO_LIBS)
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 if BUILD_ENABLE_KMSCON
345 bin_PROGRAMS += kmscon
369 src/kmscon_terminal.h \
371 src/kmscon_compositor.h \
377 nodist_kmscon_SOURCES =
389 if BUILD_ENABLE_SESSION_DUMMY
390 kmscon_SOURCES += src/kmscon_dummy.c
393 if BUILD_ENABLE_SESSION_TERMINAL
394 kmscon_SOURCES += src/kmscon_terminal.c
395 kmscon_LDADD += libtsm.la
398 if BUILD_ENABLE_SESSION_CDEV
399 kmscon_SOURCES += src/kmscon_cdev.c
400 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
401 kmscon_LDADD += $(FUSE_LIBS)
404 if BUILD_ENABLE_SESSION_COMPOSITOR
405 kmscon_SOURCES += src/kmscon_compositor.c
406 kmscon_CPPFLAGS += $(WAYLAND_CFLAGS)
407 kmscon_LDADD += $(WAYLAND_LIBS)
410 if BUILD_ENABLE_RENDERER_BBLIT
411 kmscon_SOURCES += src/text_bblit.c
414 if BUILD_ENABLE_RENDERER_BBULK
415 kmscon_SOURCES += src/text_bbulk.c
418 if BUILD_ENABLE_RENDERER_GLTEX
422 src/static_gl_math.c \
423 src/static_gl_shader.c
424 nodist_kmscon_SOURCES += src/static_shaders.c
425 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
426 kmscon_LDADD += $(GLES2_LIBS)
433 if BUILD_ENABLE_WLTERM
434 bin_PROGRAMS += wlterm
484 test_output_SOURCES = \
487 test_output_CPPFLAGS = \
490 test_output_LDADD = \
504 test_input_SOURCES = \
507 test_input_CPPFLAGS = \
517 test_key_CPPFLAGS = \