git: e7edca45ba - main - documentation/Makefile: add requirements target

Sofian Brabez <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by sbz (ports committer):

URL: https://cgit.FreeBSD.org/doc/commit/?id=e7edca45ba9fd90eee1fce4eaa596fb5e89e9c95

commit e7edca45ba9fd90eee1fce4eaa596fb5e89e9c95
Author:     Sofian Brabez <[email protected]>
AuthorDate: 2021-05-07 14:02:37 +0000
Commit:     Sofian Brabez <[email protected]>
CommitDate: 2021-05-13 14:36:35 +0000

    documentation/Makefile: add requirements target
    
    Add the requirements target in order to prompt the user to install the
    needed dependencies to be able to run `make run` successfully.
    
    Reviewed by:    ygy, debdrup, imp
    Approved by:    ygy (doc)
    Differential Revision:  https://reviews.freebsd.org/D30161
---
 documentation/Makefile | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index 840e306fd4..b9fa304050 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -15,12 +15,19 @@
 
 [email protected]
 
-PYTHON_CMD =	/usr/local/bin/python3
-HUGO_CMD =	/usr/local/bin/hugo
+LOCALBASE?=	/usr/local
+
+PYTHON_CMD =	${LOCALBASE}/bin/python3
+HUGO_CMD =	${LOCALBASE}/bin/hugo
 LANGUAGES =	en,es,pt-br,de,ja,zh-cn,zh-tw,ru,el,hu,it,mn,nl,pl,fr
 RUBYLIB =	../shared/lib
 .export	RUBYLIB
 
+RUN_DEPENDS=	${PYTHON_CMD} \
+		${HUGO_CMD} \
+		${LOCALBASE}/bin/asciidoctor \
+		${LOCALBASE}/bin/rougify
+
 .ifndef HOSTNAME
 .HOST+=localhost
 .else
@@ -29,12 +36,20 @@ RUBYLIB =	../shared/lib
 
 .ORDER: all run
 
+.ORDER: requirements
 .ORDER: starting-message generate-books-toc
 .ORDER: starting-message build
 .ORDER: generate-books-toc build
 
-all: starting-message generate-books-toc build
-run: starting-message generate-books-toc run-local
+all: requirements starting-message generate-books-toc build
+run: requirements starting-message generate-books-toc run-local
+
+requirements:
+.for dep in ${RUN_DEPENDS}
+.if !exists(${dep})
+	@(echo ${dep} not found, please run 'pkg install docproj'; exit 1)
+.endif
+.endfor
 
 starting-message: .PHONY
 	@echo ---------------------------------------------------------------
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.