2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 ACLOCAL_AMFLAGS = -I m4
15 pkgconfigdir = $(libdir)/pkgconfig
30 # Make all files include "config.h" by default. This shouldn't cause any
31 # problems and we cannot forget to include it anymore.
33 # Also make the linker discard all unused symbols.
35 # When compiling in debug mode, we enable debug symbols so debugging with gdb
36 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
37 # Otherwise, we use standard optimizations -O2.
43 -include $(top_builddir)/config.h \
52 if BUILD_ENABLE_OPTIMIZATIONS
59 # SHL - Static Helper Library
60 # The SHL subsystem contains several small code pieces used all over kmscon and
63 # Simply include $(SHL_*) in your source-file list. Except for SHL_MISC none of
64 # these have external dependencies. SHL_MISC needs xkbcommon.
89 # This library contains the whole event-loop implementation of kmscon. It is
90 # compiled into a separate object to allow using it in several other programs.
94 lib_LTLIBRARIES += libeloop.la
95 include_HEADERS += src/eloop.h
96 pkgconfig_DATA += docs/pc/libeloop.pc
99 libeloop_la_SOURCES = \
106 libeloop_la_CPPFLAGS = \
109 libeloop_la_LDFLAGS = \
113 if BUILD_ENABLE_ELOOP_DBUS
114 libeloop_la_SOURCES += \
115 external/dbus-common.h \
116 external/dbus-loop.h \
118 libeloop_la_CPPFLAGS += \
120 libeloop_la_LIBADD += \
126 # The Terminal-emulator State Machine is a library that implements the whole VTE
127 # layer and everything related to it. It has no external dependencies so it can
128 # be used to implement any kind of terminal emulator or debugger.
142 libtsm_la_SOURCES = \
153 src/tsm_vte_charsets.c
155 libtsm_la_CPPFLAGS = \
158 libtsm_la_LDFLAGS = \
164 # The uterm library provides helpers to create terminals in user-space. They
165 # are not limited to text-based terminals but rather provide graphics contexts
166 # so arbitrary output can be displayed. Additionally, they provide VT
167 # abstractions and an input layer
170 if BUILD_ENABLE_UTERM
171 lib_LTLIBRARIES += libuterm.la
172 include_HEADERS += src/uterm.h
173 pkgconfig_DATA += docs/pc/libuterm.pc
176 libuterm_la_SOURCES = \
184 src/uterm_systemd.h \
186 src/uterm_monitor.c \
189 src/uterm_input_uxkb.c
191 nodist_libuterm_la_SOURCES =
193 libuterm_la_CPPFLAGS = \
199 libuterm_la_LDFLAGS = \
202 if BUILD_ENABLE_MULTI_SEAT
203 libuterm_la_SOURCES += src/uterm_systemd.c
204 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
205 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
208 if BUILD_ENABLE_HOTPLUG
209 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
210 libuterm_la_LIBADD += $(UDEV_LIBS)
213 if BUILD_ENABLE_PCIACCESS
214 libuterm_la_CPPFLAGS += $(PCIACCESS_CFLAGS)
215 libuterm_la_LIBADD += $(PCIACCESS_LIBS)
216 libuterm_la_SOURCES += src/uterm_pci.c
219 if BUILD_ENABLE_VIDEO_FBDEV
220 libuterm_la_SOURCES += src/uterm_video_fbdev.c
223 if BUILD_ENABLE_VIDEO_DUMB
224 libuterm_la_SOURCES += src/uterm_video_dumb.c
225 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
226 libuterm_la_LIBADD += $(DRM_LIBS)
229 if BUILD_ENABLE_VIDEO_DRM
230 libuterm_la_SOURCES += \
231 src/uterm_video_drm.c \
233 src/static_gl_math.c \
234 src/static_gl_shader.c
235 nodist_libuterm_la_SOURCES += \
237 libuterm_la_CPPFLAGS += \
242 libuterm_la_LIBADD += \
251 # As there is no need to modify shaders at run-time, we statically compile them
252 # into object files. As autotools would ignore them, we need to add them to
254 # The program that converts the shaders into C-source files is "genshader". It's
255 # pretty simple and just creates a string with the shader source as content.
259 $(srcdir)/src/static_fill.vert \
260 $(srcdir)/src/static_fill.frag \
261 $(srcdir)/src/static_blend.vert \
262 $(srcdir)/src/static_blend.frag \
263 $(srcdir)/src/static_blit.vert \
264 $(srcdir)/src/static_blit.frag \
265 $(srcdir)/src/static_gltex.vert \
266 $(srcdir)/src/static_gltex.frag
268 EXTRA_DIST += $(SHADERS)
269 CLEANFILES += src/static_shaders.c
270 genshader_SOURCES = src/genshader.c
272 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
273 $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
277 # This generates the unifont sources from raw hex-encoded font data.
280 UNIFONT = src/text_font_unifont_data.hex
282 EXTRA_DIST += $(UNIFONT)
283 CLEANFILES += src/text_font_unifont_data.c
284 genunifont_SOURCES = src/genunifont.c
286 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
287 $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
291 # The text-font library is used by kmscon _and_ wlterm but is currently linked
292 # statically as it hasn't been cleaned up entirely.
293 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
296 if BUILD_ENABLE_KMSCON
297 noinst_LTLIBRARIES += libtext-font.la
299 if BUILD_ENABLE_WLTERM
300 noinst_LTLIBRARIES += libtext-font.la
304 libtext_font_la_SOURCES = \
310 nodist_libtext_font_la_SOURCES =
312 libtext_font_la_CPPFLAGS = \
314 libtext_font_la_LIBADD = \
318 if BUILD_ENABLE_FONT_8X16
319 libtext_font_la_SOURCES += src/text_font_8x16.c
322 if BUILD_ENABLE_FONT_UNIFONT
323 libtext_font_la_SOURCES += src/text_font_unifont.c
324 nodist_libtext_font_la_SOURCES += src/text_font_unifont_data.c
327 if BUILD_ENABLE_FONT_FREETYPE2
328 libtext_font_la_SOURCES += src/text_font_freetype2.c
329 libtext_font_la_CPPFLAGS += $(FREETYPE2_CFLAGS)
330 libtext_font_la_LIBADD += $(FREETYPE2_LIBS)
333 if BUILD_ENABLE_FONT_PANGO
334 libtext_font_la_SOURCES += src/text_font_pango.c
335 libtext_font_la_CPPFLAGS += $(PANGO_CFLAGS)
336 libtext_font_la_LIBADD += $(PANGO_LIBS)
341 # These are the sources for the main binaries and test programs. They mostly
342 # consists of a single source file only and include all the libraries that are
343 # built as part of kmscon.
346 if BUILD_ENABLE_KMSCON
347 bin_PROGRAMS += kmscon
371 src/kmscon_terminal.h \
379 nodist_kmscon_SOURCES =
391 if BUILD_ENABLE_SESSION_DUMMY
392 kmscon_SOURCES += src/kmscon_dummy.c
395 if BUILD_ENABLE_SESSION_TERMINAL
396 kmscon_SOURCES += src/kmscon_terminal.c
397 kmscon_LDADD += libtsm.la
400 if BUILD_ENABLE_SESSION_CDEV
401 kmscon_SOURCES += src/kmscon_cdev.c
402 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
403 kmscon_LDADD += $(FUSE_LIBS)
406 if BUILD_ENABLE_RENDERER_BBLIT
407 kmscon_SOURCES += src/text_bblit.c
410 if BUILD_ENABLE_RENDERER_BBULK
411 kmscon_SOURCES += src/text_bbulk.c
414 if BUILD_ENABLE_RENDERER_GLTEX
418 src/static_gl_math.c \
419 src/static_gl_shader.c
420 nodist_kmscon_SOURCES += src/static_shaders.c
421 kmscon_CPPFLAGS += $(GLES2_CFLAGS)
422 kmscon_LDADD += $(GLES2_LIBS)
423 MANPAGES += docs/man/kmscon.1
430 if BUILD_ENABLE_WLTERM
431 bin_PROGRAMS += wlterm
481 test_output_SOURCES = \
484 test_output_CPPFLAGS = \
487 test_output_LDADD = \
501 test_input_SOURCES = \
504 test_input_CPPFLAGS = \
514 test_key_CPPFLAGS = \
524 MAN_XML_FILES = ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
527 if BUILD_HAVE_XSLTPROC
528 if BUILD_HAVE_MANPAGES_STYLESHEET
530 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
531 EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES)
532 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) man_fixup_aliases
535 --stringparam man.authors.section.enabled 0 \
536 --stringparam man.copyright.section.enabled 0 \
537 --stringparam funcsynopsis.style ansi \
538 --stringparam man.output.quietly 1 \
541 XSLTPROC_PROCESS_MAN = \
542 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
543 $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) $<
545 man_fixup_aliases: $(MANPAGES) $(MANPAGES_ALIASES)
546 $(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
548 docs/man/%.1: docs/man/%.xml
549 $(XSLTPROC_PROCESS_MAN)
551 docs/man/%.3: docs/man/%.xml
552 $(XSLTPROC_PROCESS_MAN)
554 docs/man/%.5: docs/man/%.xml
555 $(XSLTPROC_PROCESS_MAN)
557 docs/man/%.7: docs/man/%.xml
558 $(XSLTPROC_PROCESS_MAN)
560 endif # BUILD_HAVE_MANPAGES_STYLESHEET
561 endif # BUILD_HAVE_XSLTPROC