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.
67 # SHL_MISC needs xkbcommon
68 # SHL_REGISTER needs pthread
96 # This library contains the whole event-loop implementation of kmscon. It is
97 # compiled into a separate object to allow using it in several other programs.
100 if BUILD_ENABLE_ELOOP
101 lib_LTLIBRARIES += libeloop.la
102 include_HEADERS += src/eloop.h
103 pkgconfig_DATA += docs/pc/libeloop.pc
106 libeloop_la_SOURCES = \
113 libeloop_la_CPPFLAGS = \
116 libeloop_la_LDFLAGS = \
120 if BUILD_ENABLE_ELOOP_DBUS
121 libeloop_la_SOURCES += \
122 external/dbus-common.h \
123 external/dbus-loop.h \
125 libeloop_la_CPPFLAGS += \
127 libeloop_la_LIBADD += \
133 # The Terminal-emulator State Machine is a library that implements the whole VTE
134 # layer and everything related to it. It has no external dependencies so it can
135 # be used to implement any kind of terminal emulator or debugger.
149 libtsm_la_SOURCES = \
160 src/tsm_vte_charsets.c \
164 libtsm_la_CPPFLAGS = \
167 libtsm_la_LDFLAGS = \
173 # The uterm library provides helpers to create terminals in user-space. They
174 # are not limited to text-based terminals but rather provide graphics contexts
175 # so arbitrary output can be displayed. Additionally, they provide VT
176 # abstractions and an input layer
179 if BUILD_ENABLE_UTERM
180 lib_LTLIBRARIES += libuterm.la
181 include_HEADERS += src/uterm.h
182 pkgconfig_DATA += docs/pc/libuterm.pc
185 libuterm_la_SOURCES = \
193 src/uterm_systemd.h \
195 src/uterm_monitor.c \
198 src/uterm_input_uxkb.c
200 nodist_libuterm_la_SOURCES =
202 libuterm_la_CPPFLAGS = \
208 libuterm_la_LDFLAGS = \
211 if BUILD_ENABLE_MULTI_SEAT
212 libuterm_la_SOURCES += src/uterm_systemd.c
213 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
214 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
217 if BUILD_ENABLE_HOTPLUG
218 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
219 libuterm_la_LIBADD += $(UDEV_LIBS)
222 if BUILD_ENABLE_PCIACCESS
223 libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
224 libuterm_la_LIBADD += $(PCIACCESS_LIBS)
225 libuterm_la_SOURCES += src/uterm_pci.c
228 if BUILD_ENABLE_VIDEO_FBDEV
229 libuterm_la_SOURCES += src/uterm_video_fbdev.c
232 if BUILD_ENABLE_VIDEO_DUMB
233 libuterm_la_SOURCES += src/uterm_video_dumb.c
234 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
235 libuterm_la_LIBADD += $(DRM_LIBS)
238 if BUILD_ENABLE_VIDEO_DRM
239 libuterm_la_SOURCES += \
240 src/uterm_video_drm.c \
242 src/static_gl_math.c \
243 src/static_gl_shader.c
244 nodist_libuterm_la_SOURCES += \
246 libuterm_la_CPPFLAGS += \
251 libuterm_la_LIBADD += \
260 # As there is no need to modify shaders at run-time, we statically compile them
261 # into object files. As autotools would ignore them, we need to add them to
263 # The program that converts the shaders into C-source files is "genshader". It's
264 # pretty simple and just creates a string with the shader source as content.
268 $(srcdir)/src/static_fill.vert \
269 $(srcdir)/src/static_fill.frag \
270 $(srcdir)/src/static_blend.vert \
271 $(srcdir)/src/static_blend.frag \
272 $(srcdir)/src/static_blit.vert \
273 $(srcdir)/src/static_blit.frag \
274 $(srcdir)/src/static_gltex.vert \
275 $(srcdir)/src/static_gltex.frag
277 EXTRA_DIST += $(SHADERS)
278 CLEANFILES += src/static_shaders.c
279 genshader_SOURCES = src/genshader.c
281 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
282 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
286 # This generates the unifont sources from raw hex-encoded font data.
289 UNIFONT = src/text_font_unifont_data.hex
291 EXTRA_DIST += $(UNIFONT)
292 CLEANFILES += src/text_font_unifont_data.c
293 genunifont_SOURCES = src/genunifont.c
295 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
296 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
300 # The text-font library is used by kmscon _and_ wlterm but is currently linked
301 # statically as it hasn't been cleaned up entirely.
302 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
305 if BUILD_ENABLE_KMSCON
306 noinst_LTLIBRARIES += libtext-font.la
308 if BUILD_ENABLE_WLTERM
309 noinst_LTLIBRARIES += libtext-font.la
313 libtext_font_la_SOURCES = \
319 nodist_libtext_font_la_SOURCES =
321 libtext_font_la_CPPFLAGS = \
323 libtext_font_la_LIBADD = \
327 if BUILD_ENABLE_FONT_8X16
328 libtext_font_la_SOURCES += src/text_font_8x16.c
331 if BUILD_ENABLE_FONT_UNIFONT
332 libtext_font_la_SOURCES += src/text_font_unifont.c
333 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
336 if BUILD_ENABLE_FONT_FREETYPE2
337 libtext_font_la_SOURCES += src/text_font_freetype2.c
338 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
339 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
342 if BUILD_ENABLE_FONT_PANGO
343 libtext_font_la_SOURCES += src/text_font_pango.c
344 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
345 libtext_font_la_LIBADD += $(PANGO_LIBS)
350 # These are the sources for the main binaries and test programs. They mostly
351 # consists of a single source file only and include all the libraries that are
352 # built as part of kmscon.
355 if BUILD_ENABLE_KMSCON
356 bin_PROGRAMS += kmscon
380 src/kmscon_terminal.h \
388 nodist_kmscon_SOURCES =
400 if BUILD_ENABLE_SESSION_DUMMY
401 kmscon_SOURCES += src/kmscon_dummy.c
404 if BUILD_ENABLE_SESSION_TERMINAL
405 kmscon_SOURCES += src/kmscon_terminal.c
406 kmscon_LDADD += libtsm.la
409 if BUILD_ENABLE_SESSION_CDEV
410 kmscon_SOURCES += src/kmscon_cdev.c
411 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
412 kmscon_LDADD += $(FUSE_LIBS)
415 if BUILD_ENABLE_RENDERER_BBLIT
416 kmscon_SOURCES += src/text_bblit.c
419 if BUILD_ENABLE_RENDERER_BBULK
420 kmscon_SOURCES += src/text_bbulk.c
423 if BUILD_ENABLE_RENDERER_GLTEX
427 src/static_gl_math.c \
428 src/static_gl_shader.c
429 nodist_kmscon_SOURCES += src/static_shaders.c
430 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
431 kmscon_LDADD += $(GLES2_LIBS)
432 MANPAGES += docs/man/kmscon.1
439 if BUILD_ENABLE_WLTERM
440 bin_PROGRAMS += wlterm
490 test_output_SOURCES = \
493 test_output_CPPFLAGS = \
496 test_output_LDADD = \
510 test_input_SOURCES = \
513 test_input_CPPFLAGS = \
523 test_key_CPPFLAGS = \
533 MAN_XML_FILES = ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
535 EXTRA_DIST += $(MAN_XML_FILES)
537 if BUILD_HAVE_XSLTPROC
538 if BUILD_HAVE_MANPAGES_STYLESHEET
540 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
541 EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES)
542 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) man_fixup_aliases
545 --stringparam man.authors.section.enabled 0 \
546 --stringparam man.copyright.section.enabled 0 \
547 --stringparam funcsynopsis.style ansi \
548 --stringparam man.output.quietly 1 \
551 XSLTPROC_PROCESS_MAN = \
552 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
553 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) $<
555 man_fixup_aliases: $(MANPAGES) $(MANPAGES_ALIASES)
556 $(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
558 docs/man/%.1: docs/man/%.xml
559 $(XSLTPROC_PROCESS_MAN)
561 docs/man/%.3: docs/man/%.xml
562 $(XSLTPROC_PROCESS_MAN)
564 docs/man/%.5: docs/man/%.xml
565 $(XSLTPROC_PROCESS_MAN)
567 docs/man/%.7: docs/man/%.xml
568 $(XSLTPROC_PROCESS_MAN)
570 endif # BUILD_HAVE_MANPAGES_STYLESHEET
571 endif # BUILD_HAVE_XSLTPROC