]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid accidental removal of generated files 9748/head
authorKevin P. Fleming <kevin@km6g.us>
Wed, 18 Nov 2020 15:05:39 +0000 (10:05 -0500)
committerKevin P. Fleming <kevin@km6g.us>
Wed, 18 Nov 2020 15:05:39 +0000 (10:05 -0500)
When generated files (man pages, api-swagger files, etc.) are
in the tree because they were part of a source distribution
but were not locally generated, 'make clean' should not remove
them. Doing so results in a broken tree, as the Makefiles
expect the files to be present, and running 'configure' again
will introduce the additional dependencies required to
generate them.

docs/Makefile.am
pdns/Makefile.am

index 3a2954be5f69711bc868aaaa19d18fa5f253cc9e..be09254451f49334f0653e34a2138166f0251613 100644 (file)
@@ -87,7 +87,11 @@ mans/.complete: .venv
        html-docs.tar.bz2
 
 clean-local:
+if !HAVE_MANPAGES
+# don't clean these files if they were present
+# at 'configure' time (e.g. from a source dist)
        rm -f latex/PowerDNS-Authoritative.pdf $(MANPAGES_DIST) html-docs.tar.bz2
+endif
        rm -rf mans
 
 html-docs: common/** manpages/** .venv *.rst
index b9cb532560878583cfda6ef16e3a123f481bf7c5..f90a62a53ab7a2494fd737a10e2c14a7618bfc9a 100644 (file)
@@ -72,9 +72,15 @@ CLEANFILES = \
        backends/gsql/gsqlbackend.gcov \
        dnsmessage.pb.cc dnsmessage.pb.h \
        pdns.conf-dist \
-       apidocfiles.h \
+       apidocfiles.h
+
+if !HAVE_API_SWAGGER_JSON
+# don't clean these files if they were present
+# at 'configure' time (e.g. from a source dist)
+CLEANFILES += \
        api-swagger.yaml \
        api-swagger.json
+endif
 
 # use a $(wildcard) wrapper here to allow build to proceed if output
 # file is present but input file is not (e.g. in a dist tarball)