]> git.sur5r.net Git - i3/i3/blob - Makefile
d62db5d0166a0170e7d40612ea89d573440ad29a
[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 include docs/docs.mk
23 include man/man.mk
24
25 # Update $(TOPDIR)/LAST_VERSION if it differs from $I3_VERSION
26 CACHED_VERSION := '$(shell [ -f $(TOPDIR)/LAST_VERSION ] && cat $(TOPDIR)/LAST_VERSION)'
27 ifneq ($(CACHED_VERSION),$(I3_VERSION))
28 $(shell echo -n ${I3_VERSION} > $(TOPDIR)/LAST_VERSION)
29 endif
30
31 real-all: $(ALL_TARGETS)
32
33 install: $(INSTALL_TARGETS)
34
35 store_git_version:
36         echo -n ${I3_VERSION} > I3_VERSION
37         echo -n ${VERSION} > VERSION
38
39 dist: distclean
40         [ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
41         [ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2
42         mkdir i3-${VERSION}
43         cp i3-migrate-config-to-v4 i3-save-tree generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3-with-shmlog.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION}
44         cp -r src libi3 i3-msg i3-nagbar i3-config-wizard i3bar i3-dump-log include man parser-specs testcases i3-${VERSION}
45         # Only copy toplevel documentation (important stuff)
46         mkdir i3-${VERSION}/docs
47         # Pre-generate documentation
48         $(MAKE) docs
49         # Cleanup τεχ output files
50         find docs -regex ".*\.\(aux\|out\|log\|toc\|bm\|dvi\|log\)" -exec rm '{}' \;
51         find docs -maxdepth 1 -type f ! \( -name "*.xcf" -or -name "*.svg" \) -exec cp '{}' i3-${VERSION}/docs \;
52         # Only copy source code from i3-input
53         mkdir i3-${VERSION}/i3-input
54         find i3-input -maxdepth 1 -type f \( -name "*.c" -or -name "*.mk" -or -name "*.h" -or -name "Makefile" \) -exec cp '{}' i3-${VERSION}/i3-input \;
55         cp I3_VERSION i3-${VERSION}/I3_VERSION
56         cp VERSION i3-${VERSION}/VERSION
57         # Pre-generate a manpage to allow distributors to skip this step and save some dependencies
58         $(MAKE) mans
59         cp man/*.1 i3-${VERSION}/man/
60         tar cfj i3-${VERSION}.tar.bz2 i3-${VERSION}
61         rm -rf i3-${VERSION}
62
63 clean: $(CLEAN_TARGETS)
64         (which lcov >/dev/null 2>&1 && lcov -d . --zerocounters) || true
65
66 distclean: clean $(DISTCLEAN_TARGETS)
67
68 coverage:
69         rm -f /tmp/i3-coverage.info
70         rm -rf /tmp/i3-coverage
71         lcov -d . -b . --capture -o /tmp/i3-coverage.info
72         genhtml -o /tmp/i3-coverage/ /tmp/i3-coverage.info