Implement a config.h to move defines off the compile line and reduce builds
This commit is contained in:
24
site_ansto/make_config.sh
Executable file
24
site_ansto/make_config.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Write a new config.h, but only if changed
|
||||
#
|
||||
rm -f config_new.h
|
||||
SICS_SITE=$(bash extract_version.sh SITE)
|
||||
SICS_VERSION=$(bash extract_version.sh VERSION)
|
||||
SICS_REVISION=$(bash extract_version.sh REVISION)
|
||||
echo "#define SICS_SITE \"$SICS_SITE\"" >> config_new.h
|
||||
echo "#define SICS_VERSION \"$SICS_VERSION\"" >> config_new.h
|
||||
echo "#define SICS_REVISION \"$SICS_REVISION\"" >> config_new.h
|
||||
if [[ -f /usr/include/valgrind/memcheck.h ]]
|
||||
then
|
||||
echo "#define SICS_VALGRIND" >> config_new.h
|
||||
fi
|
||||
delta=$(diff -q config.h config_new.h 2>> /dev/null)
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
echo "config not changed"
|
||||
rm -f config_new.h
|
||||
else
|
||||
echo "config updated"
|
||||
mv -f --backup config_new.h config.h
|
||||
fi
|
||||
Reference in New Issue
Block a user