external: remove unused imKStoUCS files
[platform/upstream/kmscon.git] / Makefile.am
1 #
2 # Kmscon - Global Makefile
3 # Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
4 #
5
6 ACLOCAL_AMFLAGS = -I m4
7 SUBDIRS = \
8         .
9 include_HEADERS =
10 EXTRA_DIST = \
11         README \
12         COPYING \
13         NEWS
14 CLEANFILES =
15 pkgconfigdir = $(libdir)/pkgconfig
16 pkgconfig_DATA =
17
18 #
19 # Build targets
20 #
21 # kmscon: Main kmscon program
22 # test_output: Test program for the display graphics subsystem
23 # test_vt: Test program for the VT subsystem
24 # test_input: Test program for the input subsystem
25 # libkmscon-core: Static core library for kmscon and test programs
26 # genshader: Program used to convert shaders into C-source files
27 #
28
29 bin_PROGRAMS =
30 check_PROGRAMS =
31 noinst_PROGRAMS = \
32         genshader \
33         genunifont
34 noinst_LTLIBRARIES =
35 lib_LTLIBRARIES =
36
37 #
38 # Default CFlags
39 # Make all files include "config.h" by default. This shouldn't cause any
40 # problems and we cannot forget to include it anymore.
41 #
42 # Also make the linker discard all unused symbols as we are not building a
43 # shared library.
44 #
45 # When compiling in debug mode, we enable debug symbols so debugging with gdb
46 # is easier. If optimizations are disabled, we pass -O0 to the compiler.
47 # Otherwise, we use standard optimizations -O2.
48 #
49
50 AM_CFLAGS = \
51         -Wall
52 AM_CPPFLAGS = \
53         -include $(top_builddir)/config.h \
54         -I $(srcdir)/src \
55         -I $(srcdir)/external
56 AM_LDFLAGS = \
57         -Wl,--as-needed
58
59 if BUILD_ENABLE_DEBUG
60 AM_CFLAGS += -g
61 endif
62
63 if BUILD_ENABLE_OPTIMIZATIONS
64 AM_CFLAGS += -O2
65 else
66 AM_CFLAGS += -O0
67 endif
68
69 #
70 # SHL - Static Helper Library
71 # The SHL subsystem contains several small code pieces used all over kmscon and
72 # other applications.
73 #
74
75 SHL_DLIST = \
76         src/shl_dlist.h
77 SHL_ARRAY = \
78         src/shl_array.h
79 SHL_HASHTABLE = \
80         src/shl_hashtable.h \
81         external/htable.h \
82         external/htable.c
83 SHL_RING = \
84         src/shl_ring.h
85 SHL_TIMER = \
86         src/shl_timer.h
87 SHL_LLOG = \
88         src/shl_llog.h
89 SHL_HOOK = \
90         src/shl_hook.h \
91         $(SHL_DLIST)
92 SHL_MISC = \
93         src/shl_misc.h
94
95 #
96 # libeloop
97 # This library contains the whole event-loop implementation of kmscon. It is
98 # compiled into a separate object to allow using it in several other programs.
99 #
100
101 if BUILD_ENABLE_ELOOP
102 lib_LTLIBRARIES += libeloop.la
103 include_HEADERS += src/eloop.h
104 pkgconfig_DATA += libeloop.pc
105 endif
106
107 libeloop_la_SOURCES = \
108         $(SHL_DLIST) \
109         $(SHL_LLOG) \
110         $(SHL_HOOK) \
111         src/eloop.h \
112         src/eloop.c
113
114 if BUILD_ENABLE_DBUS
115 libeloop_la_SOURCES += \
116         external/dbus-common.h \
117         external/dbus-loop.h \
118         external/dbus-loop.c
119 endif
120
121 libeloop_la_CPPFLAGS = \
122         $(AM_CPPFLAGS) \
123         $(DBUS_CFLAGS)
124 libeloop_la_LIBADD = \
125         $(DBUS_LIBS)
126 libeloop_la_LDFLAGS = \
127         -version-info 1:0:0
128
129 #
130 # libtsm
131 # The Terminal-emulator State Machine is a library that implements the whole VTE
132 # layer and everything related to it. It has no external dependencies so it can
133 # be used to implement any kind of terminal emulator or debugger.
134 #
135
136 if BUILD_ENABLE_TSM
137 lib_LTLIBRARIES += libtsm.la
138 include_HEADERS += \
139         src/tsm_screen.h \
140         src/tsm_unicode.h \
141         src/tsm_vte.h
142 pkgconfig_DATA += libtsm.pc
143 endif
144
145 libtsm_la_SOURCES = \
146         $(SHL_LLOG) \
147         $(SHL_TIMER) \
148         $(SHL_ARRAY) \
149         $(SHL_HASHTABLE) \
150         src/tsm_screen.h \
151         src/tsm_screen.c \
152         src/tsm_unicode.h \
153         src/tsm_unicode.c \
154         src/tsm_vte.h \
155         src/tsm_vte.c \
156         src/tsm_vte_charsets.c
157
158 libtsm_la_CPPFLAGS = \
159         $(AM_CPPFLAGS) \
160         $(XKBCOMMON_CFLAGS)
161 libtsm_la_LDFLAGS = \
162         $(XKBCOMMON_LIBS) \
163         -version-info 1:0:0
164
165 #
166 # libuterm
167 # The uterm library provides helpers to create terminals in user-space. They
168 # are not limited to text-based terminals but rather provide graphics contexts
169 # so arbitrary output can be displayed. Additionally, they provide VT
170 # abstractions and an input layer
171 #
172
173 if BUILD_ENABLE_UTERM
174 lib_LTLIBRARIES += libuterm.la
175 include_HEADERS += src/uterm.h
176 pkgconfig_DATA += libuterm.pc
177 endif
178
179 libuterm_la_SOURCES = \
180         $(SHL_DLIST) \
181         $(SHL_HOOK) \
182         $(SHL_MISC) \
183         src/uterm.h \
184         src/uterm_input.h \
185         src/uterm_video.h \
186         src/uterm_video.c \
187         src/uterm_monitor.c \
188         src/uterm_vt.c \
189         src/uterm_input.c \
190         src/uterm_input_uxkb.c
191 nodist_libuterm_la_SOURCES =
192
193 libuterm_la_CPPFLAGS = \
194         $(AM_CPPFLAGS) \
195         $(SYSTEMD_CFLAGS) \
196         $(DRM_CFLAGS) \
197         $(EGL_CFLAGS) \
198         $(GBM_CFLAGS) \
199         $(GLES2_CFLAGS) \
200         $(UDEV_CFLAGS) \
201         $(XKBCOMMON_CFLAGS)
202 libuterm_la_LIBADD = \
203         $(SYSTEMD_LIBS) \
204         $(DRM_LIBS) \
205         $(EGL_LIBS) \
206         $(GBM_LIBS) \
207         $(GLES2_LIBS) \
208         $(UDEV_LIBS) \
209         $(XKBCOMMON_LIBS) \
210         libeloop.la
211 libuterm_la_LDFLAGS = \
212         -version-info 1:0:0
213
214 if BUILD_ENABLE_FBDEV
215 libuterm_la_SOURCES += \
216         src/uterm_video_fbdev.c
217 endif
218
219 if BUILD_ENABLE_DRM
220 libuterm_la_SOURCES += \
221         src/uterm_video_drm.c
222 libuterm_la_SOURCES += \
223         src/static_gl.h \
224         src/static_gl_math.c \
225         src/static_gl_shader.c
226 nodist_libuterm_la_SOURCES += \
227         src/static_shaders.c
228 endif
229
230 if BUILD_ENABLE_DUMB
231 libuterm_la_SOURCES += \
232         src/uterm_video_dumb.c
233 endif
234
235 #
236 # Shaders
237 # As there is no need to modify shaders at run-time, we statically compile them
238 # into object files. As autotools would ignore them, we need to add them to
239 # EXTRA_DIST.
240 # The program that converts the shaders into C-source files is "genshader". It's
241 # pretty simple and just creates a string with the shader source as content.
242 #
243
244 SHADERS = \
245         $(srcdir)/src/static_fill.vert \
246         $(srcdir)/src/static_fill.frag \
247         $(srcdir)/src/static_blend.vert \
248         $(srcdir)/src/static_blend.frag \
249         $(srcdir)/src/static_blit.vert \
250         $(srcdir)/src/static_blit.frag \
251         $(srcdir)/src/static_gltex.vert \
252         $(srcdir)/src/static_gltex.frag
253
254 EXTRA_DIST += \
255         $(SHADERS)
256 CLEANFILES += \
257         src/static_shaders.c
258
259 genshader_SOURCES = \
260         src/genshader.c
261
262 src/static_shaders.c: $(SHADERS) genshader$(EXEEXT)
263         $(AM_V_GEN)./genshader$(EXEEXT) src/static_shaders.c $(SHADERS)
264
265 #
266 # Unifont Generator
267 # This generates the unifont sources from raw hex-encoded font data.
268 #
269
270 UNIFONT = \
271         src/text_font_unifont_data.hex
272
273 EXTRA_DIST += \
274         $(UNIFONT)
275 CLEANFILES += \
276         src/text_font_unifont_data.c
277
278 genunifont_SOURCES = \
279         src/genunifont.c
280
281 src/text_font_unifont_data.c: $(UNIFONT) genunifont$(EXEEXT)
282         $(AM_V_GEN)./genunifont$(EXEEXT) src/text_font_unifont_data.c $(UNIFONT)
283
284 #
285 # Text-font library
286 # The text-font library is used by kmscon _and_ wlterm but is currently linked
287 # statically as it hasn't been cleaned up entirely.
288 # It has a build-time dependency to UTERM and runtime dependencies to TSM.
289 #
290
291 if BUILD_ENABLE_KMSCON
292 noinst_LTLIBRARIES += libtext-font.la
293 else
294 if BUILD_ENABLE_WLTERM
295 noinst_LTLIBRARIES += libtext-font.la
296 endif
297 endif
298
299 libtext_font_la_SOURCES = \
300         $(SHL_DLIST) \
301         $(SHL_HASHTABLE) \
302         $(SHL_HOOK) \
303         src/text.h \
304         src/text_font.c
305 nodist_libtext_font_la_SOURCES =
306
307 if BUILD_ENABLE_UNIFONT
308 libtext_font_la_SOURCES += \
309         src/text_font_unifont.c
310 nodist_libtext_font_la_SOURCES += \
311         src/text_font_unifont_data.c
312 endif
313
314 if BUILD_ENABLE_8X16
315 libtext_font_la_SOURCES += \
316         src/text_font_8x16.c
317 endif
318
319 if BUILD_ENABLE_FREETYPE2
320 libtext_font_la_SOURCES += \
321         src/text_font_freetype2.c
322 endif
323
324 if BUILD_ENABLE_PANGO
325 libtext_font_la_SOURCES += \
326         src/text_font_pango.c
327 endif
328
329 libtext_font_la_CPPFLAGS = \
330         $(AM_CPPFLAGS) \
331         $(PANGO_CFLAGS) \
332         $(FREETYPE2_CFLAGS)
333 libtext_font_la_LIBADD = \
334         $(PANGO_LIBS) \
335         $(FREETYPE2_LIBS) \
336         -lpthread \
337         libtsm.la
338
339 #
340 # libkmscon-core
341 # This static library contains all the source files used in kmscon. We build
342 # them as separate library to allow linking them to the test programs.
343 # Only "main.c" is not included here as it contains the main() function.
344 #
345
346 if BUILD_ENABLE_KMSCON
347 noinst_LTLIBRARIES += libkmscon-core.la
348 endif
349
350 libkmscon_core_la_SOURCES = \
351         $(SHL_DLIST) \
352         $(SHL_ARRAY) \
353         $(SHL_HASHTABLE) \
354         $(SHL_RING) \
355         $(SHL_TIMER) \
356         $(SHL_HOOK) \
357         $(SHL_MISC) \
358         src/conf.c src/conf.h \
359         src/log.c src/log.h \
360         src/pty.c src/pty.h \
361         src/text.h \
362         src/text.c
363 nodist_libkmscon_core_la_SOURCES =
364
365 if BUILD_ENABLE_BBLIT
366 libkmscon_core_la_SOURCES += \
367         src/text_bblit.c
368 endif
369
370 if BUILD_ENABLE_BBULK
371 libkmscon_core_la_SOURCES += \
372         src/text_bbulk.c
373 endif
374
375 if BUILD_ENABLE_GLES2
376 libkmscon_core_la_SOURCES += \
377         src/text_gltex.c \
378         src/static_gl.h \
379         src/static_gl_math.c \
380         src/static_gl_shader.c
381 nodist_libkmscon_core_la_SOURCES += \
382         src/static_shaders.c
383 endif
384
385 libkmscon_core_la_CPPFLAGS = \
386         $(AM_CPPFLAGS) \
387         $(GLES2_CFLAGS) \
388         $(XKBCOMMON_CFLAGS)
389 libkmscon_core_la_LIBADD = \
390         $(GLES2_LIBS) \
391         $(XKBCOMMON_LIBS) \
392         -lpthread \
393         libeloop.la \
394         libtsm.la \
395         libuterm.la \
396         libtext-font.la
397
398 #
399 # Binaries
400 # These are the sources for the main binaries and test programs. They mostly
401 # consists of a single source file only and include all the libraries that are
402 # built as part of kmscon.
403 #
404
405 if BUILD_ENABLE_KMSCON
406 bin_PROGRAMS += kmscon
407 check_PROGRAMS += \
408         test_output \
409         test_vt \
410         test_input \
411         test_key
412 endif
413
414 kmscon_SOURCES = \
415         $(SHL_DLIST) \
416         $(SHL_MISC) \
417         src/kmscon_terminal.h \
418         src/kmscon_terminal.c \
419         src/kmscon_seat.h \
420         src/kmscon_seat.c \
421         src/kmscon_conf.h \
422         src/kmscon_conf.c \
423         src/kmscon_main.c
424 kmscon_CPPFLAGS = \
425         $(AM_CPPFLAGS) \
426         $(WAYLAND_CFLAGS) \
427         $(XKBCOMMON_CFLAGS)
428 kmscon_LDADD = \
429         $(WAYLAND_LIBS) \
430         $(XKBCOMMON_LIBS) \
431         libuterm.la \
432         libeloop.la \
433         libtext-font.la \
434         libkmscon-core.la
435
436 if BUILD_ENABLE_WAYLAND
437 kmscon_SOURCES += \
438         src/kmscon_compositor.h \
439         src/kmscon_compositor.c
440 endif
441
442 test_output_SOURCES = tests/test_output.c tests/test_include.h
443 test_output_LDADD = libkmscon-core.la
444
445 test_vt_SOURCES = tests/test_vt.c
446 test_vt_LDADD = libkmscon-core.la
447
448 test_input_SOURCES = tests/test_input.c
449 test_input_LDADD = libkmscon-core.la
450
451 test_key_SOURCES = tests/test_key.c
452
453 #
454 # Wayland Terminal
455 #
456
457 if BUILD_ENABLE_WLTERM
458 bin_PROGRAMS += wlterm
459 endif
460
461 wlterm_SOURCES = \
462         $(SHL_MISC) \
463         $(SHL_ARRAY) \
464         $(SHL_DLIST) \
465         $(SHL_HOOK) \
466         src/wlt_main.h \
467         src/wlt_main.c \
468         src/wlt_toolkit.h \
469         src/wlt_toolkit.c \
470         src/wlt_theme.h \
471         src/wlt_theme.c \
472         src/wlt_terminal.h \
473         src/wlt_terminal.c \
474         src/log.h \
475         src/log.c \
476         src/conf.h \
477         src/conf.c \
478         src/pty.h \
479         src/pty.c
480 wlterm_CPPFLAGS = \
481         $(AM_CPPFLAGS) \
482         $(WAYLAND_CFLAGS) \
483         $(XKBCOMMON_CFLAGS)
484 wlterm_LDADD = \
485         libeloop.la \
486         libtsm.la \
487         libtext-font.la \
488         -lpthread \
489         $(WAYLAND_LIBS) \
490         $(XKBCOMMON_LIBS)