2003-03-06 03:40:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2003-03-27 05:34:13 +00:00
|
|
|
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/#')
|
2003-03-06 03:40:00 +00:00
|
|
|
|
2003-03-06 03:45:56 +00:00
|
|
|
OPTS="-static -O3 --no-bounds-checking -funroll-loops -finline-functions \
|
|
|
|
-fkeep-inline-functions -malign-double"
|
|
|
|
|
2003-03-06 03:43:50 +00:00
|
|
|
echo "**********************************************"
|
|
|
|
echo "** COMPILING **"
|
|
|
|
echo "**********************************************"
|
|
|
|
echo
|
2003-12-13 18:12:30 +00:00
|
|
|
|
|
|
|
# Need to load image-related stuff... (Should be done in SWT build)
|
|
|
|
#echo Compiling SWTImageLoaders.java ...
|
|
|
|
#gcj --classpath="swt.jar;AppleCommander.jar" $OPTS -g0 -c SWTImageLoaders.java
|
|
|
|
|
2003-03-06 03:40:00 +00:00
|
|
|
for i in $APPLECOMMANDER_FILES
|
|
|
|
do
|
2003-03-06 03:42:02 +00:00
|
|
|
OBJ_FILE=$(echo $i | sed 's/\//_/g' | sed 's/\.java$/\.o/')
|
2003-03-06 03:40:00 +00:00
|
|
|
echo Compiling $i to $OBJ_FILE
|
2003-03-06 03:45:56 +00:00
|
|
|
gcj --classpath="swt.jar;AppleCommander.jar" $OPTS -g0 -c -o $OBJ_FILE $i
|
2003-03-06 03:40:00 +00:00
|
|
|
done
|
|
|
|
|
2003-03-06 03:43:50 +00:00
|
|
|
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
|
2003-03-06 03:40:00 +00:00
|
|
|
|
2003-03-06 03:43:50 +00:00
|
|
|
echo "**********************************************"
|
|
|
|
echo "** BUILD EXE **"
|
|
|
|
echo "**********************************************"
|
|
|
|
echo
|
2003-03-06 03:45:56 +00:00
|
|
|
gcj -mwindows --classpath="swt.jar;AppleCommander.jar" $OPTS \
|
2003-03-06 03:42:02 +00:00
|
|
|
--main=com.webcodepro.applecommander.ui.AppleCommander \
|
|
|
|
-o AppleCommander *.o -L. -lswt
|
2003-03-06 03:40:00 +00:00
|
|
|
|
2003-03-06 03:43:50 +00:00
|
|
|
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 "**********************************************"
|