Makefile: Rerun the configure script if it has been modified
[fio.git] / Makefile
index 19ba40a078703d58e77ab8f877b30fb86b6af384..d73b944fa20f35efc252ca4216c66ea3cae8608b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,19 +4,18 @@ endif
 
 VPATH := $(SRCDIR)
 
-ifneq ($(wildcard config-host.mak),)
-all:
-include config-host.mak
-config-host-mak: configure
-       @echo $@ is out-of-date, running configure
-       @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
-else
-config-host.mak:
+all: fio
+
+config-host.mak: configure
+       @if [ ! -e "$@" ]; then                                 \
+         echo "Running configure ...";                         \
+         ./configure;                                          \
+       else                                                    \
+         echo "$@ is out-of-date, running configure";          \
+         sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh;   \
+       fi
+
 ifneq ($(MAKECMDGOALS),clean)
-       @echo "Running configure for you..."
-       @./configure
-endif
-all:
 include config-host.mak
 endif