| #! /bin/sh |
| # |
| # Script to build binary |
| # |
| # Usage: |
| # sh build |
| # or |
| # ./build |
| |
| VER=`cat grub4dos_version` |
| DATE=`date -u +%Y-%m-%d` |
| ZIP_FILE=grub4dos-${VER}-${DATE}.zip |
| ZIP_FILE_CHS=grub4dos-${VER}-chs-${DATE}.zip |
| COPY_FILES="COPYING README_GRUB4DOS.txt ChangeLog_GRUB4DOS.txt \ |
| stage2/grldr stage2/grub.exe stage2/grldr.mbr stage2/bootlace.com \ |
| stage2/hmload.com" |
| |
| rm -rf *.zip *~ grub4dos-temp |
| |
| if [ -d .svn ]; then |
| svn export . grub4dos-temp |
| else |
| mkdir grub4dos-temp |
| cp -a * grub4dos-temp |
| fi |
| |
| cd grub4dos-temp |
| |
| # Build english version |
| ./configure --enable-preset-menu=preset_menu.lst || exit $? |
| make || exit $? |
| mkdir grub4dos-${VER} || exit $? |
| cp $COPY_FILES grub4dos-${VER} |
| rm -f ../$ZIP_FILE |
| zip -r -q ../$ZIP_FILE grub4dos-${VER} |
| |
| # Build chinese version |
| patch -p1 < patch-chinese.diff || exit $? |
| make || exit $? |
| mkdir grub4dos-${VER}-chs || exit $? |
| cp $COPY_FILES grub4dos-${VER}-chs |
| rm -f ../$ZIP_FILE_CHS |
| zip -r -q ../$ZIP_FILE_CHS grub4dos-${VER}-chs |
| cd .. |
| # Do not remove grub4dos-temp so that we can check and re-use it later. |