+
+## master.dist.xwt.org ############################################################################
+
+current_build := $(shell cat next.build)
+this_branch := $(shell tail -c +2 CVS/Tag 2>/dev/null || echo HEAD)
+this_branch_flag := $(shell test $(this_branch) = HEAD && echo || echo -r $(this_branch))
+
+dist:
+ # this will fail if we haven't checked-in since the comment is null; we want this.
+ cvs commit -m '' > /dev/null
+ cvs tag -F xwt-$(current_build)
+
+ echo "***********************************************************"
+ echo "* This build is $(current_build)"
+ echo "***********************************************************"
+
+ ifeq ($(shell uname -n),serverbeach.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 $(this_branch_flag) \
+ | grep -v "make...:.\(Entering\|Leaving\).directory"
+ endif
+
+
+dist-private:
+ make $(silent) update-build
+
+ # preserve gcc across builds so we don't have to remake it
+ mkdir -p $(HOME)/dist.xwt.org-gcc
+ mv gcc gcc-
+ ln -s $(HOME)/dist.xwt.org-gcc gcc
+ mv -f gcc-/Makefile gcc/
+ mv -f gcc-/gcc.patch gcc/
+
+ # build it
+ nice -n 19 make all
+
+ echo
+ echo === master.dist.xwt.org ==================================
+
+ echo "copying xwt.jar to distribution area..."
+ cp bin-Java2/xwt.jar /var/www/master.dist.xwt.org/xwt-$(current_build).jar.unsigned
+
+ echo "stripping xwt.exe and copying it to the distribution area..."
+ $(strip) bin-Win32/xwt.exe -o /var/www/master.dist.xwt.org/xwt-$(current_build).exe.unsigned
+
+ echo "copying xwt.linux to distribution area..."
+ $(strip) bin-Linux/xwt.linux -o /var/www/master.dist.xwt.org/xwt-$(current_build).linux.unsigned
+
+ echo "creating source tarball in distribution area..."
+ CVSROOT=/cvs cvs export -r xwt-$(current_build) xwt
+ mv xwt xwt-$(current_build)
+ tar cvzf /var/www/master.dist.xwt.org/xwt-$(current_build).tgz xwt-$(current_build)
+
+ echo
+ echo "*** DONE ******************************************"