commit 1a747cb6c2765ee818506c886bad4ed36b2b9d51
parent 61af57e302efd90458e17fa9f0bfaf5b3828954f
Author: Giuseppe Lumia <g.lumia@outlook.com>
Date: Wed, 4 Nov 2020 09:08:43 +0100
Fix install in case of missing docs compilation
Install on systems without `scdoc` was broken because `make install` was
attempting to install missing files.
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -54,9 +54,8 @@ clean:
distclean: clean
@rm -rf "$(OUTDIR)"
-install: all
+install: all install_docs
mkdir -p $(BINDIR)
- mkdir -p $(MANDIR)/man1
install -Dm755 gmni $(BINDIR)/gmni
install -Dm755 gmnlm $(BINDIR)/gmnlm
install -Dm755 libgmni.a $(LIBDIR)/libgmni.a
@@ -64,8 +63,6 @@ install: all
install -Dm644 include/gmni/tofu.h $(INCLUDEDIR)/gmni/tofu.h
install -Dm644 include/gmni/url.h $(INCLUDEDIR)/gmni/url.h
install -Dm644 libgmni.pc $(LIBDIR)/pkgconfig/libgmni.pc
- install -Dm644 doc/gmni.1 $(MANDIR)/man1/gmni.1
- install -Dm644 doc/gmnlm.1 $(MANDIR)/man1/gmnlm.1
uninstall:
rm -f $(BINDIR)/gmni
diff --git a/config.sh b/config.sh
@@ -125,6 +125,10 @@ run_configure() {
then
echo yes
all="$all docs"
+ install_docs="
+ mkdir -p \$(MANDIR)/man1
+ install -Dm644 doc/gmni.1 \$(MANDIR)/man1/gmni.1
+ install -Dm644 doc/gmnlm.1 \$(MANDIR)/man1/gmnlm.1"
else
echo no
fi
@@ -148,6 +152,7 @@ run_configure() {
CFLAGS+=-DLIBDIR='"\$(LIBDIR)"'
all: ${all}
+ install_docs: ${install_docs}
EOF
for target in $(printf '%s\n' $all | tr '.' '_')