summaryrefslogtreecommitdiff
path: root/common.mk
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 /common.mk
parent05463eaf611f4784b3693b74029c3f5a6da1d70b (diff)
revamp the Makefiles to support manpages
Diffstat (limited to 'common.mk')
-rw-r--r--common.mk51
1 files changed, 44 insertions, 7 deletions
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 '$<' '$@'
################################################################################