tsm: remove and depend on libtsm
[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_FREETYPE2
455 module_LTLIBRARIES += mod-freetype2.la
456 endif
457
458 mod_freetype2_la_SOURCES = \
459         src/kmscon_module_interface.h \
460         src/font_freetype2.c \
461         src/kmscon_mod_freetype2.c
462 mod_freetype2_la_CPPFLAGS = \
463         $(AM_CPPFLAGS) \
464         $(FREETYPE2_CFLAGS) \
465         $(TSM_CFLAGS)
466 mod_freetype2_la_LIBADD = \
467         $(FREETYPE2_LIBS) \
468         $(TSM_LIBS) \
469         -lpthread \
470         libshl.la
471 mod_freetype2_la_LDFLAGS = \
472         $(AM_LDFLAGS) \
473         -module \
474         -avoid-version
475
476 if BUILD_ENABLE_FONT_PANGO
477 module_LTLIBRARIES += mod-pango.la
478 endif
479
480 mod_pango_la_SOURCES = \
481         src/kmscon_module_interface.h \
482         src/font_pango.c \
483         src/kmscon_mod_pango.c
484 mod_pango_la_CPPFLAGS = \
485         $(AM_CPPFLAGS) \
486         $(PANGO_CFLAGS) \
487         $(TSM_CFLAGS)
488 mod_pango_la_LIBADD = \
489         $(PANGO_LIBS) \
490         $(TSM_LIBS) \
491         -lpthread \
492         libshl.la
493 mod_pango_la_LDFLAGS = \
494         $(AM_LDFLAGS) \
495         -module \
496         -avoid-version
497
498 if BUILD_ENABLE_RENDERER_BBULK
499 module_LTLIBRARIES += mod-bbulk.la
500 endif
501
502 mod_bbulk_la_SOURCES = \
503         src/kmscon_module_interface.h \
504         src/text_bbulk.c \
505         src/kmscon_mod_bbulk.c
506 mod_bbulk_la_LIBADD = libshl.la
507 mod_bbulk_la_LDFLAGS = \
508         $(AM_LDFLAGS) \
509         -module \
510         -avoid-version
511
512 if BUILD_ENABLE_RENDERER_GLTEX
513 module_LTLIBRARIES += mod-gltex.la
514 noinst_PROGRAMS += genshader
515 endif
516
517 mod_gltex_la_SOURCES = \
518         src/kmscon_module_interface.h \
519         src/text_gltex.c \
520         src/static_gl.h \
521         src/static_gl_math.c \
522         src/static_gl_shader.c \
523         src/kmscon_mod_gltex.c
524 nodist_mod_gltex_la_SOURCES = \
525         src/static_shaders.c
526 mod_gltex_la_CPPFLAGS = \
527         $(AM_CPPFLAGS) \
528         $(GLES2_CFLAGS)
529 mod_gltex_la_LIBADD = \
530         $(GLES2_LIBS) \
531         libshl.la
532 mod_gltex_la_LDFLAGS = \
533         $(AM_LDFLAGS) \
534         -module \
535         -avoid-version
536
537 if BUILD_ENABLE_RENDERER_CAIRO
538 module_LTLIBRARIES += mod-cairo.la
539 endif
540
541 mod_cairo_la_SOURCES = \
542         src/kmscon_module_interface.h \
543         src/text_cairo.c \
544         src/kmscon_mod_cairo.c
545 mod_cairo_la_CPPFLAGS = \
546         $(AM_CPPFLAGS) \
547         $(CAIRO_CFLAGS)
548 mod_cairo_la_LIBADD = \
549         $(CAIRO_LIBS) \
550         libshl.la
551 mod_cairo_la_LDFLAGS = \
552         $(AM_LDFLAGS) \
553         -module \
554         -avoid-version
555
556 if BUILD_ENABLE_RENDERER_PIXMAN
557 module_LTLIBRARIES += mod-pixman.la
558 endif
559
560 mod_pixman_la_SOURCES = \
561         src/kmscon_module_interface.h \
562         src/text_pixman.c \
563         src/kmscon_mod_pixman.c
564 mod_pixman_la_CPPFLAGS = \
565         $(AM_CPPFLAGS) \
566         $(PIXMAN_CFLAGS)
567 mod_pixman_la_LIBADD = \
568         $(PIXMAN_LIBS) \
569         libshl.la
570 mod_pixman_la_LDFLAGS = \
571         $(AM_LDFLAGS) \
572         -module \
573         -avoid-version
574
575 #
576 # Binaries
577 # These are the sources for the main binaries and test programs. They mostly
578 # consists of a single source file only and include all the libraries that are
579 # built as part of kmscon.
580 #
581
582 if BUILD_ENABLE_KMSCON
583 bin_PROGRAMS += kmscon
584 check_PROGRAMS += \
585         test_output \
586         test_vt \
587         test_input \
588         test_key
589 MANPAGES += docs/man/kmscon.1
590 endif
591
592 kmscon_SOURCES = \
593         src/conf.h \
594         src/conf.c \
595         src/pty.h \
596         src/pty.c \
597         src/font.h \
598         src/font.c \
599         src/font_8x16.c \
600         src/text.h \
601         src/text.c \
602         src/text_bblit.c \
603         src/kmscon_module_interface.h \
604         src/kmscon_module.h \
605         src/kmscon_module.c \
606         src/kmscon_terminal.h \
607         src/kmscon_dummy.h \
608         src/kmscon_seat.h \
609         src/kmscon_seat.c \
610         src/kmscon_conf.h \
611         src/kmscon_conf.c \
612         src/kmscon_main.c
613 nodist_kmscon_SOURCES =
614
615 kmscon_CPPFLAGS = \
616         $(AM_CPPFLAGS) \
617         $(XKBCOMMON_CFLAGS) \
618         $(TSM_CFLAGS)
619 kmscon_LDADD = \
620         $(XKBCOMMON_LIBS) \
621         $(TSM_LIBS) \
622         libeloop.la \
623         libuterm.la \
624         libshl.la \
625         -lpthread \
626         -ldl
627 kmscon_LDFLAGS = \
628         $(AM_LDFLAGS) \
629         -rdynamic
630
631 if BUILD_ENABLE_SESSION_DUMMY
632 kmscon_SOURCES += src/kmscon_dummy.c
633 endif
634
635 if BUILD_ENABLE_SESSION_TERMINAL
636 kmscon_SOURCES += src/kmscon_terminal.c
637 endif
638
639 #
640 # Tests
641 #
642
643 test_sources = \
644         src/conf.h \
645         src/conf.c \
646         tests/test_include.h
647 test_cflags = \
648         $(AM_CPPFLAGS) \
649         $(XKBCOMMON_CFLAGS)
650 test_libs = \
651         $(XKBCOMMON_LIBS) \
652         libeloop.la \
653         libshl.la
654
655 test_output_SOURCES = \
656         $(test_sources) \
657         tests/test_output.c
658 test_output_CPPFLAGS = $(test_cflags)
659 test_output_LDADD = \
660         $(test_libs) \
661         libuterm.la
662
663 test_vt_SOURCES = \
664         $(test_sources) \
665         tests/test_vt.c
666 test_vt_CPPFLAGS = $(test_cflags)
667 test_vt_LDADD = \
668         $(test_libs) \
669         libuterm.la
670
671 test_input_SOURCES = \
672         $(test_sources) \
673         tests/test_input.c
674 test_input_CPPFLAGS = $(test_cflags)
675 test_input_LDADD = \
676         $(test_libs) \
677         libuterm.la
678
679 test_key_SOURCES = \
680         $(test_sources) \
681         tests/test_key.c
682 test_key_CPPFLAGS = $(test_cflags)
683 test_key_LDADD = $(test_libs)
684
685 #
686 # Manpages
687 #
688
689 man_MANS =
690 EXTRA_DIST += ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES)}}}}
691 CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
692
693 if BUILD_HAVE_XSLTPROC
694 if BUILD_HAVE_MANPAGES_STYLESHEET
695
696 man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
697
698 XSLTPROC_FLAGS = \
699         --stringparam man.authors.section.enabled 0 \
700         --stringparam man.copyright.section.enabled 0 \
701         --stringparam funcsynopsis.style ansi \
702         --stringparam man.output.quietly 1 \
703         --nonet
704
705 XSLTPROC_PROCESS_MAN = \
706         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
707         $(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(BUILD_MANPAGES_STYLESHEET) "$<" && \
708         touch .man_fixup
709
710 # Force .man_fixup if $(MANPAGES) are not built
711 .man_fixup: | $(MANPAGES)
712         @touch .man_fixup
713
714 $(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
715         $(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
716
717 docs/man/%.1: docs/man/%.xml
718         $(XSLTPROC_PROCESS_MAN)
719
720 docs/man/%.3: docs/man/%.xml
721         $(XSLTPROC_PROCESS_MAN)
722
723 docs/man/%.5: docs/man/%.xml
724         $(XSLTPROC_PROCESS_MAN)
725
726 docs/man/%.7: docs/man/%.xml
727         $(XSLTPROC_PROCESS_MAN)
728
729 endif # BUILD_HAVE_MANPAGES_STYLESHEET
730 endif # BUILD_HAVE_XSLTPROC
731
732 #
733 # Phony targets
734 #
735
736 .PHONY: $(TPHONY)