Permalink
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 <psychon@znc.in>
  • 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/Makefile.inc
  2. +7 −2 modules/modpython/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
@@ -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

0 comments on commit ed478e6

Please sign in to comment.