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