summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2012-06-17 12:52:41 (GMT)
committerQuentin Glidic <sardemff7+git@sardemff7.net>2012-07-22 18:27:13 (GMT)
commit8029fae6a900edb8e840cf11ce90543fa898e743 (patch)
tree7f69ad0222d1446d75242220b6de602f86240193
parente452acb30e8253a3a4b53233f22b31460cb02aec (diff)
downloadi3-8029fae6a900edb8e840cf11ce90543fa898e743.tar.gz
i3-8029fae6a900edb8e840cf11ce90543fa898e743.tar.bz2
Move mans to the new Makefile layout
-rw-r--r--Makefile6
-rw-r--r--common.mk1
-rw-r--r--i3bar/doc/Makefile9
-rw-r--r--man/Makefile16
-rw-r--r--man/i3bar.man (renamed from i3bar/doc/i3bar.man)0
-rw-r--r--man/man.mk32
6 files changed, 39 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 5374527..94c9c63 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ include i3-nagbar/i3-nagbar.mk
include i3bar/i3bar.mk
include i3-dump-log/i3-dump-log.mk
include docs/docs.mk
+include man/man.mk
real-all: $(ALL_TARGETS)
@@ -35,7 +36,6 @@ dist: distclean
mkdir i3-${VERSION}/docs
# Pre-generate documentation
$(MAKE) docs
- $(MAKE) -C i3bar/doc
# Cleanup τεχ output files
find docs -regex ".*\.\(aux\|out\|log\|toc\|bm\|dvi\|log\)" -exec rm '{}' \;
find docs -maxdepth 1 -type f ! \( -name "*.xcf" -or -name "*.svg" \) -exec cp '{}' i3-${VERSION}/docs \;
@@ -44,15 +44,13 @@ dist: distclean
find i3-input -maxdepth 1 -type f \( -name "*.c" -or -name "*.h" -or -name "Makefile" \) -exec cp '{}' i3-${VERSION}/i3-input \;
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
# Pre-generate a manpage to allow distributors to skip this step and save some dependencies
- $(MAKE) -C man
+ $(MAKE) mans
cp man/*.1 i3-${VERSION}/man/
- cp i3bar/doc/*.1 i3-${VERSION}/i3bar/doc/
tar cfj i3-${VERSION}.tar.bz2 i3-${VERSION}
rm -rf i3-${VERSION}
clean: $(CLEAN_TARGETS)
(which lcov >/dev/null 2>&1 && lcov -d . --zerocounters) || true
- $(MAKE) -C man clean
distclean: clean $(DISTCLEAN_TARGETS)
diff --git a/common.mk b/common.mk
index 2f550cf..941da7d 100644
--- a/common.mk
+++ b/common.mk
@@ -147,6 +147,7 @@ ifeq ($(V),0)
# echo-ing vars
V_ASCIIDOC = echo ASCIIDOC $@;
+V_A2X = echo A2X $@;
endif
# Always remake the following targets
diff --git a/i3bar/doc/Makefile b/i3bar/doc/Makefile
deleted file mode 100644
index 6956675..0000000
--- a/i3bar/doc/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-all: i3bar.1
-
-i3bar.1: i3bar.man
- echo "A2X i3bar"
- a2x --no-xmllint -f manpage i3bar.man
-clean:
- rm -f i3bar.xml i3bar.1 i3bar.html
-
-distclean: clean
diff --git a/man/Makefile b/man/Makefile
index ff08dc5..e4cee0c 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -1,15 +1,7 @@
-A2M:=a2x -f manpage --asciidoc-opts="-f asciidoc.conf"
-
-all: i3.1 i3-msg.1 i3-input.1 i3-nagbar.1 i3-config-wizard.1 i3-migrate-config-to-v4.1 i3-sensible-editor.1 i3-sensible-pager.1 i3-sensible-terminal.1 i3-dump-log.1
-
-%.1: %.man asciidoc.conf
- ${A2M} $<
+all:
+ $(MAKE) -C .. mans
clean:
- for file in $$(echo i3 i3-msg i3-input i3-nagbar i3-wsbar i3-config-wizard i3-migrate-config-to-v4 i3-sensible-editor i3-sensible-pager i3-sensible-terminal i3-dump-log); \
- do \
- rm -f $${file}.1 $${file}.html $${file}.xml; \
- done
+ $(MAKE) -C .. clean-mans
-distclean: clean
- rm -f *.1
+.PHONY: all clean
diff --git a/i3bar/doc/i3bar.man b/man/i3bar.man
index dcf3022..dcf3022 100644
--- a/i3bar/doc/i3bar.man
+++ b/man/i3bar.man
diff --git a/man/man.mk b/man/man.mk
new file mode 100644
index 0000000..f999dc7
--- /dev/null
+++ b/man/man.mk
@@ -0,0 +1,32 @@
+DISTCLEAN_TARGETS += clean-mans
+
+A2X = a2x
+
+A2X_MAN_CALL = $(V_A2X)$(A2X) -f manpage --asciidoc-opts="-f man/asciidoc.conf" $(A2X_FLAGS) $<
+
+MANS_1 = \
+ man/i3.1 \
+ man/i3bar.1 \
+ man/i3-msg.1 \
+ man/i3-input.1 \
+ man/i3-nagbar.1 \
+ man/i3-config-wizard.1 \
+ man/i3-migrate-config-to-v4.1 \
+ man/i3-sensible-editor.1 \
+ man/i3-sensible-pager.1 \
+ man/i3-sensible-terminal.1 \
+ man/i3-dump-log.1
+
+MANS = \
+ $(MANS_1)
+
+mans: $(MANS)
+
+$(MANS_1): %.1: %.man man/asciidoc.conf
+ $(A2X_MAN_CALL)
+
+clean-mans:
+ for file in $(notdir $(MANS)); \
+ do \
+ rm -f man/$${file} man/$${file%.*}.html man/$${file%.*}.xml; \
+ done