summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-07-27 15:19:11 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-07-27 15:19:11 -0600
commitc2d396b20c1b0fc1ed3b070a41c9ed07c3930bde (patch)
tree7aa178a17fc79711a6c312f1dbf1657d1082c901
parent05463eaf611f4784b3693b74029c3f5a6da1d70b (diff)
revamp the Makefiles to support manpages
-rw-r--r--.gitignore16
-rw-r--r--common.mk51
-rw-r--r--config.mk2
-rw-r--r--doc/Makefile18
-rw-r--r--src/Makefile2
-rw-r--r--src/abslibre-tools/Makefile2
-rw-r--r--src/chroot-tools/Makefile2
-rw-r--r--src/fullpkg/Makefile2
-rw-r--r--src/librefetch/Makefile2
-rw-r--r--src/mips64el-tools/Makefile2
-rw-r--r--src/toru/Makefile2
11 files changed, 85 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 1f2308d..46da0e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,18 @@
*~
#*
+*.1
+*.2
+*.3
+*.4
+*.5
+*.6
+*.7
+*.8
+*.1.html
+*.2.html
+*.3.html
+*.4.html
+*.5.html
+*.6.html
+*.7.html
+*.8.html
diff --git a/common.mk b/common.mk
index bbb1b7c..a2aa260 100644
--- a/common.mk
+++ b/common.mk
@@ -2,20 +2,57 @@ topdir := $(dir $(lastword $(MAKEFILE_LIST)))
include $(topdir)/config.mk
################################################################################
-progs = $(shell find . -maxdepth 1 -type f -executable -printf '%f\n')
-confs = $(shell find . -maxdepth 1 -type f -not -executable -printf '%f\n'|fgrep -v Makefile)
-files = $(addprefix $(DESTDIR)$(libre_execdir)/,$(progs)) \
- $(addprefix $(DESTDIR)$(libre_datadir)/,$(confs))
+
+progs = $(shell find . -maxdepth 1 -type f -executable -printf '%f\n')
+confs = $(shell find . -maxdepth 1 -type f -name '*.conf' -printf '%f\n')
+mans = $(shell find . -maxdepth 1 -type f -name '*.ronn' -printf '%f\n' | sed 's/\.ronn$$//')
all: PHONY build
-build: PHONY
+################################################################################
+
+build_files = $(progs) $(confs) $(mans)
+build: PHONY $(build_files)
+
+%: %.ronn
+ ronn --roff $(RONNFLAGS) '$<'
+%.html: %.ronn
+ ronn --html $(RONNFLAGS) '$<'
-install: PHONY $(files)
+################################################################################
+
+install_files = $(addprefix $(DESTDIR)$(libre_execdir)/,$(progs)) \
+ $(addprefix $(DESTDIR)$(libre_confdir)/,$(confs)) \
+ $(addprefix $(DESTDIR)$(mandir)/man1/,$(filter %.1,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man2/,$(filter %.2,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man3/,$(filter %.3,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man4/,$(filter %.4,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man5/,$(filter %.5,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man6/,$(filter %.6,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man7/,$(filter %.7,$(mans))) \
+ $(addprefix $(DESTDIR)$(mandir)/man8/,$(filter %.8,$(mans)))
+install: PHONY $(install_files)
$(DESTDIR)$(libre_execdir)/%: %
install -Dm755 '$<' '$@'
-$(DESTDIR)$(libre_datadir)/%: %
+$(DESTDIR)$(libre_confdir)/%: %
+ install -Dm644 '$<' '$@'
+
+$(DESTDIR)$(mandir)/man1/%.1: %.1
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man2/%.2: %.2
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man3/%.3: %.3
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man4/%.4: %.4
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man5/%.5: %.5
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man6/%.6: %.6
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man7/%.7: %.7
+ install -Dm644 '$<' '$@'
+$(DESTDIR)$(mandir)/man8/%.8: %.8
install -Dm644 '$<' '$@'
################################################################################
diff --git a/config.mk b/config.mk
index 5d07d8d..3eeb9f6 100644
--- a/config.mk
+++ b/config.mk
@@ -21,5 +21,7 @@ datadir=$(datarootdir)
sysconfdir=/etc
docdir=$(datarootdir)/doc
+mandir=$(datarootdir)/man
devtoolsdir=$(topdir)/../devtools-par
+RONNFLAGS=--manual='libretools Manual' --organization='Parabola'
diff --git a/doc/Makefile b/doc/Makefile
index 7af3750..4e496f3 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,2 +1,16 @@
-libre_datadir=$(docdir)/libretools
-include ../common.mk
+topdir := $(realpath ..)
+include $(topdir)/config.mk
+
+files = $(wildcard *.md)
+
+all: PHONY build
+build: PHONY
+
+install: $(addprefix $(DESTDIR)$(docdir)/libretools/,$(files))
+
+$(DESTDIR)$(docdir)/libretools/%: %
+ install -Dm644 '$<' '$@'
+
+FORCE: PHONY
+PHONY:
+.PHONY: FORCE PHONY
diff --git a/src/Makefile b/src/Makefile
index ff8d399..35a92a0 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)
+libre_confdir=$(sysconfdir)
include ../common.mk
diff --git a/src/abslibre-tools/Makefile b/src/abslibre-tools/Makefile
index f2cec54..271cc5e 100644
--- a/src/abslibre-tools/Makefile
+++ b/src/abslibre-tools/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk
diff --git a/src/chroot-tools/Makefile b/src/chroot-tools/Makefile
index 3ae95ea..27030e3 100644
--- a/src/chroot-tools/Makefile
+++ b/src/chroot-tools/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(sbindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk
diff --git a/src/fullpkg/Makefile b/src/fullpkg/Makefile
index f2cec54..271cc5e 100644
--- a/src/fullpkg/Makefile
+++ b/src/fullpkg/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk
diff --git a/src/librefetch/Makefile b/src/librefetch/Makefile
index f2cec54..271cc5e 100644
--- a/src/librefetch/Makefile
+++ b/src/librefetch/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk
diff --git a/src/mips64el-tools/Makefile b/src/mips64el-tools/Makefile
index f2cec54..271cc5e 100644
--- a/src/mips64el-tools/Makefile
+++ b/src/mips64el-tools/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk
diff --git a/src/toru/Makefile b/src/toru/Makefile
index f2cec54..271cc5e 100644
--- a/src/toru/Makefile
+++ b/src/toru/Makefile
@@ -1,3 +1,3 @@
libre_execdir=$(bindir)
-libre_datadir=$(sysconfdir)/libretools.d
+libre_confdir=$(sysconfdir)/libretools.d
include ../../common.mk