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