From b1fa730484f6630c8af06bf729ddea0841b389ac Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Tue, 30 May 2023 11:54:57 +0200 Subject: [PATCH 1/1] buildsys: improve build dir generation and cleanup follows commit 67f4cd3b44ddb0e8525d094188e56e41bc669cd4 in pve-docs for consistency Signed-off-by: Stoiko Ivanov Signed-off-by: Thomas Lamprecht --- Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 6402ab5..ccca188 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ include /usr/share/dpkg/pkg-info.mk DGDIR=. ASCIIDOC_PMG=./asciidoc-pmg +BUILDDIR ?= $(DEB_SOURCE)-$(DEB_VERSION) + GEN_PACKAGE=pmg-doc-generator DOC_PACKAGE=pmg-docs @@ -146,26 +148,31 @@ api-viewer/apidoc.js: $(API_VIEWER_FILES) cat $(API_VIEWER_FILES) >$@.tmp mv $@.tmp $@ +$(BUILDDIR): + rm -rf $@ $@.tmp + rsync -a * $@.tmp + echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE + mv $@.tmp $@ + .PHONY: dinstall dinstall: $(GEN_DEB) $(DOC_DEB) dpkg -i $(GEN_DEB) $(DOC_DEB) .PHONY: deb deb: $(DOC_DEB) + rm -f $(GEN_DEB) $(DOC_DEB) + rm -rf $(BUILDDIR) + $(MAKE) $(DOC_DEB) $(GEN_DEB): $(DOC_DEB) -$(DOC_DEB): - rm -f $(GEN_DEB) $(DOC_DEB) - rm -rf build - rsync -a * build/ - echo "git clone git://git.proxmox.com/git/pmg-docs.git\\ngit checkout $(GITVERSION)" > build/debian/SOURCE - cd build; dpkg-buildpackage -b -us -uc +$(DOC_DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc lintian $(DOC_DEB) $(GEN_DEB) .PHONY: clean-build clean-build: - rm -rf build + rm -rf $(BUILDDIR) .PHONY: install install: gen-install doc-install @@ -213,4 +220,4 @@ clean: rm -f api-viewer/apidoc.js chapter-*.html *-plain.html chapter-*.html pmg-admin-guide.chunked asciidoc-pmg link-refs.json .asciidoc-pmg-tmp_* pmg-smtp-filter.8-synopsis.adoc pmgpolicy.8-synopsis.adoc pmgsh.1-synopsis.adoc rm -rf .pmg-doc-depends rm -f pmg-doc-generator.mk chapter-index-table.adoc man1-index-table.adoc man5-index-table.adoc man8-index-table.adoc pmg-admin-guide-docinfo.xml pmg-copyright.adoc - rm -rf build* + rm -rf $(DEB_SOURCE)-[0-9]* -- 2.39.2