uvtd: add ctx subsystem
[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 # SHL - Static Helper Library
152 # The SHL subsystem contains several small code pieces used all over kmscon and
153 # other applications.
154 #
155
156 noinst_LTLIBRARIES += libshl.la
157
158 libshl_la_SOURCES = \
159         src/shl_githead.h \
160         src/shl_githead.c \
161         src/shl_dlist.h \
162         src/shl_array.h \
163         src/shl_hashtable.h \
164         external/htable.h \
165         external/htable.c \
166         src/shl_ring.h \
167         src/shl_timer.h \
168         src/shl_llog.h \
169         src/shl_log.h \
170         src/shl_log.c \
171         src/shl_hook.h \
172         src/shl_misc.h \
173         src/shl_register.h \
174         src/shl_flagset.h
175 libshl_la_CPPFLAGS = \
176         $(AM_CPPFLAGS) \
177         $(XKBCOMMON_CFLAGS) \
178         -pthread
179 libshl_la_LDFLAGS = \
180         $(AM_LDFLAGS) \
181         -pthread
182 libshl_la_LIBADD = \
183         $(AM_LIBADD) \
184         $(XKBCOMMON_LIBS)
185
186 #
187 # libeloop
188 # This library contains the whole event-loop implementation of kmscon. It is
189 # compiled into a separate object to allow using it in several other programs.
190 #
191
192 if BUILD_ENABLE_ELOOP
193 lib_LTLIBRARIES += libeloop.la
194 include_HEADERS += src/eloop.h
195 pkgconfig_DATA += docs/pc/libeloop.pc
196 endif
197
198 libeloop_la_SOURCES = \
199         src/eloop.h \
200         src/eloop.c
201
202 libeloop_la_LIBADD = libshl.la
203 libeloop_la_CPPFLAGS = $(AM_CPPFLAGS)
204 EXTRA_libeloop_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libeloop.sym
205 libeloop_la_LDFLAGS = \
206         $(AM_LDFLAGS) \
207         -version-info $(LIBELOOP_CURRENT):$(LIBELOOP_REVISION):$(LIBELOOP_AGE) \
208         -Wl,--version-script=$(top_srcdir)/docs/sym/libeloop.sym
209
210
211 if BUILD_ENABLE_ELOOP_DBUS
212 libeloop_la_SOURCES += \
213         external/dbus-common.h \
214         external/dbus-loop.h \
215         external/dbus-loop.c
216 libeloop_la_CPPFLAGS += $(DBUS_CFLAGS)
217 libeloop_la_LIBADD += $(DBUS_LIBS)
218 endif
219
220 #
221 # libtsm
222 # The Terminal-emulator State Machine is a library that implements the whole VTE
223 # layer and everything related to it. It has no external dependencies so it can
224 # be used to implement any kind of terminal emulator or debugger.
225 #
226
227 if BUILD_ENABLE_TSM
228 lib_LTLIBRARIES += libtsm.la
229 include_HEADERS += \
230         src/tsm_screen.h \
231         src/tsm_unicode.h \
232         src/tsm_vte.h
233 pkgconfig_DATA += docs/pc/libtsm.pc
234 endif
235
236 libtsm_la_SOURCES = \
237         src/tsm_screen.h \
238         src/tsm_screen.c \
239         src/tsm_unicode.h \
240         src/tsm_unicode.c \
241         src/tsm_vte.h \
242         src/tsm_vte.c \
243         src/tsm_vte_charsets.c \
244         external/wcwidth.h \
245         external/wcwidth.c
246
247 libtsm_la_CPPFLAGS = \
248         $(AM_CPPFLAGS) \
249         $(XKBCOMMON_CFLAGS)
250 libtsm_la_LIBADD = \
251         $(XKBCOMMON_LIBS) \
252         libshl.la
253 EXTRA_libtsm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libtsm.sym
254 libtsm_la_LDFLAGS = \
255         $(AM_LDFLAGS) \
256         -version-info $(LIBTSM_CURRENT):$(LIBTSM_REVISION):$(LIBTSM_AGE) \
257         -Wl,--version-script="$(top_srcdir)/docs/sym/libtsm.sym"
258
259 #
260 # libuvt
261 # Implementation of Virtual Terminals in user-space with the help of CUSE/FUSE
262 # so we can provide character-device drivers in user-space. Aims to be 100%
263 # compatible but also provides many other use-cases.
264 #
265
266 if BUILD_ENABLE_UVT
267 lib_LTLIBRARIES += libuvt.la
268 include_HEADERS += src/uvt.h
269 pkgconfig_DATA += docs/pc/libuvt.pc
270 endif
271
272 libuvt_la_SOURCES = \
273         src/uvt.h \
274         src/uvt_internal.h \
275         src/uvt_ctx.c \
276         src/uvt_cdev.c \
277         src/uvt_client.c \
278         src/uvt_tty_null.c
279 libuvt_la_CPPFLAGS = \
280         $(AM_CPPFLAGS) \
281         $(FUSE_CFLAGS) \
282         -DFUSE_USE_VERSION=29
283 libuvt_la_LIBADD = \
284         $(FUSE_LIBS) \
285         libshl.la
286 EXTRA_libuvt_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuvt.sym
287 libuvt_la_LDFLAGS = \
288         $(AM_LDFLAGS) \
289         -version-info $(LIBUVT_CURRENT):$(LIBUVT_REVISION):$(LIBUVT_AGE) \
290         -Wl,--version-script="$(top_srcdir)/docs/sym/libuvt.sym"
291
292 #
293 # libuterm
294 # The uterm library provides helpers to create terminals in user-space. They
295 # are not limited to text-based terminals but rather provide graphics contexts
296 # so arbitrary output can be displayed. Additionally, they provide VT
297 # abstractions and an input layer
298 #
299
300 if BUILD_ENABLE_UTERM
301 lib_LTLIBRARIES += libuterm.la
302 include_HEADERS += \
303         src/uterm_input.h \
304         src/uterm_monitor.h \
305         src/uterm_video.h \
306         src/uterm_vt.h
307 pkgconfig_DATA += docs/pc/libuterm.pc
308 endif
309
310 libuterm_la_SOURCES = \
311         src/uterm_input.h \
312         src/uterm_monitor.h \
313         src/uterm_video.h \
314         src/uterm_vt.h \
315         src/uterm_input_internal.h \
316         src/uterm_video_internal.h \
317         src/uterm_systemd_internal.h \
318         src/uterm_video.c \
319         src/uterm_monitor.c \
320         src/uterm_vt.c \
321         src/uterm_input.c \
322         src/uterm_input_uxkb.c
323
324 nodist_libuterm_la_SOURCES =
325
326 libuterm_la_CPPFLAGS = \
327         $(AM_CPPFLAGS) \
328         $(XKBCOMMON_CFLAGS)
329 libuterm_la_LIBADD = \
330         $(XKBCOMMON_LIBS) \
331         libeloop.la \
332         libshl.la
333 EXTRA_libuterm_la_DEPENDENCIES = ${top_srcdir}/docs/sym/libuterm.sym
334 libuterm_la_LDFLAGS = \
335         $(AM_LDFLAGS) \
336         -version-info $(LIBUTERM_CURRENT):$(LIBUTERM_REVISION):$(LIBUTERM_AGE) \
337         -Wl,--version-script="$(top_srcdir)/docs/sym/libuterm.sym"
338
339 if BUILD_ENABLE_MULTI_SEAT
340 libuterm_la_SOURCES += src/uterm_systemd.c
341 libuterm_la_CPPFLAGS += $(SYSTEMD_CFLAGS)
342 libuterm_la_LIBADD += $(SYSTEMD_LIBS)
343 endif
344
345 if BUILD_ENABLE_HOTPLUG
346 libuterm_la_CPPFLAGS += $(UDEV_CFLAGS)
347 libuterm_la_LIBADD += $(UDEV_LIBS)
348 endif
349
350 if BUILD_ENABLE_VIDEO_FBDEV
351 libuterm_la_SOURCES += \
352         src/uterm_fbdev_internal.h \
353         src/uterm_fbdev_video.c \
354         src/uterm_fbdev_render.c
355 endif
356
357 if BUILD_ENABLE_VIDEO_DRM2D
358 libuterm_la_SOURCES += \
359         src/uterm_drm2d_internal.h \
360         src/uterm_drm2d_video.c \
361         src/uterm_drm2d_render.c
362 libuterm_la_CPPFLAGS += $(DRM_CFLAGS)
363 libuterm_la_LIBADD += $(DRM_LIBS)
364 endif
365
366 if BUILD_ENABLE_VIDEO_DRM3D
367 noinst_PROGRAMS += genshader
368 libuterm_la_SOURCES += \
369         src/uterm_drm3d_internal.h \
370         src/uterm_drm3d_video.c \
371         src/uterm_drm3d_render.c \
372         src/static_gl.h \
373         src/static_gl_math.c \
374         src/static_gl_shader.c
375 nodist_libuterm_la_SOURCES += src/static_shaders.c
376 libuterm_la_CPPFLAGS += \
377         $(DRM_CFLAGS) \
378         $(EGL_CFLAGS) \
379         $(GBM_CFLAGS) \
380         $(GLES2_CFLAGS)
381 libuterm_la_LIBADD += \
382         $(DRM_LIBS) \
383         $(EGL_LIBS) \
384         $(GBM_LIBS) \
385         $(GLES2_LIBS)
386 endif
387
388 # add shared sources only once
389 UTERM_DRM_SHARED_SRC = \
390         src/uterm_drm_shared_internal.h \
391         src/uterm_drm_shared.c
392 if BUILD_ENABLE_VIDEO_DRM2D
393 libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
394 else
395 if BUILD_ENABLE_VIDEO_DRM3D
396 libuterm_la_SOURCES += $(UTERM_DRM_SHARED_SRC)
397 endif
398 endif
399
400 #
401 # Shaders
402 # As there is no need to modify shaders at run-time, we statically compile them
403 # into object files. As autotools would ignore them, we need to add them to
404 # EXTRA_DIST.
405 # The program that converts the shaders into C-source files is "genshader". It's
406 # pretty simple and just creates a string with the shader source as content.
407 #
408
409 SHADERS = \
410         $(srcdir)/src/static_fill.vert \
411         $(srcdir)/src/static_fill.frag \
412         $(srcdir)/src/static_blend.vert \
413         $(srcdir)/src/static_blend.frag \
414         $(srcdir)/src/static_blit.vert \
415         $(srcdir)/src/static_blit.frag \
416         $(srcdir)/src/static_gltex.vert \
417         $(srcdir)/src/static_gltex.frag
418
419 EXTRA_DIST += $(SHADERS)
420 CLEANFILES += src/static_shaders.c
421 genshader_SOURCES = src/genshader.c
422
423 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
424         $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
425
426 #
427 # Unifont Generator
428 # This generates the unifont sources from raw hex-encoded font data.
429 #
430
431 UNIFONT = $(top_srcdir)/src/font_unifont_data.hex
432 UNIFONT_BIN = src/font_unifont_data.bin
433
434 EXTRA_DIST += $(UNIFONT)
435 CLEANFILES += $(UNIFONT_BIN)
436 genunifont_SOURCES = src/genunifont.c
437
438 $(UNIFONT_BIN): $(UNIFONT) genunifont$(EXEEXT)
439         $(AM_V_GEN)./genunifont$(EXEEXT) $(UNIFONT_BIN) $(UNIFONT)
440
441 #
442 # Kmscon Modules
443 #
444
445 if BUILD_ENABLE_FONT_UNIFONT
446 module_LTLIBRARIES += mod-unifont.la
447 noinst_PROGRAMS += genunifont
448 endif
449
450 mod_unifont_la_SOURCES = \
451         src/kmscon_module_interface.h \
452         src/font_unifont.c \
453         src/kmscon_mod_unifont.c
454 EXTRA_mod_unifont_la_DEPENDENCIES = $(UNIFONT_BIN)
455 mod_unifont_la_LIBADD = libshl.la
456 mod_unifont_la_LDFLAGS = \
457         $(AM_LDFLAGS) \
458         -module \
459         -avoid-version \
460         -Wl,-z,noexecstack \
461         -Wl,--format=binary -Wl,$(UNIFONT_BIN) -Wl,--format=default
462
463 if BUILD_ENABLE_FONT_FREETYPE2
464 module_LTLIBRARIES += mod-freetype2.la
465 endif
466
467 mod_freetype2_la_SOURCES = \
468         src/kmscon_module_interface.h \
469         src/font_freetype2.c \
470         src/kmscon_mod_freetype2.c
471 mod_freetype2_la_CPPFLAGS = \
472         $(AM_CPPFLAGS) \
473         $(FREETYPE2_CFLAGS)
474 mod_freetype2_la_LIBADD = \
475         $(FREETYPE2_LIBS) \
476         -lpthread \
477         libtsm.la \
478         libshl.la
479 mod_freetype2_la_LDFLAGS = \
480         $(AM_LDFLAGS) \
481         -module \
482         -avoid-version
483
484 if BUILD_ENABLE_FONT_PANGO
485 module_LTLIBRARIES += mod-pango.la
486 endif
487
488 mod_pango_la_SOURCES = \
489         src/kmscon_module_interface.h \
490         src/font_pango.c \
491         src/kmscon_mod_pango.c
492 mod_pango_la_CPPFLAGS = \
493         $(AM_CPPFLAGS) \
494         $(PANGO_CFLAGS)
495 mod_pango_la_LIBADD = \
496         $(PANGO_LIBS) \
497         -lpthread \
498         libtsm.la \
499         libshl.la
500 mod_pango_la_LDFLAGS = \
501         $(AM_LDFLAGS) \
502         -module \
503         -avoid-version
504
505 if BUILD_ENABLE_RENDERER_BBULK
506 module_LTLIBRARIES += mod-bbulk.la
507 endif
508
509 mod_bbulk_la_SOURCES = \
510         src/kmscon_module_interface.h \
511         src/text_bbulk.c \
512         src/kmscon_mod_bbulk.c
513 mod_bbulk_la_LIBADD = libshl.la
514 mod_bbulk_la_LDFLAGS = \
515         $(AM_LDFLAGS) \
516         -module \
517         -avoid-version
518
519 if BUILD_ENABLE_RENDERER_GLTEX
520 module_LTLIBRARIES += mod-gltex.la
521 noinst_PROGRAMS += genshader
522 endif
523
524 mod_gltex_la_SOURCES = \
525         src/kmscon_module_interface.h \
526         src/text_gltex.c \
527         src/static_gl.h \
528         src/static_gl_math.c \
529         src/static_gl_shader.c \
530         src/kmscon_mod_gltex.c
531 nodist_mod_gltex_la_SOURCES = \
532         src/static_shaders.c
533 mod_gltex_la_CPPFLAGS = \
534         $(AM_CPPFLAGS) \
535         $(GLES2_CFLAGS)
536 mod_gltex_la_LIBADD = \
537         $(GLES2_LIBS) \
538         libshl.la
539 mod_gltex_la_LDFLAGS = \
540         $(AM_LDFLAGS) \
541         -module \
542         -avoid-version
543
544 if BUILD_ENABLE_RENDERER_CAIRO
545 module_LTLIBRARIES += mod-cairo.la
546 endif
547
548 mod_cairo_la_SOURCES = \
549         src/kmscon_module_interface.h \
550         src/text_cairo.c \
551         src/kmscon_mod_cairo.c
552 mod_cairo_la_CPPFLAGS = \
553         $(AM_CPPFLAGS) \
554         $(CAIRO_CFLAGS)
555 mod_cairo_la_LIBADD = \
556         $(CAIRO_LIBS) \
557         libshl.la
558 mod_cairo_la_LDFLAGS = \
559         $(AM_LDFLAGS) \
560         -module \
561         -avoid-version
562
563 if BUILD_ENABLE_RENDERER_PIXMAN
564 module_LTLIBRARIES += mod-pixman.la
565 endif
566
567 mod_pixman_la_SOURCES = \
568         src/kmscon_module_interface.h \
569         src/text_pixman.c \
570         src/kmscon_mod_pixman.c
571 mod_pixman_la_CPPFLAGS = \
572         $(AM_CPPFLAGS) \
573         $(PIXMAN_CFLAGS)
574 mod_pixman_la_LIBADD = \
575         $(PIXMAN_LIBS) \
576         libshl.la
577 mod_pixman_la_LDFLAGS = \
578         $(AM_LDFLAGS) \
579         -module \
580         -avoid-version
581
582 #
583 # Binaries
584 # These are the sources for the main binaries and test programs. They mostly
585 # consists of a single source file only and include all the libraries that are
586 # built as part of kmscon.
587 #
588
589 if BUILD_ENABLE_KMSCON
590 bin_PROGRAMS += kmscon
591 check_PROGRAMS += \
592         test_output \
593         test_vt \
594         test_input \
595         test_key
596 MANPAGES += docs/man/kmscon.1
597 endif
598
599 kmscon_SOURCES = \
600         src/conf.h \
601         src/conf.c \
602         src/pty.h \
603         src/pty.c \
604         src/font.h \
605         src/font.c \
606         src/font_8x16.c \
607         src/text.h \
608         src/text.c \
609         src/text_bblit.c \
610         src/kmscon_module_interface.h \
611         src/kmscon_module.h \
612         src/kmscon_module.c \
613         src/kmscon_terminal.h \
614         src/kmscon_dummy.h \
615         src/kmscon_cdev.h \
616         src/kmscon_seat.h \
617         src/kmscon_seat.c \
618         src/kmscon_conf.h \
619         src/kmscon_conf.c \
620         src/kmscon_main.c
621 nodist_kmscon_SOURCES =
622
623 kmscon_CPPFLAGS = \
624         $(AM_CPPFLAGS) \
625         $(XKBCOMMON_CFLAGS)
626 kmscon_LDADD = \
627         $(XKBCOMMON_LIBS) \
628         libeloop.la \
629         libuterm.la \
630         libshl.la \
631         -lpthread \
632         -ldl
633 kmscon_LDFLAGS = \
634         $(AM_LDFLAGS) \
635         -rdynamic
636
637 if BUILD_ENABLE_SESSION_DUMMY
638 kmscon_SOURCES += src/kmscon_dummy.c
639 endif
640
641 if BUILD_ENABLE_SESSION_TERMINAL
642 kmscon_SOURCES += src/kmscon_terminal.c
643 kmscon_LDADD += libtsm.la
644 endif
645
646 if BUILD_ENABLE_SESSION_CDEV
647 kmscon_SOURCES += src/kmscon_cdev.c
648 kmscon_CPPFLAGS += $(FUSE_CFLAGS)
649 kmscon_LDADD += $(FUSE_LIBS)
650 endif
651
652 #
653 # Wayland Terminal
654 #
655
656 if BUILD_ENABLE_WLTERM
657 bin_PROGRAMS += wlterm
658 endif
659
660 wlterm_SOURCES = \
661         src/wlt_main.h \
662         src/wlt_main.c \
663         src/wlt_toolkit.h \
664         src/wlt_toolkit.c \
665         src/wlt_theme.h \
666         src/wlt_theme.c \
667         src/wlt_terminal.h \
668         src/wlt_terminal.c \
669         src/conf.h \
670         src/conf.c \
671         src/pty.h \
672         src/pty.c \
673         src/font.h \
674         src/font.c \
675         src/font_8x16.c \
676         src/font_pango.c
677 wlterm_CPPFLAGS = \
678         $(AM_CPPFLAGS) \
679         $(WAYLAND_CFLAGS) \
680         $(PANGO_CFLAGS) \
681         $(XKBCOMMON_CFLAGS)
682 wlterm_LDADD = \
683         $(WAYLAND_LIBS) \
684         $(PANGO_LIBS) \
685         $(XKBCOMMON_LIBS) \
686         libeloop.la \
687         libtsm.la \
688         libshl.la \
689         -lpthread
690
691 #
692 # uvtd
693 #
694
695 if BUILD_ENABLE_UVTD
696 bin_PROGRAMS += uvtd
697 endif
698
699 uvtd_SOURCES = \
700         src/uvtd_main.c \
701         src/uvtd_ctx.h \
702         src/uvtd_ctx.c \
703         src/uvtd_seat.h \
704         src/uvtd_seat.c
705 uvtd_CPPFLAGS = \
706         $(AM_CPPFLAGS) \
707         $(XKBCOMMON_CFLAGS)
708 uvtd_LDADD = \
709         $(XKBCOMMON_LIBS) \
710         libeloop.la \
711         libshl.la \
712         libuterm.la \
713         libuvt.la
714
715 #
716 # Tests
717 #
718
719 test_sources = \
720         src/conf.h \
721         src/conf.c \
722         tests/test_include.h
723 test_cflags = \
724         $(AM_CPPFLAGS) \
725         $(XKBCOMMON_CFLAGS)
726 test_libs = \
727         $(XKBCOMMON_LIBS) \
728         libeloop.la \
729         libshl.la
730
731 test_output_SOURCES = \
732         $(test_sources) \
733         tests/test_output.c
734 test_output_CPPFLAGS = $(test_cflags)
735 test_output_LDADD = \
736         $(test_libs) \
737         libuterm.la
738
739 test_vt_SOURCES = \
740         $(test_sources) \
741         tests/test_vt.c
742 test_vt_CPPFLAGS = $(test_cflags)
743 test_vt_LDADD = \
744         $(test_libs) \
745         libuterm.la
746
747 test_input_SOURCES = \
748         $(test_sources) \
749         tests/test_input.c
750 test_input_CPPFLAGS = $(test_cflags)
751 test_input_LDADD = \
752         $(test_libs) \
753         libuterm.la
754
755 test_key_SOURCES = \
756         $(test_sources) \
757         tests/test_key.c
758 test_key_CPPFLAGS = $(test_cflags)
759 test_key_LDADD = $(test_libs)
760
761 #
762 # Manpages
763 #
764
765 man_MANS =
766 EXTRA_DIST += ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
767 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
768
769 if BUILD_HAVE_XSLTPROC
770 if BUILD_HAVE_MANPAGES_STYLESHEET
771
772 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
773
774 XSLTPROC_FLAGS = \
775         --stringparam man.authors.section.enabled 0 \
776         --stringparam man.copyright.section.enabled 0 \
777         --stringparam funcsynopsis.style ansi \
778         --stringparam man.output.quietly 1 \
779         --nonet
780
781 XSLTPROC_PROCESS_MAN = \
782         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
783         $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) "$<" && \
784         touch .man_fixup
785
786 # Force .man_fixup if $(MANPAGES) are not built
787 .man_fixup: | $(MANPAGES)
788         @touch .man_fixup
789
790 $(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
791         $(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
792
793 docs/man/%.1: docs/man/%.xml
794         $(XSLTPROC_PROCESS_MAN)
795
796 docs/man/%.3: docs/man/%.xml
797         $(XSLTPROC_PROCESS_MAN)
798
799 docs/man/%.5: docs/man/%.xml
800         $(XSLTPROC_PROCESS_MAN)
801
802 docs/man/%.7: docs/man/%.xml
803         $(XSLTPROC_PROCESS_MAN)
804
805 endif # BUILD_HAVE_MANPAGES_STYLESHEET
806 endif # BUILD_HAVE_XSLTPROC
807
808 #
809 # Phony targets
810 #
811
812 .PHONY: $(TPHONY)