mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Update astyle to 2.05.1, add astyle Linux binaries
Unfortunately, different versions of astyle produce slighty different formatting, so it's important that everyone uses the same version. Thus it makes sense to provide astyle binaries for Win32 and Linux x86 and x86_64 (to prevent usage of outdated versions from package managers etc) Most probably it would be easy to add an OSX astyle binary as well and call that from astyle-code.sh if applicable. I don't have a Mac, though, so someone else will have to do it ;-)
This commit is contained in:
parent
4c596dcf0d
commit
5f5684386e
4 changed files with 35 additions and 4 deletions
|
@ -1,8 +1,39 @@
|
|||
#!/bin/sh
|
||||
|
||||
# TODO make sure that the astyle version is >= 2.03 or quit
|
||||
# keep the following in sync with our supplied astyle binaries!
|
||||
OUR_ASTYLE_VERSION="2.05.1"
|
||||
|
||||
astyle -v --formatted --options=astyle-options.ini --exclude="libs" --recursive *.h
|
||||
astyle -v --formatted --options=astyle-options.ini --exclude="libs" --exclude="d3xp/gamesys/SysCvar.cpp" --exclude="d3xp/gamesys/Callbacks.cpp" --exclude="sys/win32/win_cpu.cpp" --exclude="sys/win32/win_main.cpp" --recursive *.cpp
|
||||
print_usage () {
|
||||
echo "By default, this script only works on Linux i686 or amd64 (with our supplied astyle binaries)"
|
||||
echo "You can use your own astyle binary by setting the ASTYLE_BIN environment variable before calling this script"
|
||||
echo " e.g.: ASTYLE_BIN=/usr/bin/astyle $0"
|
||||
echo "But please make sure it's version $OUR_ASTYLE_VERSION because other versions may format differently!"
|
||||
}
|
||||
|
||||
#pause
|
||||
if [ -z "$ASTYLE_BIN" ]; then
|
||||
|
||||
if [ `uname -s` != "Linux" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "`uname -m`" in
|
||||
i?86 | x86 ) ASTYLE_SUFFIX="x86" ;;
|
||||
amd64 | x86_64 ) ASTYLE_SUFFIX="x86_64" ;;
|
||||
* ) print_usage ; exit 1 ;;
|
||||
esac
|
||||
|
||||
ASTYLE_BIN="./astyle.$ASTYLE_SUFFIX"
|
||||
fi
|
||||
|
||||
ASTYLE_VERSION=$($ASTYLE_BIN --version | grep -o -e "[[:digit:]\.]*")
|
||||
|
||||
if [ "$ASTYLE_VERSION" != "$OUR_ASTYLE_VERSION" ]; then
|
||||
echo "ERROR: $ASTYLE_BIN has version $ASTYLE_VERSION, but we want $OUR_ASTYLE_VERSION"
|
||||
echo " (Unfortunately, different versions of astyle produce slightly different formatting.)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$ASTYLE_BIN -v --formatted --options=astyle-options.ini --exclude="libs" --recursive "*.h"
|
||||
$ASTYLE_BIN -v --formatted --options=astyle-options.ini --exclude="libs" --exclude="d3xp/gamesys/SysCvar.cpp" --exclude="d3xp/gamesys/Callbacks.cpp" \
|
||||
--exclude="sys/win32/win_cpu.cpp" --exclude="sys/win32/win_main.cpp" --recursive "*.cpp"
|
||||
|
|
BIN
neo/astyle.exe
BIN
neo/astyle.exe
Binary file not shown.
BIN
neo/astyle.x86
Executable file
BIN
neo/astyle.x86
Executable file
Binary file not shown.
BIN
neo/astyle.x86_64
Executable file
BIN
neo/astyle.x86_64
Executable file
Binary file not shown.
Loading…
Reference in a new issue