git: caf940e083 - main - Add a "clean" target.

Ceri Davies <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by ceri:

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

commit caf940e083764a4e1ee6a3624b55f6fb00b0df91
Author:     Ceri Davies <[email protected]>
AuthorDate: 2021-06-29 08:57:30 +0000
Commit:     Ceri Davies <[email protected]>
CommitDate: 2021-06-29 09:01:08 +0000

    Add a "clean" target.
    
    Reviewed by:    ygy
    Differential Revision:  https://reviews.freebsd.org/D30925
---
 documentation/Makefile | 24 ++++++++++++++++++++----
 website/Makefile       | 10 +++++++++-
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index 9ce6a8b616..519f3edb65 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -6,6 +6,7 @@
 # Targets intended for use on the command line
 #
 # all (default)	-	generate the books TOC and compile all the documentation
+# clean		- 	removes generated files
 # run		-	serves the built documentation site for local browsing
 # pdf		-	build PDF versions of the articles and books.
 #
@@ -68,6 +69,9 @@ BOOK_LANGS:=	${BOOK_LANGS:N${a}}
 all: requirements starting-message generate-books-toc generate-pgpkeys-txt build
 run: requirements starting-message generate-books-toc generate-pgpkeys-txt run-local
 
+# clean does not call pdf-clean as that is a subset of hugo-clean
+clean: hugo-clean pgp-clean toc-clean
+
 requirements:
 .for dep in ${RUN_DEPENDS}
 .if !exists(${dep})
@@ -98,6 +102,19 @@ run-local: .PHONY
 build: .PHONY
 	${HUGO_CMD} ${HUGO_ARGS}
 
+toc-clean: .PHONY
+	rm -f $$(${PYTHON_CMD} ./tools/books-toc-parts-creator.py    -l ${BOOK_LANGS} -o)
+	rm -f $$(${PYTHON_CMD} ./tools/books-toc-creator.py          -l ${BOOK_LANGS} -o)
+	rm -f $$(${PYTHON_CMD} ./tools/books-toc-figures-creator.py  -l ${BOOK_LANGS} -o)
+	rm -f $$(${PYTHON_CMD} ./tools/books-toc-tables-creator.py   -l ${BOOK_LANGS} -o)
+	rm -f $$(${PYTHON_CMD} ./tools/books-toc-examples-creator.py -l ${BOOK_LANGS} -o)
+
+pgp-clean: .PHONY
+	rm -f static/pgpkeys/pgpkeys.txt
+
+hugo-clean: .PHONY
+	rm -rf resources public
+
 #
 # PDF targets
 # Use DOC_LANG to choose the language, e.g., make DOC_LANG="en fr" pdf-books
@@ -189,10 +206,9 @@ pdf-articles: pdf-articles-target
 
 pdf-clean: pdf-articles-clean pdf-books-clean
 
-pdf-books-clean: pdf-books-target
+pdf-books-clean: pdf-books-target toc-clean
 .for _curpdf in ${BOOKSDIR}
-	rm -f ${.CURDIR}/public${_curpdf:S|^${.CURDIR}/content||}book.pdf ${_curpdf}toc*.adoc
-	rm -fr ${.CURDIR}/public${_curpdf:S|^${.CURDIR}/content||}
+	rm -f ${.CURDIR}/public${_curpdf:S|^${.CURDIR}/content||}book.pdf
 .endfor
 .for _lang in ${LANGUAGES:S|,| |g}
 	rm -fr ${.CURDIR}/public/${_lang}/books
@@ -209,7 +225,6 @@ pdf-books-clean: pdf-books-target
 pdf-articles-clean: pdf-articles-target
 .for _curpdf in ${ARTICLESDIR}
 	rm -f ${.CURDIR}/public${_curpdf:S|^${.CURDIR}/content||}article.pdf
-	rm -fr ${.CURDIR}/public${_curpdf:S|^${.CURDIR}/content||}
 .endfor
 .for _lang in ${LANGUAGES:S|,| |g}
 	rm -fr ${.CURDIR}/public/${_lang}/articles
@@ -222,3 +237,4 @@ pdf-articles-clean: pdf-articles-target
 			rm -fr ${.CURDIR}/public; \
 		fi;	\
 	fi
+
diff --git a/website/Makefile b/website/Makefile
index dd650f501a..df9a71b985 100644
--- a/website/Makefile
+++ b/website/Makefile
@@ -41,6 +41,7 @@ RUBYLIB =	../shared/lib
 
 all: starting-message generate-releases build post-build end-message
 run: starting-message generate-releases run-local
+clean: hugo-clean releases-clean
 
 starting-message: .PHONY
 	@echo "---------------------------------------------------------------"
@@ -52,7 +53,9 @@ end-message: .PHONY
 	@echo "Building the website completed on $$(date)"
 	@echo "---------------------------------------------------------------"
 
-generate-releases: .PHONY
+generate-releases: data/releases.toml
+
+data/releases.toml:
 	${PYTHON_CMD} ./tools/releases-toml.py -p ./shared/releases.adoc
 
 run-local: .PHONY
@@ -66,3 +69,8 @@ post-build: cgi-permissions
 cgi-permissions:
 	@chmod 555 ./public/cgi/*.cgi
 
+hugo-clean:
+	rm -fr public resources
+
+releases-clean:
+	rm -f data/releases.toml
_______________________________________________
[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.