CONFIGURE: Avoid needless overwrite of header and mk files
They trigger extensive rebuild of source files without a reason every time the configure script changes, even if the result is exactly the same.
This commit is contained in:
parent
eae8a30c09
commit
b813d1ca0d
3 changed files with 35 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -15,6 +15,7 @@ lib*.a
|
||||||
/ScummVMDockTilePlugin*
|
/ScummVMDockTilePlugin*
|
||||||
/config.h
|
/config.h
|
||||||
/config.mk
|
/config.mk
|
||||||
|
/configure.stamp
|
||||||
/.gdb_history
|
/.gdb_history
|
||||||
/dumps
|
/dumps
|
||||||
/Credits.rtf
|
/Credits.rtf
|
||||||
|
|
12
Makefile
12
Makefile
|
@ -100,7 +100,7 @@ ifneq ($(SAVED_PKG_CONFIG_LIBDIR),unset)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# check if configure has been run or has been changed since last run
|
# check if configure has been run or has been changed since last run
|
||||||
config.h: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE)
|
configure.stamp: $(srcdir)/configure $(ENGINE_SUBDIRS_CONFIGURE)
|
||||||
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
|
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
|
||||||
@echo "Running $(srcdir)/configure with the last specified parameters"
|
@echo "Running $(srcdir)/configure with the last specified parameters"
|
||||||
@sleep 2
|
@sleep 2
|
||||||
|
@ -111,12 +111,10 @@ else
|
||||||
$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
|
$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
config.mk engines/plugins_table.h engines/engines.mk: config.h
|
config.h config.mk engines/plugins_table.h engines/detection_table.h engines/engines.mk: configure.stamp
|
||||||
@if test -f $@; then \
|
@if ! test -f $@; then \
|
||||||
touch $@; \
|
rm -f configure.stamp; \
|
||||||
else \
|
$(MAKE) configure.stamp; \
|
||||||
rm -f config.h; \
|
|
||||||
$(MAKE) config.h; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ifneq ($(origin port_mk), undefined)
|
ifneq ($(origin port_mk), undefined)
|
||||||
|
|
40
configure
vendored
40
configure
vendored
|
@ -941,6 +941,15 @@ get_subengines_build_string() {
|
||||||
echo "$subengine_string"
|
echo "$subengine_string"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Copy first argument to second one if they are different. Otherwise, delete the first one.
|
||||||
|
copy_if_changed() {
|
||||||
|
if cmp -s $1 $2; then
|
||||||
|
rm -f $1
|
||||||
|
else
|
||||||
|
mv -f $1 $2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check any parameters we received
|
# Check any parameters we received
|
||||||
#
|
#
|
||||||
|
@ -6273,7 +6282,7 @@ fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Creating config.h"
|
echo "Creating config.h"
|
||||||
cat > config.h << EOF
|
cat > config.h.new << EOF
|
||||||
/* This file is automatically generated by configure */
|
/* This file is automatically generated by configure */
|
||||||
/* DO NOT EDIT MANUALLY */
|
/* DO NOT EDIT MANUALLY */
|
||||||
|
|
||||||
|
@ -6306,9 +6315,11 @@ typedef $type_ptr uintptr;
|
||||||
|
|
||||||
#endif /* CONFIG_H */
|
#endif /* CONFIG_H */
|
||||||
EOF
|
EOF
|
||||||
|
copy_if_changed config.h.new config.h
|
||||||
|
|
||||||
|
|
||||||
echo "Creating config.mk"
|
echo "Creating config.mk"
|
||||||
cat > config.mk << EOF
|
cat > config.mk.new << EOF
|
||||||
# -------- Generated by configure -----------
|
# -------- Generated by configure -----------
|
||||||
|
|
||||||
SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
|
SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
|
||||||
|
@ -6384,6 +6395,7 @@ $_mak_plugins
|
||||||
|
|
||||||
port_mk = $_port_mk
|
port_mk = $_port_mk
|
||||||
EOF
|
EOF
|
||||||
|
copy_if_changed config.mk.new config.mk
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a custom Makefile when building outside the source tree
|
# Create a custom Makefile when building outside the source tree
|
||||||
|
@ -6392,7 +6404,7 @@ EOF
|
||||||
if test ! -f Makefile.common ; then
|
if test ! -f Makefile.common ; then
|
||||||
echo "Creating Makefile"
|
echo "Creating Makefile"
|
||||||
|
|
||||||
cat > Makefile << EOF
|
cat > Makefile.new << EOF
|
||||||
# -------- Generated by configure -----------
|
# -------- Generated by configure -----------
|
||||||
srcdir = $_srcdir
|
srcdir = $_srcdir
|
||||||
vpath %.h \$(srcdir)
|
vpath %.h \$(srcdir)
|
||||||
|
@ -6407,6 +6419,7 @@ vpath %.rc \$(srcdir)
|
||||||
vpath %.md \$(srcdir)
|
vpath %.md \$(srcdir)
|
||||||
include \$(srcdir)/Makefile
|
include \$(srcdir)/Makefile
|
||||||
EOF
|
EOF
|
||||||
|
copy_if_changed Makefile.new Makefile
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6415,7 +6428,7 @@ fi
|
||||||
mkdir -p engines
|
mkdir -p engines
|
||||||
|
|
||||||
echo "Creating engines/engines.mk"
|
echo "Creating engines/engines.mk"
|
||||||
cat > engines/engines.mk << EOF
|
cat > engines/engines.mk.new << EOF
|
||||||
# This file is automatically generated by configure
|
# This file is automatically generated by configure
|
||||||
# DO NOT EDIT MANUALLY
|
# DO NOT EDIT MANUALLY
|
||||||
# This file is being included by "Makefile.common"
|
# This file is being included by "Makefile.common"
|
||||||
|
@ -6425,7 +6438,7 @@ for engine in $_sorted_engines; do
|
||||||
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
||||||
if test "`get_engine_sub $engine`" = "no" ; then
|
if test "`get_engine_sub $engine`" = "no" ; then
|
||||||
# main engine
|
# main engine
|
||||||
cat >> engines/engines.mk << EOF
|
cat >> engines/engines.mk.new << EOF
|
||||||
|
|
||||||
ifdef ENABLE_$j
|
ifdef ENABLE_$j
|
||||||
DEFINES += -DENABLE_$j=\$(ENABLE_$j)
|
DEFINES += -DENABLE_$j=\$(ENABLE_$j)
|
||||||
|
@ -6434,7 +6447,7 @@ EOF
|
||||||
|
|
||||||
for subeng in `get_engine_subengines $engine` ; do
|
for subeng in `get_engine_subengines $engine` ; do
|
||||||
k=`echo $subeng | tr '[:lower:]' '[:upper:]'`
|
k=`echo $subeng | tr '[:lower:]' '[:upper:]'`
|
||||||
cat >> engines/engines.mk << EOF
|
cat >> engines/engines.mk.new << EOF
|
||||||
|
|
||||||
ifdef ENABLE_$k
|
ifdef ENABLE_$k
|
||||||
DEFINES += -DENABLE_$k
|
DEFINES += -DENABLE_$k
|
||||||
|
@ -6442,17 +6455,18 @@ endif
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
|
|
||||||
cat >> engines/engines.mk << EOF
|
cat >> engines/engines.mk.new << EOF
|
||||||
endif
|
endif
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
copy_if_changed engines/engines.mk.new engines/engines.mk
|
||||||
|
|
||||||
# Name which is suffixed to each detection plugin
|
# Name which is suffixed to each detection plugin
|
||||||
detectId="_DETECTION"
|
detectId="_DETECTION"
|
||||||
|
|
||||||
echo "Creating engines/detection_table.h"
|
echo "Creating engines/detection_table.h"
|
||||||
cat > engines/detection_table.h << EOF
|
cat > engines/detection_table.h.new << EOF
|
||||||
/* This file is automatically generated by configure */
|
/* This file is automatically generated by configure */
|
||||||
/* DO NOT EDIT MANUALLY */
|
/* DO NOT EDIT MANUALLY */
|
||||||
// This file is being included by "base/plugins.cpp"
|
// This file is being included by "base/plugins.cpp"
|
||||||
|
@ -6462,17 +6476,18 @@ for engine in $_sorted_engines; do
|
||||||
if test "`get_engine_sub $engine`" = "no" ; then
|
if test "`get_engine_sub $engine`" = "no" ; then
|
||||||
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
||||||
detectEngine="${j}${detectId}"
|
detectEngine="${j}${detectId}"
|
||||||
cat >> engines/detection_table.h << EOF
|
cat >> engines/detection_table.h.new << EOF
|
||||||
#if defined(ENABLE_$j) || defined(DETECTION_FULL)
|
#if defined(ENABLE_$j) || defined(DETECTION_FULL)
|
||||||
LINK_PLUGIN($detectEngine)
|
LINK_PLUGIN($detectEngine)
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
copy_if_changed engines/detection_table.h.new engines/detection_table.h
|
||||||
|
|
||||||
|
|
||||||
echo "Creating engines/plugins_table.h"
|
echo "Creating engines/plugins_table.h"
|
||||||
cat > engines/plugins_table.h << EOF
|
cat > engines/plugins_table.h.new << EOF
|
||||||
/* This file is automatically generated by configure */
|
/* This file is automatically generated by configure */
|
||||||
/* DO NOT EDIT MANUALLY */
|
/* DO NOT EDIT MANUALLY */
|
||||||
// This file is being included by "base/plugins.cpp"
|
// This file is being included by "base/plugins.cpp"
|
||||||
|
@ -6481,10 +6496,13 @@ EOF
|
||||||
for engine in $_sorted_engines; do
|
for engine in $_sorted_engines; do
|
||||||
if test "`get_engine_sub $engine`" = "no" ; then
|
if test "`get_engine_sub $engine`" = "no" ; then
|
||||||
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
j=`echo $engine | tr '[:lower:]' '[:upper:]'`
|
||||||
cat >> engines/plugins_table.h << EOF
|
cat >> engines/plugins_table.h.new << EOF
|
||||||
#if PLUGIN_ENABLED_STATIC($j)
|
#if PLUGIN_ENABLED_STATIC($j)
|
||||||
LINK_PLUGIN($j)
|
LINK_PLUGIN($j)
|
||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
copy_if_changed engines/plugins_table.h.new engines/plugins_table.h
|
||||||
|
|
||||||
|
touch configure.stamp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue