summaryrefslogtreecommitdiffhomepage
path: root/auto/make
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2021-03-24 18:45:45 +0300
committerKonstantin Pavlov <thresh@nginx.com>2021-03-24 18:45:45 +0300
commitb33babcedaa032b901aa37aa57da46e6116509f0 (patch)
tree66598cd85fa7f58f9641e63f036390830cc136dc /auto/make
parent6d7c6196e1ac412d1d9763c73e87afcd1cbf0ac4 (diff)
downloadunit-b33babcedaa032b901aa37aa57da46e6116509f0.tar.gz
unit-b33babcedaa032b901aa37aa57da46e6116509f0.tar.bz2
Added build system support for a man page.
Diffstat (limited to 'auto/make')
-rw-r--r--auto/make33
1 files changed, 27 insertions, 6 deletions
diff --git a/auto/make b/auto/make
index fcf258fa..18d23917 100644
--- a/auto/make
+++ b/auto/make
@@ -22,10 +22,11 @@ NXT_EXEC_LINK = $NXT_EXEC_LINK $NXT_LD_OPT
NXT_SHARED_LOCAL_LINK = $NXT_SHARED_LOCAL_LINK $NXT_LD_OPT
NXT_MODULE_LINK = $NXT_MODULE_LINK
-all: $NXT_DAEMON
+all: $NXT_DAEMON manpage
-.PHONY: $NXT_DAEMON
+.PHONY: $NXT_DAEMON manpage
$NXT_DAEMON: $NXT_BUILD_DIR/$NXT_DAEMON
+manpage: $NXT_BUILD_DIR/unitd.8
END
@@ -305,6 +306,19 @@ $NXT_BUILD_DIR/$NXT_DAEMON: $NXT_BUILD_DIR/$NXT_LIB_STATIC \\
END
+# unitd man page
+
+cat << END >> $NXT_MAKEFILE
+
+$NXT_BUILD_DIR/unitd.8: docs/man/unitd.8.in $NXT_BUILD_DIR/nxt_auto_config.h
+ sed -e "s|%%ERROR_LOG_PATH%%|$NXT_LOG|" \\
+ -e "s|%%PID_PATH%%|$NXT_PID|" \\
+ -e "s|%%SOCKET_PATH%%|$NXT_CONTROL|" \\
+ < docs/man/unitd.8.in > \$@
+
+END
+
+
# unit object files.
for nxt_src in $NXT_MAKE_SRCS
@@ -334,9 +348,9 @@ done
cat << END >> $NXT_MAKEFILE
-.PHONY: install ${NXT_DAEMON}-install install-check
+.PHONY: install ${NXT_DAEMON}-install install-check manpage-install
-install: ${NXT_DAEMON}-install
+install: ${NXT_DAEMON}-install manpage-install
install-check:
@test -n "\$(DESTDIR)$NXT_PREFIX" \\
@@ -352,15 +366,22 @@ ${NXT_DAEMON}-install: $NXT_DAEMON install-check
install -p $NXT_BUILD_DIR/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/
install -d \$(DESTDIR)$NXT_STATE
+manpage-install: manpage install-check
+ install -d \$(DESTDIR)$NXT_MANDIR/man8
+ install -p $NXT_BUILD_DIR/unitd.8 \$(DESTDIR)$NXT_MANDIR/man8/
-.PHONY: uninstall ${NXT_DAEMON}-uninstall
+.PHONY: uninstall ${NXT_DAEMON}-uninstall manpage-uninstall
-uninstall: ${NXT_DAEMON}-uninstall
+uninstall: ${NXT_DAEMON}-uninstall manpage-uninstall
${NXT_DAEMON}-uninstall:
rm -f \$(DESTDIR)$NXT_SBINDIR/$NXT_DAEMON
@rmdir -p \$(DESTDIR)$NXT_SBINDIR 2>/dev/null || true
+manpage-uninstall:
+ rm -f \$(DESTDIR)$NXT_MANDIR/man8/unitd.8
+ @rmdir -p \$(DESTDIR)$NXT_MANDIR/man8 2>/dev/null || true
+
END
cat << END >> $NXT_MAKEFILE