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