]> git.sur5r.net Git - i3/i3/blob - Makefile
Move i3-dump-log to the new Makefile layout
[i3/i3] / Makefile
1 TOPDIR=$(shell pwd)
2
3 include $(TOPDIR)/common.mk
4
5 SUBDIRS:=
6
7 ALL_TARGETS =
8 INSTALL_TARGETS =
9 CLEAN_TARGETS =
10 DISTCLEAN_TARGETS =
11
12 all: real-all
13
14 include libi3/libi3.mk
15 include src/i3.mk
16 include i3-config-wizard/i3-config-wizard.mk
17 include i3-msg/i3-msg.mk
18 include i3-input/i3-input.mk
19 include i3-nagbar/i3-nagbar.mk
20 include i3bar/i3bar.mk
21 include i3-dump-log/i3-dump-log.mk
22
23 real-all: $(ALL_TARGETS) subdirs
24
25 subdirs:
26         for dir in $(SUBDIRS); do \
27                 echo ""; \
28                 echo "MAKE $$dir"; \
29                 $(MAKE) -C $$dir; \
30         done
31
32 install: $(INSTALL_TARGETS)
33         for dir in $(SUBDIRS); do \
34                 $(MAKE) -C $$dir install; \
35         done
36
37 dist: distclean
38         [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
39         [ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2
40         mkdir i3-${VERSION}
41         cp i3-migrate-config-to-v4 generate-command-parser.pl i3-sensible-* i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3.applications.desktop pseudo-doc.doxygen Makefile i3-${VERSION}
42         cp -r src libi3 i3-msg i3-nagbar i3-config-wizard i3bar i3-dump-log yajl-fallback include man parser-specs i3-${VERSION}
43         # Only copy toplevel documentation (important stuff)
44         mkdir i3-${VERSION}/docs
45         # Pre-generate documentation
46         $(MAKE) -C docs
47         $(MAKE) -C i3bar/doc
48         # Cleanup τεχ output files
49         find docs -regex ".*\.\(aux\|out\|log\|toc\|bm\|dvi\|log\)" -exec rm '{}' \;
50         find docs -maxdepth 1 -type f ! \( -name "*.xcf" -or -name "*.svg" \) -exec cp '{}' i3-${VERSION}/docs \;
51         # Only copy source code from i3-input
52         mkdir i3-${VERSION}/i3-input
53         find i3-input -maxdepth 1 -type f \( -name "*.c" -or -name "*.h" -or -name "Makefile" \) -exec cp '{}' i3-${VERSION}/i3-input \;
54         sed -e 's/^GIT_VERSION:=\(.*\)/GIT_VERSION:=$(shell /bin/echo '${GIT_VERSION}' | sed 's/\\/\\\\/g')/g;s/^VERSION:=\(.*\)/VERSION:=${VERSION}/g' common.mk > i3-${VERSION}/common.mk
55         # Pre-generate a manpage to allow distributors to skip this step and save some dependencies
56         $(MAKE) -C man
57         cp man/*.1 i3-${VERSION}/man/
58         cp i3bar/doc/*.1 i3-${VERSION}/i3bar/doc/
59         tar cfj i3-${VERSION}.tar.bz2 i3-${VERSION}
60         rm -rf i3-${VERSION}
61
62 clean: $(CLEAN_TARGETS)
63         (which lcov >/dev/null 2>&1 && lcov -d . --zerocounters) || true
64         $(MAKE) -C docs clean
65         $(MAKE) -C man clean
66         for dir in $(SUBDIRS); do \
67                 echo ""; \
68                 echo "CLEAN $$dir"; \
69                 $(MAKE) TOPDIR=$(TOPDIR) -C $$dir distclean; \
70         done
71
72 distclean: clean $(DISTCLEAN_TARGETS)
73         rm -f i3
74         for dir in $(SUBDIRS); do \
75                 echo ""; \
76                 echo "DISTCLEAN $$dir"; \
77                 $(MAKE) TOPDIR=$(TOPDIR) -C $$dir distclean; \
78         done
79
80 coverage:
81         rm -f /tmp/i3-coverage.info
82         rm -rf /tmp/i3-coverage
83         lcov -d . -b . --capture -o /tmp/i3-coverage.info
84         genhtml -o /tmp/i3-coverage/ /tmp/i3-coverage.info