diff --git a/Makefile b/Makefile index e85e4b8..9578caf 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,7 @@ includedir ?= $(prefix)/include datarootdir ?= $(prefix)/share datadir ?= $(datarootdir) mydatadir ?= $(datadir)/smax-clib +mandir ?= $(datarootdir)/man docdir ?= $(datarootdir)/doc/smax-clib htmldir ?= $(docdir)/html @@ -121,7 +122,7 @@ INSTALL_PROGRAM ?= install INSTALL_DATA ?= install -m 644 .PHONY: install -install: install-libs install-tools install-headers install-apidoc +install: install-libs install-tools install-man install-headers install-apidoc .PHONY: install-libs install-libs: @@ -143,6 +144,12 @@ else @echo "WARNING! Skipping tools install: needs 'tools'" endif +.PHONY: install-man +install-man: + @echo "installing man pages under $(DESTDIR)$(mandir)." + @install -d $(DESTDIR)$(mandir)/man1 + $(INSTALL_DATA) -D man/man1/* $(DESTDIR)$(mandir)/man1 + .PHONY: install-headers install-headers: @echo "installing headers to $(DESTDIR)$(includedir)" diff --git a/README.md b/README.md index bfd3786..b9af9fc 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,17 @@ system-wide install you may simply run: $ sudo make install ``` -Or, to install in some other locations, you may set a prefix. For example to install under `/opt` instead, you can: +Or, to install in some other locations, you may set a prefix and/or `DESTDIR`. For example, to install under `/opt` +instead, you can: ```bash - $ sudo make prefix=/opt install + $ sudo make prefix="/opt" install +``` + +Or, to stage the installation (to `/usr`) under a 'build root': + +```bash + $ make DESTDIR="/tmp/stage" install ``` ----------------------------------------------------------------------------- diff --git a/man/man1/smaxValue.1.gz b/man/man1/smaxValue.1.gz new file mode 100644 index 0000000..d5147e2 Binary files /dev/null and b/man/man1/smaxValue.1.gz differ diff --git a/man/man1/smaxWrite.1.gz b/man/man1/smaxWrite.1.gz new file mode 100644 index 0000000..8632638 Binary files /dev/null and b/man/man1/smaxWrite.1.gz differ diff --git a/tools/smaxValue.c b/tools/smaxValue.c index fef075d..b7d3609 100644 --- a/tools/smaxValue.c +++ b/tools/smaxValue.c @@ -234,7 +234,7 @@ static void usage() { printf(" -t Print as , e.g. 'int8', 'float', 'string', 'raw'.\n"); printf(" -n Print as number of elements.\n"); printf(" -l List field names contained in structures.\n"); - printf(" -e Print errors/warning to stderr.\n"); + printf(" -e Print errors/warnings to stderr.\n"); printf(" -s Use a specific host as the SMA-X database server.\n\n"); printf(" This tool always returns a value (or the requested number of values),\n"); printf(" It defaults to zero(es) for any elements not in the SMA-X database.\n"); diff --git a/tools/smaxWrite.c b/tools/smaxWrite.c index 8fc9ebd..7a23239 100644 --- a/tools/smaxWrite.c +++ b/tools/smaxWrite.c @@ -20,8 +20,6 @@ static char *host = SMAX_DEFAULT_HOSTNAME; static char *delims = ",;"; static char *sType; -#define NOT_ENOUGH_TOKENS 2 - static void syntax() { printf("\n"); printf(" Syntax: smaxWrite -t [options] table:key value\n\n");