Subversion Repositories Projects

Rev

Rev 495 | Rev 514 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#!/bin/sh
#/****************************************************************************
# *   Copyright (C) 2009 by Claas Anders "CaScAdE" Rathje                    *
# *   admiralcascade@gmail.com                                               *
# *   Project-URL: http://www.mylifesucks.de/oss/c-osd/                      *
# *                                                                          *
# *   This program is free software; you can redistribute it and/or modify   *
# *   it under the terms of the GNU General Public License as published by   *
# *   the Free Software Foundation; either version 2 of the License.         *
# *                                                                          *
# *   This program is distributed in the hope that it will be useful,        *
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
# *   GNU General Public License for more details.                           *
# *                                                                          *
# *   You should have received a copy of the GNU General Public License      *
# *   along with this program; if not, write to the                          *
# *   Free Software Foundation, Inc.,                                        *
# *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.              *
# ****************************************************************************/

DATE=`date +%Y%m%d-%H%M`
#DATE="20090604-1330"
REVISION=`svn info .. | awk '$1 == "Revision:" {print $2}'`

#NCMODES=`find ../ -name osd_ncmode_\*.c| sed 's/..\///g'`
#FCMODES=`find ../ -name osd_fcmode_\*.c| sed 's/..\///g'`
#
# build all the NCMODE files
#for CURRMODE in $NCMODES; do
#       CURRSHORTMODE=`echo $CURRMODE | sed -e 's/osd_ncmode_//g' -e 's/.c//g'`
#      
#       # build pal hex
#       export CFLAGS="-DBUILDDATE=\\\"${DATE}\\\" -DOSD_NCMODE=\\\"${CURRMODE}\\\""
#       make clean
#       make
#       mv C-OSD.hex C-OSD-${DATE}-$CURRSHORTMODE-pal.hex
#
#       # build ntsc hex
#       export CFLAGS="-DNTSC=1 -DBUILDDATE=\\\"${DATE}\\\" -DOSD_NCMODE=\\\"${CURRMODE}\\\""
#       make clean
#       make
#       mv C-OSD.hex C-OSD-${DATE}-$CURRSHORTMODE-ntsc.hex
#done
#
# build all the FCMODE files
#for CURRMODE in $FCMODES; do
#       CURRSHORTMODE=`echo $CURRMODE | sed -e 's/osd_fcmode_//g' -e 's/.c//g'`
#
#       #build pal hex FCONLY
#       export CFLAGS="-DFCONLY=1 -DBUILDDATE=\\\"${DATE}\\\" -DOSD_FCMODE=\\\"${CURRMODE}\\\""
#       make clean
#       make
#       mv C-OSD.hex C-OSD-${DATE}-$CURRSHORTMODE-pal-fconly.hex
#
#       # build ntsc hex FCONLY
#       export CFLAGS="-DNTSC=1 -DFCONLY=1 -DBUILDDATE=\\\"${DATE}\\\" -DOSD_FCMODE=\\\"${CURRMODE}\\\""
#       make clean
#       make
#       mv C-OSD.hex C-OSD-${DATE}-$CURRSHORTMODE-ntsc-fconly.hex
#done

# build pal hex
export CFLAGS="-DBUILDDATE=\\\"${DATE}\\\" "
make clean
make
mv C-OSD.hex C-OSD-${DATE}-pal.hex

# build ntsc hex
export CFLAGS="-DNTSC=1 -DBUILDDATE=\\\"${DATE}\\\" "
make clean
make
mv C-OSD.hex C-OSD-${DATE}-ntsc.hex

#build pal hex FCONLY
export CFLAGS="-DFCONLY=1 -DBUILDDATE=\\\"${DATE}\\\" "
make clean
make
mv C-OSD.hex C-OSD-${DATE}-pal-fconly.hex

# build ntsc hex FCONLY
export CFLAGS="-DNTSC=1 -DFCONLY=1 -DBUILDDATE=\\\"${DATE}\\\" "
make clean
make
mv C-OSD.hex C-OSD-${DATE}-ntsc-fconly.hex


# buil all character files
CHARFILES="112 128 136 144 152 160 168 176 184 192 200 208 216 224 232"
for i in $CHARFILES; do
        make clean
        export CFLAGS="-DWRITECHARS=${i} -DBUILDDATE=\\\"${DATE}\\\" "
        make
        TILL=`echo $i + 7 | bc`
        mv C-OSD.hex C-OSD-characters-${i}-${TILL}.hex
done

# clean up
make clean

md5sum *.hex

# pack all stuff
mkdir C-OSD-${DATE}
mv *.hex C-OSD-${DATE}
cp ../CHANGE.LOG C-OSD-${DATE}
cp ../LICENSE.TXT C-OSD-${DATE}
cp ../README.TXT C-OSD-${DATE}
zip -r -9 -q C-OSD-${DATE}.zip C-OSD-${DATE}
rm -rf C-OSD-${DATE}

du -h C-OSD-${DATE}.zip
echo "building based on revision $REVISION is now DONE..."