kmscon: remove cdev sessions
[platform/upstream/kmscon.git] / Makefile.am
1 #
2 # Kmscon - Global Makefile
3 # Copyright (c) 2012-2013 David Herrmann <dh.herrmann@googlemail.com>
4 #
5
6 #
7 # Library Version Numbers
8 #
9
10 LIBELOOP_CURRENT = 1
11 LIBELOOP_REVISION = 0
12 LIBELOOP_AGE = 0
13
14 LIBTSM_CURRENT = 1
15 LIBTSM_REVISION = 0
16 LIBTSM_AGE = 0
17
18 LIBUVT_CURRENT = 1
19 LIBUVT_REVISION = 0
20 LIBUVT_AGE = 0
21
22 LIBUTERM_CURRENT = 1
23 LIBUTERM_REVISION = 0
24 LIBUTERM_AGE = 0
25
26 #
27 # Global Configurations and Initializations
28 #
29
30 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
31 AM_MAKEFLAGS = --no-print-directory
32 AUTOMAKE_OPTIONS = color-tests
33 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-all
34
35 SUBDIRS = .
36
37 .DELETE_ON_ERROR:
38
39 include_HEADERS =
40 EXTRA_DIST = \
41         README \
42         COPYING \
43         NEWS \
44         docs/kmscon.service \
45         docs/kmsconvt@.service \
46         docs/pc/libeloop.pc.in \
47         docs/pc/libtsm.pc.in \
48         docs/pc/libuvt.pc.in \
49         docs/pc/libuterm.pc.in \
50         docs/sym/libeloop.sym \
51         docs/sym/libtsm.sym \
52         docs/sym/libuvt.sym \
53         docs/sym/libuterm.sym
54 CLEANFILES =
55 pkgconfigdir = $(libdir)/pkgconfig
56 pkgconfig_DATA =
57 MANPAGES =
58 MANPAGES_ALIASES =
59 TPHONY =
60
61 bin_PROGRAMS =
62 check_PROGRAMS =
63 noinst_PROGRAMS =
64 lib_LTLIBRARIES =
65 noinst_LTLIBRARIES =
66
67 moduledir = $(libdir)/kmscon
68 module_LTLIBRARIES =
69
70 #
71 # Default CFlags
72 # Make all files include "config.h" by default. This shouldn't cause any
73 # problems and we cannot forget to include it anymore.
74 #
75 # Also make the linker discard all unused symbols.
76 #
77 # When compiling in debug mode, we enable debug symbols so debugging with gdb
78 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
79 # Otherwise, we use standard optimizations -O2.
80 #
81
82 AM_CFLAGS = \
83         -Wall \
84         -pipe \
85         -fno-common \
86         -ffast-math \
87         -fdiagnostics-show-option \
88         -fno-strict-aliasing \
89         -fvisibility=hidden \
90         -ffunction-sections \
91         -fdata-sections \
92         -fstack-protector
93 AM_CPPFLAGS = \
94         -DBUILD_MODULE_DIR='"$(moduledir)"' \
95         -include $(top_builddir)/config.h \
96         -I $(srcdir)/src
97 AM_LDFLAGS = \
98         -Wl,--as-needed \
99         -Wl,--gc-sections \
100         -Wl,-z,relro \
101         -Wl,-z,now
102
103 if BUILD_ENABLE_DEBUG
104 AM_CFLAGS += -g
105 endif
106
107 if BUILD_ENABLE_OPTIMIZATIONS
108 AM_CFLAGS += -O2
109 else
110 AM_CFLAGS += -O0
111 endif
112
113 #
114 # GIT-HEAD helper
115 # The file ./src/shl_githead.c contains a constant "shl_git_head" which is
116 # defined to the string returned by "git describe". We need to adjust this
117 # string for every build and correctly rebuild any sources that depend on it.
118 # Therefore, you should use this file rarely as it causes rebuilds on every
119 # git-commit.
120 #
121 # We have a helper-script ./src/genversion.sh that takes as argument the source
122 # file and creates it if necessary. It updates it only if the new git-describe
123 # string is different to the old one. So the file is only modified on changes.
124 # Hence, we can use it as normal dependency in this Makefile.
125 # However, we need to run this script on _every_ "make" invocation before any
126 # recipy is executed. To achieve this, we use $(shell ...) and assign it to a
127 # "simply expanded" variable (:=) so the shell command is executed on
128 # variable-declaration and not during expansion.
129 #
130 # Note that we must not clean ./src/shl_githead.c ever! If we would, a
131 # distribution tarball might delete that file and have no way to recreate it.
132 # We could delete it on something like "make maintainerclean", but then again,
133 # it seems unnecessary so lets simply not clean it at all.
134 #
135 # If the helper-script is executed in a directory that is not a git-repository
136 # (like a distribution tarball) and shl_githead.c exists, then it does nothing
137 # as it expects shl_githead.c to be correctly written by "make dist".
138 # However, if shl_githead.c does not exist, it will print a warning and write
139 # an unknown random git-revision.
140 # This guarantees, that shl_githead.c is always present and has the most correct
141 # value that we can get under any conditions.
142 #
143 # The $(emptyvariable) expansion below is used for broken $(shell ...)
144 # syntax-highlighting algorithms in many existing editors.
145 #
146
147 EXTRA_DIST += src/genversion.sh
148 GITHEAD:=$(shell $(emptyvariable)"$(srcdir)/src/genversion.sh" "$(srcdir)/src/shl_githead.c")
149
150 #
151 # Binary File Compiler
152 # This target gets as input a binary file *.bin and produces an ELF/etc. output
153 # object file *.bin.o and the corresponding libtool file *.bin.lo.
154 # Note that we fake the libtool object files as there is no way to make libtool
155 # create it. The comments in the .lo file are mandatory so don't remove them!
156 #
157
158 CLEANFILES += src/*.bin.lo src/*.bin.o
159
160 src/%.bin.lo: src/%.bin
161         $(AM_V_GEN)$(LD) -r -o "src/$*.bin.o" -z noexecstack --format=binary "$<"
162         $(AM_V_at)echo "# $@ - a libtool object file" >"$@"
163         $(AM_V_at)echo "# Generated by $(shell $(LIBTOOL) --version | head -n 1)" >>"$@"
164         $(AM_V_at)echo "#" >>"$@"
165         $(AM_V_at)echo "# Please DO NOT delete this file!" >>"$@"
166         $(AM_V_at)echo "# It is necessary for linking the library." >>"$@"
167         $(AM_V_at)echo >>"$@"
168         $(AM_V_at)echo "# Name of the PIC object." >>"$@"
169         $(AM_V_at)echo "pic_object='$*.bin.o'" >>"$@"
170         $(AM_V_at)echo >>"$@"
171         $(AM_V_at)echo "# Name of the non-PIC object" >>"$@"
172         $(AM_V_at)echo "non_pic_object='$*.bin.o'" >>"$@"
173         $(AM_V_at)echo >>"$@"
174
175 #
176 # SHL - Static Helper Library
177 # The SHL subsystem contains several small code pieces used all over kmscon and
178 # other applications.
179 #
180
181 noinst_LTLIBRARIES += libshl.la
182
183 libshl_la_SOURCES = \
184         src/shl_githead.h \
185         src/shl_githead.c \
186         src/shl_dlist.h \
187         src/shl_array.h \
188         src/shl_hashtable.h \
189         external/htable.h \
190         external/htable.c \
191         src/shl_ring.h \
192         src/shl_timer.h \
193         src/shl_llog.h \
194         src/shl_log.h \
195         src/shl_log.c \
196         src/shl_hook.h \
197         src/shl_misc.h \
198         src/shl_register.h \
199         src/shl_flagset.h
200 libshl_la_CPPFLAGS = \
201         $(AM_CPPFLAGS) \
202         $(XKBCOMMON_CFLAGS) \
203         -pthread
204 libshl_la_LDFLAGS = \
205         $(AM_LDFLAGS) \
206         -pthread
207 libshl_la_LIBADD = \
208         $(AM_LIBADD) \
209         $(XKBCOMMON_LIBS)
210
211 #
212 # libeloop
213 # This library contains the whole event-loop implementation of kmscon. It is
214 # compiled into a separate object to allow using it in several other programs.
215 #
216
217 if BUILD_ENABLE_ELOOP
218 lib_LTLIBRARIES += libeloop.la
219 include_HEADERS += src/eloop.h
220 pkgconfig_DATA += docs/pc/libeloop.pc
221 endif
222
223 libeloop_la_SOURCES = \
224         src/eloop.h \
225         src/eloop.c
226
227 libeloop_la_LIBADD = libshl.la
228 libeloop_la_CPPFLAGS = $(AM_CPPFLAGS)
229 EXTRA_libeloop_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libeloop.sym
230 libeloop_la_LDFLAGS = \
231         $(AM_LDFLAGS) \
232         -version-info $(LIBELOOP_CURRENT):$(LIBELOOP_REVISION):$(LIBELOOP_AGE) \
233         -Wl,--version-script=$(top_srcdir)/docs/sym/libeloop.sym
234
235
236 if BUILD_ENABLE_ELOOP_DBUS
237 libeloop_la_SOURCES += \
238         external/dbus-common.h \
239         external/dbus-loop.h \
240         external/dbus-loop.c
241 libeloop_la_CPPFLAGS += $(DBUS_CFLAGS)
242 libeloop_la_LIBADD += $(DBUS_LIBS)
243 endif
244
245 #
246 # libtsm
247 # The Terminal-emulator State Machine is a library that implements the whole VTE
248 # layer and everything related to it. It has no external dependencies so it can
249 # be used to implement any kind of terminal emulator or debugger.
250 #
251
252 if BUILD_ENABLE_TSM
253 lib_LTLIBRARIES += libtsm.la
254 include_HEADERS += \
255         src/tsm_screen.h \
256         src/tsm_unicode.h \
257         src/tsm_vte.h
258 pkgconfig_DATA += docs/pc/libtsm.pc
259 endif
260
261 libtsm_la_SOURCES = \
262         src/tsm_screen.h \
263         src/tsm_screen.c \
264         src/tsm_unicode.h \
265         src/tsm_unicode.c \
266         src/tsm_vte.h \
267         src/tsm_vte.c \
268         src/tsm_vte_charsets.c \
269         external/wcwidth.h \
270         external/wcwidth.c
271
272 libtsm_la_CPPFLAGS = \
273         $(AM_CPPFLAGS) \
274         $(XKBCOMMON_CFLAGS)
275 libtsm_la_LIBADD = \
276         $(XKBCOMMON_LIBS) \
277         libshl.la
278 EXTRA_libtsm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libtsm.sym
279 libtsm_la_LDFLAGS = \
280         $(AM_LDFLAGS) \
281         -version-info $(LIBTSM_CURRENT):$(LIBTSM_REVISION):$(LIBTSM_AGE) \
282         -Wl,--version-script="$(top_srcdir)/docs/sym/libtsm.sym"
283
284 #
285 # libuvt
286 # Implementation of Virtual Terminals in user-space with the help of CUSE/FUSE
287 # so we can provide character-device drivers in user-space. Aims to be 100%
288 # compatible but also provides many other use-cases.
289 #
290
291 if BUILD_ENABLE_UVT
292 lib_LTLIBRARIES += libuvt.la
293 include_HEADERS += src/uvt.h
294 pkgconfig_DATA += docs/pc/libuvt.pc
295 endif
296
297 libuvt_la_SOURCES = \
298         src/uvt.h \
299         src/uvt_internal.h \
300         src/uvt_ctx.c \
301         src/uvt_cdev.c \
302         src/uvt_client.c \
303         src/uvt_tty_null.c
304 libuvt_la_CPPFLAGS = \
305         $(AM_CPPFLAGS) \
306         $(FUSE_CFLAGS) \
307         -DFUSE_USE_VERSION=29
308 libuvt_la_LIBADD = \
309         $(FUSE_LIBS) \
310         libshl.la
311 EXTRA_libuvt_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuvt.sym
312 libuvt_la_LDFLAGS = \
313         $(AM_LDFLAGS) \
314         -version-info $(LIBUVT_CURRENT):$(LIBUVT_REVISION):$(LIBUVT_AGE) \
315         -Wl,--version-script="$(top_srcdir)/docs/sym/libuvt.sym"
316
317 #
318 # libuterm
319 # The uterm library provides helpers to create terminals in user-space. They
320 # are not limited to text-based terminals but rather provide graphics contexts
321 # so arbitrary output can be displayed. Additionally, they provide VT
322 # abstractions and an input layer
323 #
324
325 if BUILD_ENABLE_UTERM
326 lib_LTLIBRARIES += libuterm.la
327 include_HEADERS += \
328         src/uterm_input.h \
329         src/uterm_monitor.h \
330         src/uterm_video.h \
331         src/uterm_vt.h
332 pkgconfig_DATA += docs/pc/libuterm.pc
333 endif
334
335 libuterm_la_SOURCES = \
336         src/uterm_input.h \
337         src/uterm_monitor.h \
338         src/uterm_video.h \
339         src/uterm_vt.h \
340         src/uterm_input_internal.h \
341         src/uterm_video_internal.h \
342         src/uterm_systemd_internal.h \
343         src/uterm_video.c \
344         src/uterm_monitor.c \
345         src/uterm_vt.c \
346         src/uterm_input.c \
347         src/uterm_input_uxkb.c
348
349 nodist_libuterm_la_SOURCES =
350
351 libuterm_la_CPPFLAGS = \
352         $(AM_CPPFLAGS) \
353         $(XKBCOMMON_CFLAGS)
354 libuterm_la_LIBADD = \
355         $(XKBCOMMON_LIBS) \
356         libeloop.la \
357         libshl.la
358 EXTRA_libuterm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuterm.sym
359 libuterm_la_LDFLAGS = \
360         $(AM_LDFLAGS) \
361         -version-info $(LIBUTERM_CURRENT):$(LIBUTERM_REVISION):$(LIBUTERM_AGE) \
362         -Wl,--version-script="$(top_srcdir)/docs/sym/libuterm.sym"
363
364 if BUILD_ENABLE_MULTI_SEAT
365 libuterm_la_SOURCES += src/uterm_systemd.c
366 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
367 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
368 endif
369
370 if BUILD_ENABLE_HOTPLUG
371 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
372 libuterm_la_LIBADD += $(UDEV_LIBS)
373 endif
374
375 if BUILD_ENABLE_VIDEO_FBDEV
376 libuterm_la_SOURCES += \
377         src/uterm_fbdev_internal.h \
378         src/uterm_fbdev_video.c \
379         src/uterm_fbdev_render.c
380 endif
381
382 if BUILD_ENABLE_VIDEO_DRM2D
383 libuterm_la_SOURCES += \
384         src/uterm_drm2d_internal.h \
385         src/uterm_drm2d_video.c \
386         src/uterm_drm2d_render.c
387 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
388 libuterm_la_LIBADD += $(DRM_LIBS)
389 endif
390
391 if BUILD_ENABLE_VIDEO_DRM3D
392 noinst_PROGRAMS += genshader
393 libuterm_la_SOURCES += \
394         src/uterm_drm3d_internal.h \
395         src/uterm_drm3d_video.c \
396         src/uterm_drm3d_render.c \
397         src/static_gl.h \
398         src/static_gl_math.c \
399         src/static_gl_shader.c
400 nodist_libuterm_la_SOURCES += src/static_shaders.c
401 libuterm_la_CPPFLAGS += \
402         $(DRM_CFLAGS) \
403         $(EGL_CFLAGS) \
404         $(GBM_CFLAGS) \
405         $(GLES2_CFLAGS)
406 libuterm_la_LIBADD += \
407         $(DRM_LIBS) \
408         $(EGL_LIBS) \
409         $(GBM_LIBS) \
410         $(GLES2_LIBS)
411 endif
412
413 # add shared sources only once
414 UTERM_DRM_SHARED_SRC = \
415         src/uterm_drm_shared_internal.h \
416         src/uterm_drm_shared.c
417 if BUILD_ENABLE_VIDEO_DRM2D
418 libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
419 else
420 if BUILD_ENABLE_VIDEO_DRM3D
421 libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
422 endif
423 endif
424
425 #
426 # Shaders
427 # As there is no need to modify shaders at run-time, we statically compile them
428 # into object files. As autotools would ignore them, we need to add them to
429 # EXTRA_DIST.
430 # The program that converts the shaders into C-source files is "genshader". It's
431 # pretty simple and just creates a string with the shader source as content.
432 #
433
434 SHADERS = \
435         $(srcdir)/src/static_fill.vert \
436         $(srcdir)/src/static_fill.frag \
437         $(srcdir)/src/static_blend.vert \
438         $(srcdir)/src/static_blend.frag \
439         $(srcdir)/src/static_blit.vert \
440         $(srcdir)/src/static_blit.frag \
441         $(srcdir)/src/static_gltex.vert \
442         $(srcdir)/src/static_gltex.frag
443
444 EXTRA_DIST += $(SHADERS)
445 CLEANFILES += src/static_shaders.c
446 genshader_SOURCES = src/genshader.c
447
448 # TODO: Using $(BUILD_EXEEXT) breaks if it doesn't equal $(EXEEXT). But stupid
449 # automake doesn't allow $(EXEEXT) so lets just rely on both being the same.
450
451 src/static_shaders.c: $(SHADERS) genshader$(BUILD_EXEEXT)
452         $(AM_V_GEN)./genshader$(BUILD_EXEEXT) src/static_shaders.c $(SHADERS)
453
454 genshader$(BUILD_EXEEXT) $(genshader_OBJECTS): CC = $(CC_FOR_BUILD)
455 genshader$(BUILD_EXEEXT) $(genshader_OBJECTS): CFLAGS = $(CFLAGS_FOR_BUILD)
456 genshader$(BUILD_EXEEXT): LDFLAGS = $(LDFLAGS_FOR_BUILD)
457
458 #
459 # Unifont Generator
460 # This generates the unifont sources from raw hex-encoded font data.
461 #
462
463 UNIFONT = $(top_srcdir)/src/font_unifont_data.hex
464 UNIFONT_BIN = src/font_unifont_data.bin
465 UNIFONT_LT = src/font_unifont_data.bin.lo
466
467 EXTRA_DIST += $(UNIFONT)
468 CLEANFILES += $(UNIFONT_BIN)
469 genunifont_SOURCES = src/genunifont.c
470
471 genunifont$(BUILD_EXEEXT) $(genunifont_OBJECTS): CC = $(CC_FOR_BUILD)
472 genunifont$(BUILD_EXEEXT) $(genunifont_OBJECTS): CFLAGS = $(CFLAGS_FOR_BUILD)
473 genunifont$(BUILD_EXEEXT): LDFLAGS = $(LDFLAGS_FOR_BUILD)
474
475 $(UNIFONT_BIN): $(UNIFONT) genunifont$(BUILD_EXEEXT)
476         $(AM_V_GEN)./genunifont$(BUILD_EXEEXT) $(UNIFONT_BIN) $(UNIFONT)
477
478 #
479 # Kmscon Modules
480 #
481
482 if BUILD_ENABLE_FONT_UNIFONT
483 module_LTLIBRARIES += mod-unifont.la
484 noinst_PROGRAMS += genunifont
485 endif
486
487 mod_unifont_la_SOURCES = \
488         src/kmscon_module_interface.h \
489         src/font_unifont.c \
490         src/kmscon_mod_unifont.c
491 mod_unifont_la_LIBADD = \
492         $(UNIFONT_LT) \
493         libshl.la
494 mod_unifont_la_LDFLAGS = \
495         $(AM_LDFLAGS) \
496         -module \
497         -avoid-version
498
499 if BUILD_ENABLE_FONT_FREETYPE2
500 module_LTLIBRARIES += mod-freetype2.la
501 endif
502
503 mod_freetype2_la_SOURCES = \
504         src/kmscon_module_interface.h \
505         src/font_freetype2.c \
506         src/kmscon_mod_freetype2.c
507 mod_freetype2_la_CPPFLAGS = \
508         $(AM_CPPFLAGS) \
509         $(FREETYPE2_CFLAGS)
510 mod_freetype2_la_LIBADD = \
511         $(FREETYPE2_LIBS) \
512         -lpthread \
513         libtsm.la \
514         libshl.la
515 mod_freetype2_la_LDFLAGS = \
516         $(AM_LDFLAGS) \
517         -module \
518         -avoid-version
519
520 if BUILD_ENABLE_FONT_PANGO
521 module_LTLIBRARIES += mod-pango.la
522 endif
523
524 mod_pango_la_SOURCES = \
525         src/kmscon_module_interface.h \
526         src/font_pango.c \
527         src/kmscon_mod_pango.c
528 mod_pango_la_CPPFLAGS = \
529         $(AM_CPPFLAGS) \
530         $(PANGO_CFLAGS)
531 mod_pango_la_LIBADD = \
532         $(PANGO_LIBS) \
533         -lpthread \
534         libtsm.la \
535         libshl.la
536 mod_pango_la_LDFLAGS = \
537         $(AM_LDFLAGS) \
538         -module \
539         -avoid-version
540
541 if BUILD_ENABLE_RENDERER_BBULK
542 module_LTLIBRARIES += mod-bbulk.la
543 endif
544
545 mod_bbulk_la_SOURCES = \
546         src/kmscon_module_interface.h \
547         src/text_bbulk.c \
548         src/kmscon_mod_bbulk.c
549 mod_bbulk_la_LIBADD = libshl.la
550 mod_bbulk_la_LDFLAGS = \
551         $(AM_LDFLAGS) \
552         -module \
553         -avoid-version
554
555 if BUILD_ENABLE_RENDERER_GLTEX
556 module_LTLIBRARIES += mod-gltex.la
557 noinst_PROGRAMS += genshader
558 endif
559
560 mod_gltex_la_SOURCES = \
561         src/kmscon_module_interface.h \
562         src/text_gltex.c \
563         src/static_gl.h \
564         src/static_gl_math.c \
565         src/static_gl_shader.c \
566         src/kmscon_mod_gltex.c
567 nodist_mod_gltex_la_SOURCES = \
568         src/static_shaders.c
569 mod_gltex_la_CPPFLAGS = \
570         $(AM_CPPFLAGS) \
571         $(GLES2_CFLAGS)
572 mod_gltex_la_LIBADD = \
573         $(GLES2_LIBS) \
574         libshl.la
575 mod_gltex_la_LDFLAGS = \
576         $(AM_LDFLAGS) \
577         -module \
578         -avoid-version
579
580 if BUILD_ENABLE_RENDERER_CAIRO
581 module_LTLIBRARIES += mod-cairo.la
582 endif
583
584 mod_cairo_la_SOURCES = \
585         src/kmscon_module_interface.h \
586         src/text_cairo.c \
587         src/kmscon_mod_cairo.c
588 mod_cairo_la_CPPFLAGS = \
589         $(AM_CPPFLAGS) \
590         $(CAIRO_CFLAGS)
591 mod_cairo_la_LIBADD = \
592         $(CAIRO_LIBS) \
593         libshl.la
594 mod_cairo_la_LDFLAGS = \
595         $(AM_LDFLAGS) \
596         -module \
597         -avoid-version
598
599 if BUILD_ENABLE_RENDERER_PIXMAN
600 module_LTLIBRARIES += mod-pixman.la
601 endif
602
603 mod_pixman_la_SOURCES = \
604         src/kmscon_module_interface.h \
605         src/text_pixman.c \
606         src/kmscon_mod_pixman.c
607 mod_pixman_la_CPPFLAGS = \
608         $(AM_CPPFLAGS) \
609         $(PIXMAN_CFLAGS)
610 mod_pixman_la_LIBADD = \
611         $(PIXMAN_LIBS) \
612         libshl.la
613 mod_pixman_la_LDFLAGS = \
614         $(AM_LDFLAGS) \
615         -module \
616         -avoid-version
617
618 #
619 # Binaries
620 # These are the sources for the main binaries and test programs. They mostly
621 # consists of a single source file only and include all the libraries that are
622 # built as part of kmscon.
623 #
624
625 if BUILD_ENABLE_KMSCON
626 bin_PROGRAMS += kmscon
627 check_PROGRAMS += \
628         test_output \
629         test_vt \
630         test_input \
631         test_key
632 MANPAGES += docs/man/kmscon.1
633 endif
634
635 kmscon_SOURCES = \
636         src/conf.h \
637         src/conf.c \
638         src/pty.h \
639         src/pty.c \
640         src/font.h \
641         src/font.c \
642         src/font_8x16.c \
643         src/text.h \
644         src/text.c \
645         src/text_bblit.c \
646         src/kmscon_module_interface.h \
647         src/kmscon_module.h \
648         src/kmscon_module.c \
649         src/kmscon_terminal.h \
650         src/kmscon_dummy.h \
651         src/kmscon_seat.h \
652         src/kmscon_seat.c \
653         src/kmscon_conf.h \
654         src/kmscon_conf.c \
655         src/kmscon_main.c
656 nodist_kmscon_SOURCES =
657
658 kmscon_CPPFLAGS = \
659         $(AM_CPPFLAGS) \
660         $(XKBCOMMON_CFLAGS)
661 kmscon_LDADD = \
662         $(XKBCOMMON_LIBS) \
663         libeloop.la \
664         libuterm.la \
665         libshl.la \
666         -lpthread \
667         -ldl
668 kmscon_LDFLAGS = \
669         $(AM_LDFLAGS) \
670         -rdynamic
671
672 if BUILD_ENABLE_SESSION_DUMMY
673 kmscon_SOURCES += src/kmscon_dummy.c
674 endif
675
676 if BUILD_ENABLE_SESSION_TERMINAL
677 kmscon_SOURCES += src/kmscon_terminal.c
678 kmscon_LDADD += libtsm.la
679 endif
680
681 #
682 # Tests
683 #
684
685 test_sources = \
686         src/conf.h \
687         src/conf.c \
688         tests/test_include.h
689 test_cflags = \
690         $(AM_CPPFLAGS) \
691         $(XKBCOMMON_CFLAGS)
692 test_libs = \
693         $(XKBCOMMON_LIBS) \
694         libeloop.la \
695         libshl.la
696
697 test_output_SOURCES = \
698         $(test_sources) \
699         tests/test_output.c
700 test_output_CPPFLAGS = $(test_cflags)
701 test_output_LDADD = \
702         $(test_libs) \
703         libuterm.la
704
705 test_vt_SOURCES = \
706         $(test_sources) \
707         tests/test_vt.c
708 test_vt_CPPFLAGS = $(test_cflags)
709 test_vt_LDADD = \
710         $(test_libs) \
711         libuterm.la
712
713 test_input_SOURCES = \
714         $(test_sources) \
715         tests/test_input.c
716 test_input_CPPFLAGS = $(test_cflags)
717 test_input_LDADD = \
718         $(test_libs) \
719         libuterm.la
720
721 test_key_SOURCES = \
722         $(test_sources) \
723         tests/test_key.c
724 test_key_CPPFLAGS = $(test_cflags)
725 test_key_LDADD = $(test_libs)
726
727 #
728 # Manpages
729 #
730
731 man_MANS =
732 EXTRA_DIST += ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
733 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
734
735 if BUILD_HAVE_XSLTPROC
736 if BUILD_HAVE_MANPAGES_STYLESHEET
737
738 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
739
740 XSLTPROC_FLAGS = \
741         --stringparam man.authors.section.enabled 0 \
742         --stringparam man.copyright.section.enabled 0 \
743         --stringparam funcsynopsis.style ansi \
744         --stringparam man.output.quietly 1 \
745         --nonet
746
747 XSLTPROC_PROCESS_MAN = \
748         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
749         $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) "$<" && \
750         touch .man_fixup
751
752 # Force .man_fixup if $(MANPAGES) are not built
753 .man_fixup: | $(MANPAGES)
754         @touch .man_fixup
755
756 $(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
757         $(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
758
759 docs/man/%.1: docs/man/%.xml
760         $(XSLTPROC_PROCESS_MAN)
761
762 docs/man/%.3: docs/man/%.xml
763         $(XSLTPROC_PROCESS_MAN)
764
765 docs/man/%.5: docs/man/%.xml
766         $(XSLTPROC_PROCESS_MAN)
767
768 docs/man/%.7: docs/man/%.xml
769         $(XSLTPROC_PROCESS_MAN)
770
771 endif # BUILD_HAVE_MANPAGES_STYLESHEET
772 endif # BUILD_HAVE_XSLTPROC
773
774 #
775 # Phony targets
776 #
777
778 .PHONY: $(TPHONY)