From fb70153ea07ace43c46f1937f700e35b1de97a20 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Thu, 7 Apr 2016 18:25:48 +0200
Subject: [PATCH] ./configure is not anymore run when using make clean

---
 Makefile                  | 4 +++-
 developer-doc/Makefile    | 4 +++-
 src/config/Makefile       | 4 +++-
 src/imd/Makefile          | 5 ++++-
 src/lib/Makefile          | 4 +++-
 src/maketools/make.module | 4 +++-
 src/wrapper/Makefile      | 4 +++-
 test/Makefile             | 5 ++++-
 user-doc/Makefile         | 4 +++-
 9 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 7bb9aaf82..4c88c890b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
--include Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+ -include Makefile.conf
+endif
 
 
 SRCDIRS := src test
diff --git a/developer-doc/Makefile b/developer-doc/Makefile
index da31eaa8b..f83e0c889 100644
--- a/developer-doc/Makefile
+++ b/developer-doc/Makefile
@@ -1,5 +1,7 @@
 # include the machine dependent configuration
--include ../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../Makefile.conf
+endif
 
 .PHONY: all clean
 
diff --git a/src/config/Makefile b/src/config/Makefile
index 5fb978fe0..bdcddde93 100644
--- a/src/config/Makefile
+++ b/src/config/Makefile
@@ -1,6 +1,8 @@
 
 # include the machine dependent configuration
--include ../../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../../Makefile.conf
+endif
 
 # sed script to edit program name defaults to do nothing
 ifndef program_transform_name
diff --git a/src/imd/Makefile b/src/imd/Makefile
index 5968953fc..08656a8db 100644
--- a/src/imd/Makefile
+++ b/src/imd/Makefile
@@ -1,4 +1,7 @@
--include ../../Makefile.conf
+# include the machine dependent configuration
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../../Makefile.conf
+endif
 
 all: libimd.$(SOEXT)
 
diff --git a/src/lib/Makefile b/src/lib/Makefile
index 5dff9d088..89558a52b 100644
--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -8,7 +8,9 @@ DIRS := $(sort ../config ../wrapper ../main  $(KERNEL_MODULES))
 DIRSLINKS:=$(addsuffix .links,$(DIRS))
 
 # include the machine dependent configuration
--include ../../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../../Makefile.conf
+endif
 
 # if machine dependent configuration has been found:
 ifdef GCCDEP
diff --git a/src/maketools/make.module b/src/maketools/make.module
index bd77c32a3..31771e44c 100644
--- a/src/maketools/make.module
+++ b/src/maketools/make.module
@@ -5,7 +5,9 @@
 # 
 
 # include the machine dependent configuration
--include ../../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../../Makefile.conf
+endif
 
 # if machine dependent configuration has been found:
 ifdef GCCDEP
diff --git a/src/wrapper/Makefile b/src/wrapper/Makefile
index 9066d3635..ce03b0b4d 100644
--- a/src/wrapper/Makefile
+++ b/src/wrapper/Makefile
@@ -1,6 +1,8 @@
 
 # include the machine dependent configuration
--include ../../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../../Makefile.conf
+endif
 
 # openmp flags should not be used here
 ifdef CXXFLAGS_NOOPENMP
diff --git a/test/Makefile b/test/Makefile
index 5f83c1126..92d524ce2 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,7 @@
--include ../Makefile.conf
+# include the machine dependent configuration
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../Makefile.conf
+endif
 
 SUBDIRS = link
 
diff --git a/user-doc/Makefile b/user-doc/Makefile
index 604feb262..dfb3524d4 100644
--- a/user-doc/Makefile
+++ b/user-doc/Makefile
@@ -1,5 +1,7 @@
 # include the machine dependent configuration
--include ../Makefile.conf
+ifneq ($(MAKECMDGOALS),clean)
+  -include ../Makefile.conf
+endif
 
 .PHONY: all clean
 
-- 
GitLab