2010-05-27 09:41:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
|
2016-09-23 20:51:28 +00:00
|
|
|
# Usage: genversion.sh destination-dir version
|
2010-05-27 09:41:46 +00:00
|
|
|
|
2014-08-28 00:47:46 +00:00
|
|
|
# Generate rbversion.h file
|
2010-05-27 09:41:46 +00:00
|
|
|
|
2010-05-28 04:07:57 +00:00
|
|
|
# XXX DO NOT TWEAK VERSION HERE, EDIT version.sh INSTEAD
|
2010-05-27 09:41:46 +00:00
|
|
|
|
2016-09-23 20:51:28 +00:00
|
|
|
VERSION="$2"
|
2010-05-28 04:07:57 +00:00
|
|
|
|
2014-08-28 00:47:46 +00:00
|
|
|
cat > "$1/_rbversion.h" << EOF
|
2010-05-27 09:41:46 +00:00
|
|
|
/* Generated by genversion.sh */
|
|
|
|
#define RBVERSION "$VERSION"
|
|
|
|
EOF
|
|
|
|
|
2016-09-23 20:51:28 +00:00
|
|
|
# Don't touch rbversion.h if it hasn't change, to avoid rebuilding stuff
|
2014-08-28 00:47:46 +00:00
|
|
|
if [ -f "$1/rbversion.h" ]
|
|
|
|
then if diff "$1/_rbversion.h" "$1/rbversion.h" > /dev/null
|
|
|
|
then rm -f "$1/_rbversion.h"
|
|
|
|
else mv "$1/_rbversion.h" "$1/rbversion.h"
|
2010-05-27 09:41:46 +00:00
|
|
|
fi
|
2014-08-28 00:47:46 +00:00
|
|
|
else mv "$1/_rbversion.h" "$1/rbversion.h"
|
2010-05-27 09:41:46 +00:00
|
|
|
fi
|