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