From ed478e6f7b384f32252e143476814dead3e3707c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 7 May 2013 21:29:11 +0200 Subject: [PATCH] make clean: Only delete files that can be regenerated Previously, "make clean" would happily delete swig's output files even though configure did not find swig and thus these files could not be generated again. This half-fixes issue 276. It would be great if the Makefiles never delete files which are part of the tarball, but at least they now don't delete files which cannot be regenerated. Signed-off-by: Uli Schlachter --- modules/modperl/Makefile.inc | 9 ++++++--- modules/modpython/Makefile.inc | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/modperl/Makefile.inc b/modules/modperl/Makefile.inc index 7265c0c0..770c855b 100644 --- a/modules/modperl/Makefile.inc +++ b/modules/modperl/Makefile.inc @@ -23,9 +23,12 @@ PERLDEPONMOD := endif PERLHOOK := modperl_install -CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ZNC.pm modperl/ZNC.o -CLEAN += modperl/swigperlrun.h modperl/ZNC.cpp modperl/functions.cpp -CLEAN += modperl/gen +CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ZNC.o modperl/gen +ifneq "$(SWIG)" "" +# Only delete these files if we can regenerate them +CLEAN += modperl/ZNC.pm modperl/swigperlrun.h modperl/ZNC.cpp modperl/functions.cpp +endif + all: modperl_all else diff --git a/modules/modpython/Makefile.inc b/modules/modpython/Makefile.inc index 5911b2fb..a30c2dda 100644 --- a/modules/modpython/Makefile.inc +++ b/modules/modpython/Makefile.inc @@ -19,9 +19,14 @@ PYDEPONMOD := endif PYTHONHOOK := modpython_install -CLEAN += modpython/_znc_core.$(PYCEXT_EXT) modpython/_znc_core.cpp modpython/znc_core.py modpython/znc_core.pyc -CLEAN += modpython/swigpyrun.h modpython/znc.pyc modpython/functions.cpp modpython/compiler *.pyc +CLEAN += modpython/_znc_core.$(PYCEXT_EXT) modpython/znc_core.pyc +CLEAN += modpython/znc.pyc modpython/compiler *.pyc CLEAN += modpython/_znc_core.o modpython/compiler.o +ifneq "$(SWIG)" "" +# Only delete these files if we can regenerate them +CLEAN += modpython/_znc_core.cpp modpython/znc_core.py +CLEAN += modpython/swigpyrun.h modpython/functions.cpp +endif ifneq "$(srcdir)" "." # Copied from source for out-of-tree builds CLEAN += modpython/znc.py