AppleCommander/build/build-applecommander-mingw
Robert Greene 4289dbc9dd Updated build script to ignore clases that break the build or do not
apply to the build. The JUnit tests along with ImageIoImage and
SunJpegImage are examples.
2003-03-27 05:34:13 +00:00

76 lines
2.7 KiB
Bash

#!/bin/sh
exec >$0.log 2>&1
APPLECOMMANDER_FILES=$(cd com; \
find . -name "*.java" -not -name "*Test.java" -not -name "ImageIoImage.java" \
-not -name "SunJpegImage.java" -print |
sed 's#^\./#com/#')
OPTS="-static -O3 --no-bounds-checking -funroll-loops -finline-functions \
-fkeep-inline-functions -malign-double"
echo "**********************************************"
echo "** COMPILING **"
echo "**********************************************"
echo
for i in $APPLECOMMANDER_FILES
do
OBJ_FILE=$(echo $i | sed 's/\//_/g' | sed 's/\.java$/\.o/')
echo Compiling $i to $OBJ_FILE
gcj --classpath="swt.jar;AppleCommander.jar" $OPTS -g0 -c -o $OBJ_FILE $i
done
echo "**********************************************"
echo "** RESOURCES **"
echo "**********************************************"
echo
for i in $(ls com/webcodepro/applecommander/ui/images/*.gif \
com/webcodepro/applecommander/storage/*.dump \
com/webcodepro/applecommander/storage/*.properties)
do
FILENAME=$(basename $i)
OBJ=$FILENAME.o
echo Compiling resource $i
gcj -c --resource=$i -o $OBJ $i
done
echo "**********************************************"
echo "** BUILD EXE **"
echo "**********************************************"
echo
gcj -mwindows --classpath="swt.jar;AppleCommander.jar" $OPTS \
--main=com.webcodepro.applecommander.ui.AppleCommander \
-o AppleCommander *.o -L. -lswt
echo "**********************************************"
echo "** CLEAN **"
echo "**********************************************"
echo
rm *.o
echo "**********************************************"
echo "** STRIPPING EXE **"
echo "**********************************************"
echo
strip -x AppleCommander.exe -o AppleCommander-strip.exe
# Only run UPX if it is on the command path:
UPX=$(type -p upx)
if [ "$UPX" ] && [ -x $UPX ]
then
echo "**********************************************"
echo "** PACKING EXE WITH UPX **"
echo "** (will need to choose the smallest exe..) **"
echo "**********************************************"
echo
upx --best --crp-ms=999999 --nrv2b -o AppleCommander-strip-nrv2b.exe AppleCommander-strip.exe
upx --best --crp-ms=999999 --nrv2d -o AppleCommander-strip-nrv2d.exe AppleCommander-strip.exe
upx --best --crp-ms=999999 -o AppleCommander-strip-upxbest.exe AppleCommander-strip.exe
upx -o AppleCommander-strip-upxdefault.exe AppleCommander-strip.exe
fi
echo "**********************************************"
echo "** DONE!! **"
echo "**********************************************"