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