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