]> git.sur5r.net Git - i3/i3/blob - Makefile.am
Merge pull request #3415 from orestisf1993/g_utf8_make_valid
[i3/i3] / Makefile.am
1 @CODE_COVERAGE_RULES@
2
3 echo-version:
4         @echo "@I3_VERSION@"
5
6 bin_PROGRAMS = \
7         i3 \
8         i3bar/i3bar \
9         i3-config-wizard/i3-config-wizard \
10         i3-dump-log/i3-dump-log \
11         i3-input/i3-input \
12         i3-msg/i3-msg \
13         i3-nagbar/i3-nagbar
14
15 install-exec-hook:
16         $(LN_S) -f i3 $(DESTDIR)$(bindir)/i3-with-shmlog
17
18 uninstall-hook:
19         rm -f $(DESTDIR)$(bindir)/i3-with-shmlog
20
21 i3includedir=$(includedir)/i3
22 i3include_HEADERS = \
23         include/i3/ipc.h
24
25 dist_bin_SCRIPTS = \
26         i3-dmenu-desktop \
27         i3-migrate-config-to-v4 \
28         i3-save-tree \
29         i3-sensible-editor \
30         i3-sensible-pager \
31         i3-sensible-terminal
32
33 i3confdir = $(sysconfdir)/i3
34 dist_i3conf_DATA = \
35         etc/config \
36         etc/config.keycodes
37
38 applicationsdir = $(datarootdir)/applications
39 xsessionsdir = $(datarootdir)/xsessions
40 dist_applications_DATA = \
41         share/applications/i3.desktop
42 dist_xsessions_DATA = \
43         share/xsessions/i3.desktop \
44         share/xsessions/i3-with-shmlog.desktop
45
46 noinst_LIBRARIES = libi3.a
47
48 check_PROGRAMS = \
49         test.commands_parser \
50         test.config_parser \
51         test.inject_randr15
52
53 check_SCRIPTS = \
54         testcases/complete-run.pl
55
56 check_DATA = \
57         anyevent-i3.stamp
58
59 clean-check:
60         rm -rf testsuite-* latest i3-cfg-for-* _Inline
61 clean-local: clean-check
62
63 TESTS = testcases/complete-run.pl
64
65 EXTRA_DIST = \
66         $(dist_docs_toc_DATA:.html=) \
67         $(dist_docs_notoc_DATA:.html=) \
68         AnyEvent-I3/Changes \
69         AnyEvent-I3/MANIFEST \
70         AnyEvent-I3/MANIFEST.SKIP \
71         AnyEvent-I3/Makefile.PL \
72         AnyEvent-I3/README \
73         AnyEvent-I3/lib/AnyEvent/I3.pm \
74         AnyEvent-I3/t/00-load.t \
75         AnyEvent-I3/t/01-workspaces.t \
76         AnyEvent-I3/t/02-sugar.t \
77         AnyEvent-I3/t/boilerplate.t \
78         AnyEvent-I3/t/manifest.t \
79         AnyEvent-I3/t/pod-coverage.t \
80         AnyEvent-I3/t/pod.t \
81         contrib/dump-asy.pl \
82         contrib/gtk-tree-watch.pl \
83         contrib/i3-wsbar \
84         contrib/per-workspace-layout.pl \
85         contrib/trivial-bar-script.sh \
86         docs/asciidoc-git.conf \
87         docs/bigpicture.png \
88         docs/i3-pod2html \
89         docs/i3-sync.dia \
90         docs/i3-sync.png \
91         docs/i3-sync-working.dia \
92         docs/i3-sync-working.png \
93         docs/keyboard-layer1.png \
94         docs/keyboard-layer2.png \
95         docs/layout-saving-1.png \
96         docs/logo-30.png \
97         docs/modes.png \
98         docs/refcard.html \
99         docs/refcard_style.css \
100         docs/single_terminal.png \
101         docs/snapping.png \
102         docs/tree-layout1.png \
103         docs/tree-layout2.png \
104         docs/tree-shot1.png \
105         docs/tree-shot2.png \
106         docs/tree-shot3.png \
107         docs/tree-shot4.png \
108         docs/two_columns.png \
109         docs/two_terminals.png \
110         docs/wsbar.dia \
111         docs/wsbar.png \
112         i3bar/LICENSE \
113         libi3/README \
114         $(asciidoc_MANS:.1=.man) \
115         $(asciidoc_MANS:.1=.man) \
116         man/asciidoc.conf.in \
117         DEPENDS \
118         I3_VERSION \
119         LICENSE \
120         PACKAGE-MAINTAINER \
121         RELEASE-NOTES-4.15 \
122         generate-command-parser.pl \
123         parser-specs/commands.spec \
124         parser-specs/config.spec \
125         parser-specs/highlighting.vim \
126         pseudo-doc.doxygen \
127         testcases/complete-run.pl.in \
128         testcases/i3-test.config \
129         testcases/lib/i3test/Test.pm \
130         testcases/lib/i3test/Util.pm \
131         testcases/lib/i3test/XTEST.pm \
132         testcases/lib/i3test.pm.in \
133         testcases/lib/SocketActivation.pm \
134         testcases/lib/StartXServer.pm \
135         testcases/lib/StatusLine.pm \
136         testcases/lib/TestWorker.pm \
137         testcases/Makefile.PL \
138         testcases/new-test \
139         testcases/restart-state.golden \
140         testcases/t \
141         testcases/valgrind.supp
142
143 # dirstamps contains directories which we want to be created in $(top_builddir)
144 # so that our custom rules can store files in them.
145 dirstamp = .dirstamp
146 dirstamps = \
147         docs/$(dirstamp) \
148         man/$(dirstamp) \
149         parser/$(dirstamp)
150 DISTCLEANFILES = $(dirstamps)
151
152 $(dirstamps):
153         @stamp='$@'; $(MKDIR_P) "$${stamp%/*}"
154         @: > $@
155
156 ################################################################################
157 # docs generation
158 ################################################################################
159
160 docs_tocdir = ${docdir}
161 docs_notocdir = ${docdir}
162 docs_poddir = ${docdir}
163 if BUILD_DOCS
164 dist_docs_toc_DATA = \
165         docs/hacking-howto.html \
166         docs/userguide.html \
167         docs/ipc.html \
168         docs/multi-monitor.html \
169         docs/wsbar.html \
170         docs/testsuite.html \
171         docs/i3bar-protocol.html \
172         docs/layout-saving.html
173
174 dist_docs_notoc_DATA = \
175         docs/debugging.html
176
177 dist_docs_pod_DATA = \
178         docs/lib-i3test.html \
179         docs/lib-i3test-test.html
180
181 $(dist_docs_toc_DATA): docs/%.html: docs/% docs/$(dirstamp)
182         $(AM_V_GEN) @PATH_ASCIIDOC@ -a toc -n -o $@ $<
183
184 $(dist_docs_notoc_DATA): docs/%.html: docs/% docs/$(dirstamp)
185         $(AM_V_GEN) @PATH_ASCIIDOC@ -n -o $@ $<
186
187 docs/lib-i3test.html: testcases/lib/i3test.pm docs/$(dirstamp)
188         $(AM_V_GEN) $(top_srcdir)/docs/i3-pod2html $< $@
189
190 docs/lib-i3test-test.html: testcases/lib/i3test/Test.pm docs/$(dirstamp)
191         $(AM_V_GEN) $(top_srcdir)/docs/i3-pod2html $< $@
192
193 else
194 dist_docs_toc_DATA =
195 dist_docs_notoc_DATA =
196 dist_docs_pod_DATA =
197 endif
198
199 ################################################################################
200 # manpage generation
201 ################################################################################
202
203 if BUILD_MANS
204 dist_man1_MANS = \
205         $(asciidoc_MANS) \
206         $(pod_MANS)
207
208 asciidoc_MANS = \
209         man/i3.1 \
210         man/i3bar.1 \
211         man/i3-msg.1 \
212         man/i3-input.1 \
213         man/i3-nagbar.1 \
214         man/i3-config-wizard.1 \
215         man/i3-migrate-config-to-v4.1 \
216         man/i3-sensible-editor.1 \
217         man/i3-sensible-pager.1 \
218         man/i3-sensible-terminal.1 \
219         man/i3-dump-log.1
220
221 pod_MANS = \
222         man/i3-dmenu-desktop.1 \
223         man/i3-save-tree.1
224
225 $(asciidoc_MANS): man/%.1: man/%.xml man/$(dirstamp)
226         $(AM_V_GEN) out='$@'; @PATH_XMLTO@ man -o "$${out%/*}" $<
227         @stamp='$@'; $(MKDIR_P) "$${stamp%/*}"
228
229 man/%.xml: man/%.man man/asciidoc.conf man/$(dirstamp)
230         $(AM_V_GEN) @PATH_ASCIIDOC@ -d manpage -b docbook -f $(top_builddir)/man/asciidoc.conf -o $@ $<
231
232 $(pod_MANS): man/%.1: % man/$(dirstamp)
233         $(AM_V_GEN) @PATH_POD2MAN@ --utf8 $< > $@
234 else
235 asciidoc_MANS =
236 endif
237
238 AM_CPPFLAGS = \
239         -DSYSCONFDIR="\"$(sysconfdir)\"" \
240         -I$(top_builddir)/parser \
241         -I$(top_srcdir)/include \
242         @AX_EXTEND_SRCDIR_CPPFLAGS@
243
244 i3_CFLAGS = \
245         $(AM_CFLAGS) \
246         $(libi3_CFLAGS) \
247         $(LIBSN_CFLAGS) \
248         $(XCB_CFLAGS) \
249         $(XCB_UTIL_CURSOR_CFLAGS) \
250         $(XCB_UTIL_KEYSYM_CFLAGS) \
251         $(XCB_UTIL_WM_CFLAGS) \
252         $(XCB_UTIL_XRM_CFLAGS) \
253         $(XKBCOMMON_CFLAGS) \
254         $(YAJL_CFLAGS) \
255         $(LIBPCRE_CFLAGS) \
256         $(PTHREAD_CFLAGS) \
257         $(CODE_COVERAGE_CFLAGS)
258
259 i3_CPPFLAGS = \
260         $(AM_CPPFLAGS) \
261         $(CODE_COVERAGE_CPPFLAGS)
262
263 i3_LDADD = \
264         $(libi3_LIBS) \
265         $(LIBSN_LIBS) \
266         $(XCB_LIBS) \
267         $(XCB_UTIL_CURSOR_LIBS) \
268         $(XCB_UTIL_KEYSYMS_LIBS) \
269         $(XCB_UTIL_WM_LIBS) \
270         $(XCB_UTIL_XRM_LIBS) \
271         $(XKBCOMMON_LIBS) \
272         $(YAJL_LIBS) \
273         $(LIBPCRE_LIBS) \
274         $(PANGOCAIRO_LIBS) \
275         $(PTHREAD_LIBS) \
276         $(CODE_COVERAGE_LDFLAGS)
277
278 libi3_CFLAGS = \
279         $(AM_CFLAGS) \
280         $(XCB_CFLAGS) \
281         $(XCB_UTIL_CFLAGS) \
282         $(XCB_UTIL_XRM_CFLAGS) \
283         $(YAJL_CFLAGS) \
284         $(PANGOCAIRO_CFLAGS)
285
286 libi3_LIBS = \
287         $(top_builddir)/libi3.a \
288         $(XCB_LIBS) \
289         $(XCB_UTIL_LIBS) \
290         $(XCB_UTIL_XRM_LIBS) \
291         $(YAJL_LIBS) \
292         $(PANGOCAIRO_LIBS)
293
294 libi3_a_CFLAGS = \
295         $(libi3_CFLAGS)
296
297 libi3_a_SOURCES = \
298         include/libi3.h \
299         libi3/dpi.c \
300         libi3/draw_util.c \
301         libi3/fake_configure_notify.c \
302         libi3/font.c \
303         libi3/format_placeholders.c \
304         libi3/g_utf8_make_valid.c \
305         libi3/get_colorpixel.c \
306         libi3/get_config_path.c \
307         libi3/get_exe_path.c \
308         libi3/get_mod_mask.c \
309         libi3/get_process_filename.c \
310         libi3/get_visualtype.c \
311         libi3/ipc_connect.c \
312         libi3/ipc_recv_message.c \
313         libi3/ipc_send_message.c \
314         libi3/is_debug_build.c \
315         libi3/mkdirp.c \
316         libi3/resolve_tilde.c \
317         libi3/root_atom_contents.c \
318         libi3/safewrappers.c \
319         libi3/string.c \
320         libi3/strndup.c \
321         libi3/ucs2_conversion.c
322
323 i3_dump_log_i3_dump_log_CFLAGS = \
324         $(AM_CFLAGS) \
325         $(PTHREAD_CFLAGS) \
326         $(libi3_CFLAGS)
327
328 i3_dump_log_i3_dump_log_LDADD = \
329         $(PTHREAD_LIBS) \
330         $(libi3_LIBS)
331
332 i3_dump_log_i3_dump_log_SOURCES = \
333         i3-dump-log/main.c
334
335 i3_input_i3_input_CFLAGS = \
336         $(AM_CFLAGS) \
337         $(libi3_CFLAGS)
338
339 i3_input_i3_input_LDADD = \
340         $(libi3_LIBS) \
341         $(XCB_UTIL_KEYSYMS_LIBS)
342
343 i3_input_i3_input_SOURCES = \
344         i3-input/i3-input.h \
345         i3-input/keysym2ucs.c \
346         i3-input/keysym2ucs.h \
347         i3-input/main.c
348
349 i3_msg_i3_msg_CFLAGS = \
350         $(AM_CFLAGS) \
351         $(libi3_CFLAGS)
352
353 i3_msg_i3_msg_LDADD = \
354         $(libi3_LIBS)
355
356 i3_msg_i3_msg_SOURCES = \
357         i3-msg/main.c
358
359 i3_nagbar_i3_nagbar_CFLAGS = \
360         $(AM_CFLAGS) \
361         $(LIBSN_CFLAGS) \
362         $(libi3_CFLAGS)
363
364 i3_nagbar_i3_nagbar_LDADD = \
365         $(libi3_LIBS) \
366         $(LIBSN_LIBS) \
367         $(XCB_UTIL_CURSOR_LIBS)
368
369 i3_nagbar_i3_nagbar_SOURCES = \
370         i3-nagbar/atoms.xmacro \
371         i3-nagbar/i3-nagbar.h \
372         i3-nagbar/main.c
373
374 i3bar_i3bar_CPPFLAGS = \
375         $(AM_CPPFLAGS) \
376         -I$(top_srcdir)/i3bar/include
377
378 i3bar_i3bar_CFLAGS = \
379         $(AM_CFLAGS) \
380         $(libi3_CFLAGS) \
381         $(XCB_CFLAGS) \
382         $(XKBCOMMON_CFLAGS) \
383         $(PANGOCAIRO_CFLAGS) \
384         $(YAJL_CFLAGS)
385
386 i3bar_i3bar_LDADD = \
387         $(libi3_LIBS) \
388         $(XCB_LIBS) \
389         $(XCB_UTIL_CURSOR_LIBS) \
390         $(XKBCOMMON_LIBS) \
391         $(PANGOCAIRO_LIBS) \
392         $(YAJL_LIBS)
393
394 i3bar_i3bar_SOURCES = \
395         i3bar/include/child.h \
396         i3bar/include/common.h \
397         i3bar/include/configuration.h \
398         i3bar/include/ipc.h \
399         i3bar/include/mode.h \
400         i3bar/include/outputs.h \
401         i3bar/include/parse_json_header.h \
402         i3bar/include/trayclients.h \
403         i3bar/include/util.h \
404         i3bar/include/workspaces.h \
405         i3bar/include/xcb_atoms.def \
406         i3bar/include/xcb.h \
407         i3bar/src/child.c \
408         i3bar/src/config.c \
409         i3bar/src/ipc.c \
410         i3bar/src/main.c \
411         i3bar/src/mode.c \
412         i3bar/src/outputs.c \
413         i3bar/src/parse_json_header.c \
414         i3bar/src/workspaces.c \
415         i3bar/src/xcb.c
416
417 i3_config_wizard_i3_config_wizard_CFLAGS = \
418         $(AM_CFLAGS) \
419         $(libi3_CFLAGS) \
420         $(LIBSN_CFLAGS) \
421         $(XKBCOMMON_CFLAGS)
422
423 i3_config_wizard_i3_config_wizard_LDADD = \
424         $(libi3_LIBS) \
425         $(LIBSN_LIBS) \
426         $(XCB_UTIL_KEYSYMS_LIBS) \
427         $(XKBCOMMON_LIBS)
428
429 i3_config_wizard_i3_config_wizard_SOURCES = \
430         i3-config-wizard/atoms.xmacro \
431         i3-config-wizard/main.c \
432         i3-config-wizard/xcb.h
433
434 test_inject_randr15_CPPFLAGS = \
435         $(AM_CPPFLAGS)
436
437 test_inject_randr15_CFLAGS = \
438         $(AM_CFLAGS) \
439         $(i3_CFLAGS)
440
441 test_inject_randr15_SOURCES = \
442         testcases/inject_randr1.5.c
443
444 test_inject_randr15_LDADD = \
445         $(i3_LDADD)
446
447 test_commands_parser_CPPFLAGS = \
448         $(AM_CPPFLAGS) \
449         -DTEST_PARSER
450
451 test_commands_parser_CFLAGS = \
452         $(AM_CFLAGS) \
453         $(i3_CFLAGS)
454
455 test_commands_parser_SOURCES = \
456         src/commands_parser.c
457
458 test_commands_parser_LDADD = \
459         $(i3_LDADD)
460
461 test_config_parser_CPPFLAGS = \
462         $(AM_CPPFLAGS) \
463         -DTEST_PARSER
464
465 test_config_parser_CFLAGS = \
466         $(AM_CFLAGS) \
467         $(i3_CFLAGS)
468
469 test_config_parser_SOURCES = \
470         src/config_parser.c
471
472 test_config_parser_LDADD = \
473         $(i3_LDADD)
474
475 command_parser_SOURCES = \
476         parser/GENERATED_command_enums.h \
477         parser/GENERATED_command_tokens.h \
478         parser/GENERATED_command_call.h
479
480 config_parser_SOURCES = \
481         parser/GENERATED_config_enums.h \
482         parser/GENERATED_config_tokens.h \
483         parser/GENERATED_config_call.h
484
485 i3_SOURCES = \
486         $(command_parser_SOURCES) \
487         $(config_parser_SOURCES) \
488         include/all.h \
489         include/assignments.h \
490         include/atoms_NET_SUPPORTED.xmacro \
491         include/atoms_rest.xmacro \
492         include/atoms.xmacro \
493         include/bindings.h \
494         include/click.h \
495         include/cmdparse.h \
496         include/commands.h \
497         include/commands_parser.h \
498         include/config_directives.h \
499         include/configuration.h \
500         include/config_parser.h \
501         include/con.h \
502         include/data.h \
503         include/display_version.h \
504         include/ewmh.h \
505         include/fake_outputs.h \
506         include/floating.h \
507         include/handlers.h \
508         include/i3.h \
509         include/ipc.h \
510         include/key_press.h \
511         include/load_layout.h \
512         include/log.h \
513         include/main.h \
514         include/manage.h \
515         include/match.h \
516         include/move.h \
517         include/output.h \
518         include/queue.h \
519         include/randr.h \
520         include/regex.h \
521         include/render.h \
522         include/resize.h \
523         include/restore_layout.h \
524         include/scratchpad.h \
525         include/sd-daemon.h \
526         include/shmlog.h \
527         include/sighandler.h \
528         include/startup.h \
529         include/sync.h \
530         include/tree.h \
531         include/util.h \
532         include/window.h \
533         include/workspace.h \
534         include/xcb.h \
535         include/xcursor.h \
536         include/x.h \
537         include/xinerama.h \
538         include/yajl_utils.h \
539         src/assignments.c \
540         src/bindings.c \
541         src/click.c \
542         src/commands.c \
543         src/commands_parser.c \
544         src/con.c \
545         src/config.c \
546         src/config_directives.c \
547         src/config_parser.c \
548         src/display_version.c \
549         src/ewmh.c \
550         src/fake_outputs.c \
551         src/floating.c \
552         src/handlers.c \
553         src/ipc.c \
554         src/key_press.c \
555         src/load_layout.c \
556         src/log.c \
557         src/main.c \
558         src/manage.c \
559         src/match.c \
560         src/move.c \
561         src/output.c \
562         src/randr.c \
563         src/regex.c \
564         src/render.c \
565         src/resize.c \
566         src/restore_layout.c \
567         src/scratchpad.c \
568         src/sd-daemon.c \
569         src/sighandler.c \
570         src/startup.c \
571         src/sync.c \
572         src/tree.c \
573         src/util.c \
574         src/version.c \
575         src/window.c \
576         src/workspace.c \
577         src/x.c \
578         src/xcb.c \
579         src/xcursor.c \
580         src/xinerama.c
581
582 ################################################################################
583 # parser generation
584 ################################################################################
585
586 $(command_parser_SOURCES): %.h: i3-command-parser.stamp
587
588 $(config_parser_SOURCES): %.h: i3-config-parser.stamp
589
590 src/i3-commands_parser.$(OBJEXT): i3-command-parser.stamp
591
592 src/i3-config_parser.$(OBJEXT): i3-config-parser.stamp
593
594 i3-command-parser.stamp: parser/$(dirstamp) generate-command-parser.pl parser-specs/commands.spec
595         $(AM_V_GEN) $(top_srcdir)/generate-command-parser.pl --input=$(top_srcdir)/parser-specs/commands.spec --prefix=command
596         $(AM_V_at) mv GENERATED_command_* $(top_builddir)/parser
597         $(AM_V_at) touch $@
598
599 i3-config-parser.stamp: parser/$(dirstamp) generate-command-parser.pl parser-specs/config.spec
600         $(AM_V_GEN) $(top_srcdir)/generate-command-parser.pl --input=$(top_srcdir)/parser-specs/config.spec --prefix=config
601         $(AM_V_at) mv GENERATED_config_* $(top_builddir)/parser
602         $(AM_V_at) touch $@
603
604 ################################################################################
605 # AnyEvent-I3 build process
606 ################################################################################
607
608 anyevent-i3.stamp: AnyEvent-I3/lib/AnyEvent/I3.pm
609         $(AM_V_BUILD) (cd $(top_srcdir)/AnyEvent-I3 && perl Makefile.PL && make)
610         $(AM_V_at) touch $@
611
612 CLEANFILES = \
613         i3-command-parser.stamp \
614         i3-config-parser.stamp \
615         anyevent-i3.stamp