From 5ef9a886b1f54ca84ff8f1c5a86c8309f8939aab Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Thu, 6 Mar 2003 03:43:50 +0000 Subject: [PATCH] Added structure to MinGW/Win32 compile. --- build/build-applecommander-mingw | 74 ++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/build/build-applecommander-mingw b/build/build-applecommander-mingw index 3fc16a5..97c754f 100644 --- a/build/build-applecommander-mingw +++ b/build/build-applecommander-mingw @@ -1,20 +1,11 @@ #!/bin/sh -#SWT_CLASSES=$(cd org; find . -name "*.class" -print | sed 's#^\./#org/#') - -#for i in $SWT_CLASSES -#do -# OBJ_FILE=$(echo $i | sed 's/\//_/g' | sed 's/\.class$/\.o/') -# echo Compiling $i to $OBJ_FILE -# gcj -fjni -g0 -c -o $OBJ_FILE $i -#done - -#gcj -c --resource=org.eclipse.swt.internal.SWTMessages \ -# -o SWTMessages.o org/eclipse/swt/internal/SWTMessages.properties - - APPLECOMMANDER_FILES=$(cd com; find . -name "*.java" -print | sed 's#^\./#com/#') +echo "**********************************************" +echo "** COMPILING **" +echo "**********************************************" +echo for i in $APPLECOMMANDER_FILES do OBJ_FILE=$(echo $i | sed 's/\//_/g' | sed 's/\.java$/\.o/') @@ -22,18 +13,55 @@ do gcj --classpath="swt.jar;AppleCommander.jar" -g0 -c -o $OBJ_FILE $i done -gcj -c --resource=com.webcodepro.applecommander.storage.FormattedDisk \ - -o FormattedDisk.o com/webcodepro/applecommander/storage/AppleCommander-boot.dump -gcj -c --resource=com.webcodepro.applecommander.storage.ProdosFileEntry \ - -o ProdosFileEntry.o com/webcodepro/applecommander/storage/ProdosFileTypes.properties -gcj -c --resource=com.webcodepro.applecommander.ui.swt.ImageManager \ - -o ImageManager.o com/webcodepro/applecommander/ui/images/*.gif +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 -#gcj -mwindows --classpath="swt.jar;AppleCommander.jar" \ -# --main=com.webcodepro.applecommander.ui.swt.SwtAppleCommander \ -# -o AppleCommander *.o -L. -lswt +echo "**********************************************" +echo "** BUILD EXE **" +echo "**********************************************" +echo gcj -mwindows --classpath="swt.jar;AppleCommander.jar" \ --main=com.webcodepro.applecommander.ui.AppleCommander \ -o AppleCommander *.o -L. -lswt -echo Done. +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 "**********************************************"