2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 ACLOCAL_AMFLAGS = -I m4
15 docs/kmscon@.service \
18 pkgconfigdir = $(libdir)/pkgconfig
33 # Make all files include "config.h" by default. This shouldn't cause any
34 # problems and we cannot forget to include it anymore.
36 # Also make the linker discard all unused symbols.
38 # When compiling in debug mode, we enable debug symbols so debugging with gdb
39 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
40 # Otherwise, we use standard optimizations -O2.
46 -include $(top_builddir)/config.h \
55 if BUILD_ENABLE_OPTIMIZATIONS
62 # SHL - Static Helper Library
63 # The SHL subsystem contains several small code pieces used all over kmscon and
66 # Simply include $(SHL_*) in your source-file list. Except for SHL_MISC none of
67 # these have external dependencies. SHL_MISC needs xkbcommon.
92 # This library contains the whole event-loop implementation of kmscon. It is
93 # compiled into a separate object to allow using it in several other programs.
97 lib_LTLIBRARIES += libeloop.la
98 include_HEADERS += src/eloop.h
99 pkgconfig_DATA += docs/pc/libeloop.pc
102 libeloop_la_SOURCES = \
109 libeloop_la_CPPFLAGS = \
112 libeloop_la_LDFLAGS = \
116 if BUILD_ENABLE_ELOOP_DBUS
117 libeloop_la_SOURCES += \
118 external/dbus-common.h \
119 external/dbus-loop.h \
121 libeloop_la_CPPFLAGS += \
123 libeloop_la_LIBADD += \
129 # The Terminal-emulator State Machine is a library that implements the whole VTE
130 # layer and everything related to it. It has no external dependencies so it can
131 # be used to implement any kind of terminal emulator or debugger.
145 libtsm_la_SOURCES = \
156 src/tsm_vte_charsets.c
158 libtsm_la_CPPFLAGS = \
161 libtsm_la_LDFLAGS = \
167 # The uterm library provides helpers to create terminals in user-space. They
168 # are not limited to text-based terminals but rather provide graphics contexts
169 # so arbitrary output can be displayed. Additionally, they provide VT
170 # abstractions and an input layer
173 if BUILD_ENABLE_UTERM
174 lib_LTLIBRARIES += libuterm.la
175 include_HEADERS += src/uterm.h
176 pkgconfig_DATA += docs/pc/libuterm.pc
179 libuterm_la_SOURCES = \
187 src/uterm_systemd.h \
189 src/uterm_monitor.c \
192 src/uterm_input_uxkb.c
194 nodist_libuterm_la_SOURCES =
196 libuterm_la_CPPFLAGS = \
202 libuterm_la_LDFLAGS = \
205 if BUILD_ENABLE_MULTI_SEAT
206 libuterm_la_SOURCES += src/uterm_systemd.c
207 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
208 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
211 if BUILD_ENABLE_HOTPLUG
212 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
213 libuterm_la_LIBADD += $(UDEV_LIBS)
216 if BUILD_ENABLE_PCIACCESS
217 libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
218 libuterm_la_LIBADD += $(PCIACCESS_LIBS)
219 libuterm_la_SOURCES += src/uterm_pci.c
222 if BUILD_ENABLE_VIDEO_FBDEV
223 libuterm_la_SOURCES += src/uterm_video_fbdev.c
226 if BUILD_ENABLE_VIDEO_DUMB
227 libuterm_la_SOURCES += src/uterm_video_dumb.c
228 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
229 libuterm_la_LIBADD += $(DRM_LIBS)
232 if BUILD_ENABLE_VIDEO_DRM
233 libuterm_la_SOURCES += \
234 src/uterm_video_drm.c \
236 src/static_gl_math.c \
237 src/static_gl_shader.c
238 nodist_libuterm_la_SOURCES += \
240 libuterm_la_CPPFLAGS += \
245 libuterm_la_LIBADD += \
254 # As there is no need to modify shaders at run-time, we statically compile them
255 # into object files. As autotools would ignore them, we need to add them to
257 # The program that converts the shaders into C-source files is "genshader". It's
258 # pretty simple and just creates a string with the shader source as content.
262 $(srcdir)/src/static_fill.vert \
263 $(srcdir)/src/static_fill.frag \
264 $(srcdir)/src/static_blend.vert \
265 $(srcdir)/src/static_blend.frag \
266 $(srcdir)/src/static_blit.vert \
267 $(srcdir)/src/static_blit.frag \
268 $(srcdir)/src/static_gltex.vert \
269 $(srcdir)/src/static_gltex.frag
271 EXTRA_DIST += $(SHADERS)
272 CLEANFILES += src/static_shaders.c
273 genshader_SOURCES = src/genshader.c
275 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
276 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
280 # This generates the unifont sources from raw hex-encoded font data.
283 UNIFONT = src/text_font_unifont_data.hex
285 EXTRA_DIST += $(UNIFONT)
286 CLEANFILES += src/text_font_unifont_data.c
287 genunifont_SOURCES = src/genunifont.c
289 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
290 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
294 # The text-font library is used by kmscon _and_ wlterm but is currently linked
295 # statically as it hasn't been cleaned up entirely.
296 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
299 if BUILD_ENABLE_KMSCON
300 noinst_LTLIBRARIES += libtext-font.la
302 if BUILD_ENABLE_WLTERM
303 noinst_LTLIBRARIES += libtext-font.la
307 libtext_font_la_SOURCES = \
313 nodist_libtext_font_la_SOURCES =
315 libtext_font_la_CPPFLAGS = \
317 libtext_font_la_LIBADD = \
321 if BUILD_ENABLE_FONT_8X16
322 libtext_font_la_SOURCES += src/text_font_8x16.c
325 if BUILD_ENABLE_FONT_UNIFONT
326 libtext_font_la_SOURCES += src/text_font_unifont.c
327 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
330 if BUILD_ENABLE_FONT_FREETYPE2
331 libtext_font_la_SOURCES += src/text_font_freetype2.c
332 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
333 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
336 if BUILD_ENABLE_FONT_PANGO
337 libtext_font_la_SOURCES += src/text_font_pango.c
338 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
339 libtext_font_la_LIBADD += $(PANGO_LIBS)
344 # These are the sources for the main binaries and test programs. They mostly
345 # consists of a single source file only and include all the libraries that are
346 # built as part of kmscon.
349 if BUILD_ENABLE_KMSCON
350 bin_PROGRAMS += kmscon
374 src/kmscon_terminal.h \
382 nodist_kmscon_SOURCES =
394 if BUILD_ENABLE_SESSION_DUMMY
395 kmscon_SOURCES += src/kmscon_dummy.c
398 if BUILD_ENABLE_SESSION_TERMINAL
399 kmscon_SOURCES += src/kmscon_terminal.c
400 kmscon_LDADD += libtsm.la
403 if BUILD_ENABLE_SESSION_CDEV
404 kmscon_SOURCES += src/kmscon_cdev.c
405 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
406 kmscon_LDADD += $(FUSE_LIBS)
409 if BUILD_ENABLE_RENDERER_BBLIT
410 kmscon_SOURCES += src/text_bblit.c
413 if BUILD_ENABLE_RENDERER_BBULK
414 kmscon_SOURCES += src/text_bbulk.c
417 if BUILD_ENABLE_RENDERER_GLTEX
421 src/static_gl_math.c \
422 src/static_gl_shader.c
423 nodist_kmscon_SOURCES += src/static_shaders.c
424 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
425 kmscon_LDADD += $(GLES2_LIBS)
426 MANPAGES += docs/man/kmscon.1
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 = \
527 MAN_XML_FILES = ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
529 EXTRA_DIST += $(MAN_XML_FILES)
531 if BUILD_HAVE_XSLTPROC
532 if BUILD_HAVE_MANPAGES_STYLESHEET
534 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
535 EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES)
536 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) man_fixup_aliases
539 --stringparam man.authors.section.enabled 0 \
540 --stringparam man.copyright.section.enabled 0 \
541 --stringparam funcsynopsis.style ansi \
542 --stringparam man.output.quietly 1 \
545 XSLTPROC_PROCESS_MAN = \
546 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
547 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) $<
549 man_fixup_aliases: $(MANPAGES) $(MANPAGES_ALIASES)
550 $(AM_V_GEN)if test -n "$(MANPAGES_ALIASES)" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES) ; fi
552 docs/man/%.1: docs/man/%.xml
553 $(XSLTPROC_PROCESS_MAN)
555 docs/man/%.3: docs/man/%.xml
556 $(XSLTPROC_PROCESS_MAN)
558 docs/man/%.5: docs/man/%.xml
559 $(XSLTPROC_PROCESS_MAN)
561 docs/man/%.7: docs/man/%.xml
562 $(XSLTPROC_PROCESS_MAN)
564 endif # BUILD_HAVE_MANPAGES_STYLESHEET
565 endif # BUILD_HAVE_XSLTPROC