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