From: Kevin P. Fleming Date: Wed, 18 Nov 2020 15:05:39 +0000 (-0500) Subject: Avoid accidental removal of generated files X-Git-Tag: rec-4.5.0-alpha1~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88fb80c77d6f67c3a0636a933ead6272a8dbbd83;p=thirdparty%2Fpdns.git Avoid accidental removal of generated files 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. --- diff --git a/docs/Makefile.am b/docs/Makefile.am index 3a2954be5f..be09254451 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -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 diff --git a/pdns/Makefile.am b/pdns/Makefile.am index b9cb532560..f90a62a53a 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -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)