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