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