2003-03-06 03:40:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2003-03-06 03:42:02 +00:00
|
|
|
APPLECOMMANDER_FILES=$(cd com; find . -name "*.java" -print | sed 's#^\./#com/#')
|
2003-03-06 03:40:00 +00:00
|
|
|
|
2003-03-06 03:43:50 +00:00
|
|
|
echo "**********************************************"
|
|
|
|
echo "** COMPILING **"
|
|
|
|
echo "**********************************************"
|
|
|
|
echo
|
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:42:02 +00:00
|
|
|
gcj --classpath="swt.jar;AppleCommander.jar" -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:42:02 +00:00
|
|
|
gcj -mwindows --classpath="swt.jar;AppleCommander.jar" \
|
|
|
|
--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 "**********************************************"
|