2003/02/28 04:22:51
[org.ibex.core.git] / Makefile
index 0b2db24..ad45441 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ gcj                    := $(gcc_path)/bin/$(target)-gcj $(gcj_flags) $(gcc_flags
 gcc                    := $(gcc_path)/bin/$(target)-g++ $(gcc_flags)
 gcjh                   := $(gcc_path)/bin/$(target)-gcjh
 ar                     := $(gcc_path)/$(target)/bin/ar
+strip                  := $(gcc_path)/$(target)/bin/strip
 jikes                  := jikes -extdirs ${JAVA_HOME}/jre/lib -nowarn
 
 # platforms
@@ -41,6 +42,7 @@ compile: $(jikes_java_objects) bin/org/xwt/builtin.xwar
 all: $(all_platforms)
 
 $(jikes_java_objects): $(jikes_java_sources)
+       test "$(JAVA_HOME)"x != x || (echo "you forgot to set your $$JAVA_HOME environment variable"; false)
        echo "compiling  .java -> .class:"
        mkdir -p bin
        $(jikes) -sourcepath src/ -classpath lib/libgcj-minimal.jar $(jikes_java_sources) -d bin/
@@ -157,17 +159,16 @@ dist:
        echo "*  This build is $(current_build)"
        echo "***********************************************************"
 
-       (test `uname -n` = gosset.megacz.com) || \
+        ifeq ($(shell uname -n),gosset.megacz.com)
+               (make $(silent) dist-private 2>&1) >> .make-dist.out || \
+                       (tail -n 200 .make-dist.out | mail -s "Build $(current_build) FAILED" cvs@xwt.org; false)
+               tail -n 200 .make-dist.out | \
+                       mail -s "Unsigned binaries of $(current_build) are now available" cvs@xwt.org
+        else
                ssh xwt@xwt.org verbose=$(verbose) /home/xwt/dist \
                        | grep -v "make...:.\(Entering\|Leaving\).directory"
+        endif
 
-       (test `uname -n` = gosset.megacz.com) && \
-               (make $(silent) dist-private 2>> .make-dist.out >> .make-dist.out || \
-                       (cat .make-dist.out | mail -s "Build $(current_build) FAILED" cvs@xwt.org; false))
-
-       (test `uname -n` = gosset.megacz.com) && \
-               (cat .make-dist.out | \
-                       mail -s "Unsigned binaries of $(current_build) are now available" cvs@xwt.org < /dev/null)
 
 dist-private:
        make $(silent) update-build
@@ -188,11 +189,11 @@ dist-private:
        echo "copying xwt.jar to distribution area..."
        cp bin-Java2/xwt.jar /var/www/dist.xwt.org/xwt-$(current_build).jar.unsigned
 
-       echo "copying xwt.exe to distribution area..."
-       cp bin-Win32/xwt.exe /var/www/dist.xwt.org/xwt-$(current_build).exe.unsigned
+       echo "stripping xwt.exe and copying it to the distribution area..."
+       $(strip) bin-Win32/xwt.exe -o /var/www/dist.xwt.org/xwt-$(current_build).exe.unsigned
 
        echo "copying xwt.linux to distribution area..."
-       cp bin-Linux/xwt.linux /var/www/dist.xwt.org/xwt-$(current_build).linux.unsigned
+       $(strip) bin-Linux/xwt.linux -o /var/www/dist.xwt.org/xwt-$(current_build).linux.unsigned
 
        echo
        echo "*** DONE ******************************************"