From ff8794c5bc0805cc430229728befde16da47b68c Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Thu, 9 May 2024 20:25:51 +0200
Subject: [PATCH] Make 'docs' target not depend on 'install.tools' if GOMD2MAN
 is set

If the GOMD2MAN (environment) variable is set, then we do not need the
'docs' target to depend on 'install.tools', which will build
gomd2man.

This avoids gomd2man to be build, even though the user already request
the usage of a particular gomd2man binary. It also removes an implicit
build dependency on go. The latter causes downstream bugs like
https://bugs.gentoo.org/931645

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 40df8e3d..6a12bcf2 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,10 @@ vendor:
 	GO111MODULE=on $(GO) mod verify
 
 .PHONY: docs
+ifeq ($(GOMD2MAN),)
 docs: install.tools
+endif
+docs:
 	$(MAKE) -C docs
 
 .PHONY: clean
