Browse files

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 <>
  • Loading branch information...
psychon committed May 7, 2013
1 parent 9b23ee6 commit ed478e6f7b384f32252e143476814dead3e3707c
Showing with 13 additions and 5 deletions.
  1. +6 −3 modules/modperl/
  2. +7 −2 modules/modpython/
@@ -23,9 +23,12 @@ PERLDEPONMOD :=
PERLHOOK := modperl_install
-CLEAN += modperl/ZNC.$(PERLCEXT_EXT) modperl/ 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/ modperl/swigperlrun.h modperl/ZNC.cpp modperl/functions.cpp
all: modperl_all
@@ -19,9 +19,14 @@ PYDEPONMOD :=
PYTHONHOOK := modpython_install
-CLEAN += modpython/_znc_core.$(PYCEXT_EXT) modpython/_znc_core.cpp modpython/ 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/
+CLEAN += modpython/swigpyrun.h modpython/functions.cpp
ifneq "$(srcdir)" "."
# Copied from source for out-of-tree builds
CLEAN += modpython/

0 comments on commit ed478e6

Please sign in to comment.