summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2015-09-13 22:57:00 +0200
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2015-09-13 22:57:00 +0200
commit05860653b0e37abbc144f43b48dc86b9ab71f156 (patch)
tree7c281e38abd02519d15373eef82fa1a4b3887ec0
parent16ab153f3a54194e3217fcf1a235904e4b61623b (diff)
Move man pages for section 1 to man1/ directory.
As a bonus you can install out-of-tree now via make -f. Fixes #22.
-rw-r--r--Makefile19
-rw-r--r--man1/metastore.1 (renamed from metastore.1)0
2 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 96acb88..7442935 100644
--- a/Makefile
+++ b/Makefile
@@ -22,16 +22,18 @@ CFLAGS += -g -Wall -pedantic -std=c99 -D_FILE_OFFSET_BITS=64 -O2
LDFLAGS +=
LIBS += -lbsd
INCLUDES =
-INSTALL = install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
+INSTALL = install
+INSTALL_PROGRAM = ${INSTALL} -c
+INSTALL_DATA = ${INSTALL} -c -m 644
COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS)
OBJECTS = utils.o metastore.o metaentry.o
HEADERS = utils.h metastore.h metaentry.h
+MANPAGES = man1/metastore.1
PROJ_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SRCS_DIR := $(PROJ_DIR)src/
+MANS_DIR := $(PROJ_DIR)
DESTDIR ?=
prefix = /usr
@@ -40,6 +42,7 @@ mandir = ${prefix}/share/man
vpath %.c $(SRCS_DIR)
vpath %.h $(SRCS_DIR)
+vpath %.1 $(MANS_DIR)
#
# Targets
@@ -57,13 +60,15 @@ metastore: $(OBJECTS)
$(LINK) -o $@ $^ $(LIBS)
-install: all
- $(INSTALL_DATA) -D metastore.1 $(DESTDIR)$(mandir)/man1/metastore.1
- $(INSTALL_PROGRAM) -D metastore $(DESTDIR)$(usrbindir)/metastore
+install: all $(MANPAGES)
+ $(INSTALL) -d $(DESTDIR)$(mandir)/man1/
+ $(INSTALL_DATA) $(filter %.1,$^) $(DESTDIR)$(mandir)/man1/
+ $(INSTALL) -d $(DESTDIR)$(usrbindir)/
+ $(INSTALL_PROGRAM) metastore $(DESTDIR)$(usrbindir)/
uninstall:
- - rm -f $(DESTDIR)$(mandir)/man1/metastore.1
+ - rm -f $(addprefix $(DESTDIR)$(mandir)/,$(MANPAGES))
- rm -f $(DESTDIR)$(usrbindir)/metastore
diff --git a/metastore.1 b/man1/metastore.1
index 950360c..950360c 100644
--- a/metastore.1
+++ b/man1/metastore.1