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