#############################################################################
#
-# The XWT Makefile
-
+# The Ibex Makefile
#
-all: JVM Linux Win32 Darwin Solaris
-
-JVM: build/JVM/xwt.jar
-Linux: ; make gcj platform=Linux target=i686-pc-linux-gnu link_flags="-lX11 -lXext"
-Solaris: ; make gcj platform=Solaris target=sparc-sun-solaris2.7 link_flags="-lX11 -lXext"
-Win32: ; make gcj platform=Win32 target=i686-pc-mingw32 link_flags="-Wl,--subsystem,windows -lcomdlg32" target_bin=xwt.exe
-Darwin: ; make gcj platform=Darwin target=powerpc-apple-darwin link_flags="$(darwin_linker_flags)"
-
-# default
-platform := JVM
+target_Darwin := powerpc-apple-darwin
+target_Win32 := i686-pc-mingw32
+target_Solaris := sparc-sun-solaris2.7
+target_Linux := i686-pc-linux-gnu
+target := $(target_$(platform))
+
+all: JVM Linux Win32 Darwin Solaris
+
+clean: ; rm -rf build
+dist-clean:
+ rm -rf .jikes .configure* .install* build .compile .build*
+ find upstream -name config.cache -exec rm {} \;
+ test -e upstream/mips && make -C upstream/mips clean
+
+JVM: build/JVM/ibex.jar
+Linux: ; make gcj platform=Linux link_flags="-lX11 -lXext"
+Solaris: ; make gcj platform=Solaris link_flags="-lX11 -lXext -lpthread"
+Win32: ; make gcj platform=Win32 link_flags="-Wl,--subsystem,windows -lcomdlg32"
+Darwin: ; make gcj platform=Darwin link_flags="$(darwin_linker_flags)"
+
+foo: .compile
+ rm -rf build/class/*
+ make oldcompile
+ make .install_jode-1.1.1_java target=java
+ cd build; jar xvf ../upstream/install/share/java/libgcj-3.3.jar java/lang/Object.class
+ java -cp upstream/java-getopt-1.0.9:upstream/jode-1.1.1/build-java jode.obfuscator.Main jode.conf
+ cd out; jar xvf ../upstream/install/share/java/libgcj-3.3.jar java/lang/
+ cd build/class; tar cf - org/ | tar -C ../../out -xvf -
+ cd out ; rm -rf gnu/java/awt gnu/java/beans gnu/java/rmi java/rmi java/beans java/awt java/sql
+ for A in `find out -name \*.class`; do cd `dirname $$A`; $(shell pwd)/$(gcj) -c `basename $$A` -fCLASSPATH=$(shell pwd)/out; cd $(shell pwd); done
darwin_libdir := upstream/install/powerpc-apple-darwin/lib
darwin_linker_flags := -Wl,-dylib_file,/usr/lib/libSystem.B.dylib:$(darwin_libdir)/libSystem.B.dylib
darwin_linker_flags += -Wl,-dylib_file,/usr/lib/system/libmathCommon.A.dylib:$(darwin_libdir)/libmathCommon.A.dylib
-darwin_linker_flags += -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:$(darwin_libdir)/libGL.dylib
-darwin_linker_flags += -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib:$(darwin_libdir)/libGLU.dylib
+darwin_ogl_libdir := /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
+darwin_linker_flags += -Wl,-dylib_file,$(darwin_ogl_libdir)/libGL.dylib:$(darwin_libdir)/libGL.dylib
+darwin_linker_flags += -Wl,-dylib_file,$(darwin_ogl_libdir):$(darwin_libdir)/libGLU.dylib
darwin_linker_flags += -lSystem.B -lmathCommon.A -lGL -lGLU
+# stupid broke-ass darwin linker...
+darwin_linker_flags += build/Darwin/org/ibex/plat/OpenGL.java.o build/Darwin/org/ibex/plat/POSIX.java.o
-#############################################################################
-# Configurables:
-#
-target_bin := xwt.$(shell echo $(platform) | tr A-Z a-z)
-jikes_flags := -nowarn -sourcepath src/
-gcc_optimizations := -O2
-#gcc_optimizations := -O9 -ffast-math -fomit-frame-pointer -foptimize-sibling-calls
-#gcc_optimizations += -finline-functions -funroll-loops -ffunction-sections -fdata-sections
-gcc_flags := -nostdinc $(gcc_optimizations) -Ibuild/h -Iupstream/jpeg-6b/src/ -Iupstream/jpeg-6b/build-$(target)/
-gcj_flags := -fCLASSPATH=build/java
-gcj := upstream/install/bin/$(target)-gcj $(gcc_flags) $(gcj_flags)
-gcjh := $(shell test -e `pwd`/upstream/install/bin/$(target)-gcjh && echo `pwd`/upstream/install/bin/$(target)-gcjh || echo `pwd`/upstream/install/bin/gcjh)
-g++ := upstream/install/bin/$(target)-gcj $(gcc_flags)
-gcc := upstream/install/bin/$(target)-gcc $(gcc_flags)
-jar := $(shell ((type fastjar &>/dev/null) && echo fastjar) || echo jar)
+target_bin_extension_$(platform) := $(shell echo $(platform) | tr A-Z a-z)
+target_bin_extension_Win32 := exe
+target_bin_extension_JVM := jar
+target_bin_extension := $(target_bin_extension_$(platform))
+target_bin := ibex.$(target_bin_extension)
-include Makefile.upstream
+jikes_flags := -nowarn
+gcc_optimizations := -O2
+#gcc_optimizations := -O9 -ffast-math -fomit-frame-pointer -foptimize-sibling-calls
+#gcc_optimizations += -finline-functions -funroll-loops -ffunction-sections -fdata-sections
+
+gcc_flags := -nostdinc $(gcc_optimizations) -Ibuild/h -Iupstream/jpeg-6b/src -Iupstream/jpeg-6b/build-$(target)
+gcc_flags += -Iupstream/install/lib/gcc-lib/$(target)/3.3/include -Iupstream/install/$(target)/include
+gcj := upstream/install/bin/$(target)-gcj $(gcc_flags) -fCLASSPATH=build/java
+gcjh := $(shell pwd)/upstream/install/bin/$(shell test -e upstream/install/bin/$(target)-gcjh && echo $(target)-)gcjh
+g++ := upstream/install/bin/$(target)-gcj $(gcc_flags) -Iupstream/install/include -Wno-multichar
+gcc := upstream/install/bin/$(target)-gcc $(gcc_flags)
+jar := $(shell ((type fastjar &>/dev/null) && echo fastjar) || echo jar)
-# figure out what stuff in org.xwt.plat.* this platform requires (its superclasses)
-all_java_sources := $(patsubst src/%.java, build/java/%.java, $(shell find src -name '*.java'))
-all_java_sources += $(patsubst src/%.java.pp, build/java/%.java, $(shell find src -name '*.java.pp'))
+gcj: .install_gcc-3.3_$(target); make build/$(platform)/$(target_bin) link_flags="$(link_flags)" platform=$(platform)
-java_sources := $(all_java_sources)
-nonplat_java_sources := $(filter-out build/java/org/xwt/plat/%, $(all_java_sources))
-plat_java_sources := $(filter build/java/org/xwt/plat/%, $(all_java_sources))
+include Makefile.upstream
-# FIXME: must have a relitavely new GNU sed... Apple sed fails silently (why?)
-build/java/%.java: src/%.java ; @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
-build/cc/%.cc: src/%.c ; @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
-build/c/jpeg/%.c: upstream/jpeg-6b/src/%.c
- @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
-build/res/%: src/% ; @echo linking $@; mkdir -p $(@D); ln -s `echo $(@D) | sed 's_[^/]*\(/\|$$\)_../_g'`/$< $@
+java_sources := $(patsubst src/%.java, build/java/%.java, $(shell find src -name '*.java' | grep -v Preprocessor))
+java_sources += build/java/org/xwt/mips/Errno.java
+java_sources += build/java/org/xwt/mips/Unistd.java
+java_sources += build/java/org/xwt/mips/Syscalls.java
+java_sources += build/java/org/xwt/mips/Registers.java
+java_sources += build/java/org/xwt/mips/Runtime.java
+java_sources += build/java/org/xwt/mips/UnixRuntime.java
+java_sources += build/java/org/xwt/mips/util/SeekableByteArray.java
+java_sources += build/java/org/xwt/mips/util/SeekableData.java
+java_sources += build/java/org/xwt/mips/util/SeekableFile.java
+java_sources += build/java/org/xwt/mips/util/SeekableInputStream.java
+
+build/java/org/xwt/mips/util/%:
+ @test -e .install_mips2java || make .install_mips2java
+ @echo linking $@
+ @mkdir -p $(@D)
+ @cd $(@D); ln -sf ../../../../../../upstream/mips/org/xwt/mips/util/$*
+build/java/org/xwt/mips/%:
+ @test -e .install_mips2java || make .install_mips2java
+ @echo linking $@
+ @mkdir -p $(@D)
+ @test -e upstream/mips/build/org/xwt/mips/$* && (cd $(@D); \
+ ln -sf ../../../../../upstream/mips/build/org/xwt/mips/$*); true
+ @test -e upstream/mips/org/xwt/mips/$* && (cd $(@D); \
+ ln -sf ../../../../../upstream/mips/org/xwt/mips/$*); true
+
+
+### Java Class Files ##############################################################################
+
+build/class/org/ibex/translators/MIPSApps.class: build/mips/mipsapps.mips .jikes
+ mkdir -p build/java/org/ibex/translators
+ @echo -e "\n\033[1mtranslating .mips -> .java: $<\033[0m"
+ (echo -e 'package org.xwt.translators;\n'; \
+ java -Xint -cp upstream/mips/build org.xwt.mips.Compiler MIPSApps build/mips/mipsapps.mips) \
+ | sed 's,//.*$$,,;'| tr -d '\n' > build/java/org/ibex/translators/MIPSApps.java
+ @echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
+ ./.jikes -g:none build/java/org/ibex/translators/MIPSApps.java
-build/java/%.java: src/%.java.pp
- make build/class/org/xwt/util/Preprocessor.class
- @echo -e "\n\033[1mpreprocessing .java.pp -> .java: $<\033[0m"
- mkdir -p `dirname $@`
- rm -f $@
- java -cp build/class org.xwt.util.Preprocessor < $< > $@
+build/java/org/ibex/%.java: src/org/ibex/%.java
+ make build/class/org/ibex/util/Preprocessor.class
+ @echo -e "\n\033[1mpreprocessing .java -> .java: $<\033[0m"
+ mkdir -p `dirname $@`; java -cp build/class org.ibex.util.Preprocessor < $< > $@
-build/class/%.class: build/java/%.java .jikes
+build/java/%.java: src/%.java ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
+build/cc/%.cc: src/%.c ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
+build/res/%: src/% ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
+
+build/class/org/ibex/util/Preprocessor.class: src/org/ibex/util/Preprocessor.java .jikes
@echo -e "\n\033[1mcompiling .java -> .class: $<\033[0m"
- mkdir -p build/class
+ mkdir -p build/class/org/ibex/util/
./.jikes $<
-# this forces a clean build every time because jikes is so damn buggy
+oldcompile:; CLASSPATH=$$CLASSPATH:lib/libgcj-minimal.jar:upstream/mips/build javac -target 1.1 -d build/class `find build/java/ -name \*.java`
compile: .compile
-.compile: $(all_java_sources) .jikes
+.compile: $(java_sources) .jikes .install_mips2java
@echo -e "\n\033[1mcompiling .java -> .class: src/**/*.java\033[0m"
- rm -rf build/class
+ @rm -f $(java_sources:build/java/%.java=build/class/%.class)
mkdir -p build/class
- @./.jikes $(all_java_sources)
+ echo @./.jikes $(java_sources)
+ @./.jikes $(java_sources)
touch .compile
-# PHASE 4: gcj-generated headers
-java_headers := $(all_java_sources:build/java/%.java=build/h/%.h)
+build/JVM/ibex.jar: .compile build/res/builtin.jar build/class/org/ibex/translators/MIPSApps.class
+ @echo -e "\n\033[1marchiving .class -> .jar: build/JVM/ibex.jar\033[0m"
+ mkdir -p build/JVM
+ echo -e "Manifest-Version: 1.0\nMain-Class: org.ibex.Main\n" > build/JVM/.manifest
+ cd build/class/org/ibex; ln -sf ../../../res/builtin.jar
+ cd build/class; $(jar) cfm ../JVM/ibex.jar ../JVM/.manifest \
+ `find . \! -type d` \
+ $(patsubst %,../../upstream/mips/build/org/xwt/mips/%*.class, Runtime Registers Syscalls Errno)
+
+
+### GCJH Headers ##############################################################################
+
+java_headers := $(java_sources:build/java/%.java=build/h/%.h)
build/h/edu/stanford/ejalbert/BrowserLauncher.h:; mkdir -p $(@D); touch $@
-build/h/%.h: build/class/%.class
+build/h/%.h: build/class/%.class .compile
@echo -e "\n\033[1mextracting .class -> .h: $<\033[0m"
mkdir -p `dirname $@`
ls `echo $< | sed s/.class\$$//`*.class |\
sed s_build/class/__ | sed s/.class\$$//g | sed s_/_._g | (cd build/class; xargs $(gcjh) -d ../h --classpath .)
+
+### Native Code ##############################################################################
+
# a hack since we've disabled gcj's awt implementation
-build/$(platform)/org/xwt/plat/Java2.java.o:
- touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
-build/$(platform)/org/xwt/plat/AWT.java.o:
- touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
+build/$(platform)/org/ibex/plat/Java2.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
+build/$(platform)/org/ibex/plat/AWT.java.o: ; touch .empty.c; mkdir -p $(@D); $(gcc) -c .empty.c -o $@;
+
+build/$(platform)/org/ibex/translators/MIPSApps.java.o: build/class/org/ibex/translators/MIPSApps.class
+ @echo -e "\n\033[1mcompiling .class -> .o: $<\033[0m"
+ mkdir -p `dirname $@`
+ $(gcj) -Os -c $< -o $@
build/$(platform)/%.java.o: build/java/%.java
@echo -e "\n\033[1mcompiling .java -> .o: $<\033[0m"
mkdir -p `dirname $@`
$(gcj) -c $< -o $@
-headers: $(java_headers)
-
-build/$(platform)/org/xwt/plat/$(platform).cc.o: src/org/xwt/plat/$(platform).cc src/org/xwt/plat/*.cc .configure_jpeg-6b_$(target)
- @make headers
+build/$(platform)/org/ibex/plat/$(platform).cc.o: src/org/ibex/plat/$(platform).cc src/org/ibex/plat/*.cc .configure_jpeg-6b_$(target)
+ @make $(java_headers)
@echo -e "\n\033[1mcompiling .cc -> .o: $<\033[0m"
mkdir -p `dirname $@`
- $(g++) -Iupstream/install/lib/gcc-lib/$(target)/3.3/include/ -Iupstream/install/$(target)/include -I/usr/X11R6/include/ -Ibuild/h -Wno-multichar -Iupstream/install/include -c $< -o $@
-
-build/$(platform)/jpeg-6b/%.c.o: upstream/jpeg-6b/src/%.c
- @echo -e "\n\033[1mcompiling .c -> .o: $<\033[0m"
- mkdir -p `dirname $@`
- $(gcc) -Ibuild/h -c $< -o $@
-
-# PHASE 5: linking
-# FIXME use libjpeg
-jpeg_sources := jdapimin.c jdapistd.c jcomapi.c jcparam.c jdmaster.c jdinput.c jdmainct.c jdcoefct.c jdpostct.c jdmarker.c
-jpeg_sources += jdhuff.c jdphuff.c jddctmgr.c jidctint.c jidctfst.c jidctflt.c jidctred.c jdsample.c jdcolor.c jdmerge.c
-jpeg_sources += jquant1.c jquant2.c jerror.c jutils.c jmemnobs.c jmemmgr.c
+ $(g++) -c $< -o $@
-upstream/jpeg-6b/build-$(target)/libjpeg.a: .install_jpeg-6b_$(target)
-java_objects := $(nonplat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
-
-build/$(platform)/$(platform).ar: $(java_objects) build/$(platform)/builtin.o $(plat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
+nonplat_java_sources := $(filter-out build/java/org/ibex/plat/$(platform).java,$(java_sources))
+build/$(platform)/$(platform).ar: $(nonplat_java_sources:build/java/%.java=build/$(platform)/%.java.o)
@echo -e "\n\033[1marchiving .o -> .a\033[0m"
mkdir -p build/$(platform)
- upstream/install/$(target)/bin/ar rc $@ $?
+ rm -f $@
+ upstream/install/$(target)/bin/ar rc $@ $^
upstream/install/$(target)/bin/ranlib $@
-$(target_bin): build/$(platform)/$(platform).ar build/$(platform)/org/xwt/plat/$(platform).cc.o upstream/jpeg-6b/build-$(target)/libjpeg.a
+upstream/jpeg-6b/build-$(target)/libjpeg.a: .install_jpeg-6b_$(target)
+build/$(platform)/$(target_bin): build/$(platform)/org/ibex/plat/$(platform).cc.o upstream/jpeg-6b/build-$(target)/libjpeg.a build/$(platform)/builtin.o build/$(platform)/$(platform).ar build/$(platform)/org/ibex/plat/$(platform).java.o
@echo -e "\n\033[1mlinking .o -> $(target_bin)\033[0m"
mkdir -p build/$(platform)
- PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.xwt.Main -o build/$(platform)/$(target_bin) -Lupstream/install/$(target)/lib $^ build/$(platform)/org/xwt/plat/$(platform).java.o $(link_flags)
+ PATH=upstream/install/bin:$$PATH $(gcj) -v --main=org.ibex.Main -o $@ -Lupstream/install/$(target)/lib $^ $(link_flags)
-##############################################################################
-# Special treatment:
-#
+### Builtin Resources ##############################################################################
-builtin_src := $(shell find src/org/xwt/builtin -name '*.*')
-build/res/builtin.jar: $(builtin_src:src/%=build/res/%) build/res/freetype.mips
+builtin_src := $(shell find src/org/ibex/builtin -name '*.*' \! -name '*.xcf')
+build/res/fonts/vera: .download_vera-1.10
+ mkdir -p build/res/fonts/vera
+ cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/Vera.ttf
+ cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraMono.ttf
+ cd build/res/fonts/vera; ln -s ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraSe.ttf
+build/res/builtin.jar: $(builtin_src:src/%=build/res/%) build/res/fonts/vera
@echo -e "\n\033[1mzipping res/* -> .jar: builtin.jar\033[0m"
cd build/res; $(jar) cf builtin.jar $(^:build/res/%=%)
-
build/$(platform)/builtin.o: build/res/builtin.jar
@echo -e "\n\033[1mwrapping .jar -> .o: resources.o\033[0m"
@(echo "unsigned int builtin_length = "; \
echo "};") > .builtin.c
$(gcc) -c .builtin.c -o build/$(platform)/builtin.o
-# compile is here to force compilation of the .class files (they get used via -Ibuild) without
-# having the individual .o's depend on the .java's (otherwise every .o gets recompiled when one .java changes)
-gcj: .vendor .install_gcc-3.3_$(target) $(target_bin)
-
-build/JVM/xwt.jar: .compile build/res/builtin.jar
- @echo -e "\n\033[1marchiving .class -> .jar: build/JVM/xwt.jar\033[0m"
- mkdir -p build/JVM
- echo -e "Manifest-Version: 1.0\nMain-Class: org.xwt.Main\n" > build/JVM/.manifest
- cd build/class/org/xwt; ln -sf ../../../res/builtin.jar
- cd build/class; $(jar) cfm ../JVM/xwt.jar ../JVM/.manifest `find . \! -type d`;
-
-
-##############################################################################
-# Freetype
-#
-
-build/mips/%.c.o: src/%.c
+build/mips/%.c.o: src/%.c .download_libmspack-20030726
make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ make .install_libmspack-20030726_mips-unknown-elf target=mips-unknown-elf
mkdir -p $(@D)
echo -e "\n\033[1mcompiling $< -> $@ (mips)\033[0m"
- upstream/install/bin/mips-unknown-elf-gcc -march=r3000 -I upstream/freetype-2.1.4/src/include -c -o $@ $<
+ upstream/install/bin/mips-unknown-elf-gcc -march=r3000 \
+ -Iupstream/freetype-2.1.4/src/include \
+ -Iupstream/libmspack-20030726/src/mspack \
+ -c -o $@ $<
-build/res/freetype.mips: build/mips/org/xwt/translators/Freetype.c.o build/mips/org/xwt/mips/crt0.c.o build/mips/org/xwt/mips/syscalls.c.o
+build/mips/mipsapps.mips: build/mips/org/ibex/translators/Freetype.c.o build/mips/org/ibex/translators/MSPack.c.o build/mips/org/ibex/translators/main.c.o
make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ make .install_libmspack-20030726_mips-unknown-elf target=mips-unknown-elf
@echo -e "\n\033[1mlinking .o -> .mips: $@\033[0m"
mkdir -p build/mips build/res
upstream/install/bin/mips-unknown-elf-gcc \
- -nostdlib \
--static \
-march=mips1 \
- -T src/org/xwt/mips/linker.ld \
- -Lbuild/mips \
- -Lupstream/freetype-2.1.4/src/objs \
+ -T upstream/mips/org/xwt/mips/linker.ld \
+ -L upstream/mips/build/org/xwt/mips/ \
+ -L upstream/freetype-2.1.4/src/objs \
+ -L upstream/libmspack-20030726/build-mips-unknown-elf/ \
-o $@ \
- build/mips/org/xwt/translators/Freetype.c.o \
- --strip \
- -lfreetype
+ $^ \
+ -lfreetype \
+ -lmspack \
+ -Wl,--gc-sections
-
-
-##############################################################################
-# Maintainer stuff: generating numbered builds, proposing patches
-#
-
-update-build:
- cvs tag -F xwt-$(current_build)
- (echo -n 0000; (echo "10k16o16i"; cat next.build | tr a-z A-Z; echo "1+f") | dc) | tail --bytes=5 > next.build-
- mv next.build- next.build
- echo -n "Next build will be "
- cat next.build
- cvs update CHANGES
- echo "" >> CHANGES
- echo `date +%d-%b`" =========== build $(current_build) ================================================" >> CHANGES
- echo committing...
- cvs commit -m 'this comment should not appear in CHANGES' next.build CHANGES
- echo committed.
-
-propose-patch:
- @echo -n "Please type a one-line description of this bug: "; \
- read A; \
- echo; \
- echo "Please type any additional comments that explain this patch."; \
- echo "If this patch fixes a bug, include a link to bugs.xwt.org."; \
- echo "When you are done, press control-d on a new line."; \
- echo; \
- ( echo -e "HELO patcher"; \
- echo -e "MAIL FROM:$(USER)@xwt.org"; \
- echo -e "RCPT TO: patches@xwt.org"; \
- echo -e "DATA"; \
- echo -e "From: $(USER)@xwt.org"; \
- echo -e "To: patches@xwt.org"; \
- echo -e "Subject: proposed patch to $(this_branch): $$A"; \
- echo -e ""; \
- cat; \
- echo; \
- cvs diff -Bud; \
- echo .; \
- ) > .message
- bash -c "cat .message > /dev/tcp/mail.xwt.org/25" # /dev/tcp is faked by bash; not part of the os
+### Maintainer ######################################################################################
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))
-
-# pre-depend on compile as a sanity check
+strip_$(platform) := upstream/install/$(target)/bin/strip build/$(platform)/$(target_bin) -o
+strip_JVM := cp build/$(platform)/$(target_bin)
+install-dist:; $(strip_$(platform)) /var/www/master.dist.ibex.org/ibex-$(current_build).$(target_bin_extension).unsigned
dist: compile
- # 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
- echo -e 'export JAVA_HOME=/usr/lib/j2sdk1.4\n cd /home/xwt\n date=`date +%d-%b-%H%M`\n mkdir xwt-$$date\n cd xwt-$$date\n /usr/bin/cvs -d /cvs co $(this_branch_flag) xwt\n mv xwt/* .\n mv xwt/.* .\n rmdir xwt\n touch .make-dist.out\n nohup make dist &\n echo\n cat .make-dist.out' | ssh xwt@xwt.org | grep -v "make...:.\(Entering\|Leaving\).directory"
- endif
-
-dist-private:
- make $(silent) update-build
-
- # build it
+ (echo -n 0000; (echo "10k16o16i"; cat next.build | tr a-z A-Z; echo "1+f") | dc) | tail --bytes=5 > next.build-
+ mv next.build- next.build
+ echo -n "Next build will be "; cat next.build
nice -n 19 make all
+ make install-dist platform=Win32
+ make install-dist platform=Linux
+ make install-dist platform=Solaris
+ make install-dist platform=Darwin
+ make install-dist platform=JVM
+ echo -e "\n\n\n*** DONE ******************************************"
- echo
- echo === master.dist.xwt.org ==================================
-
- echo "copying xwt.jar to distribution area..."
- cp build/JVM/xwt.jar /var/www/master.dist.xwt.org/xwt-$(current_build).jar.unsigned
-
- echo "stripping xwt.exe and copying it to the distribution area..."
- upstream/install/i686-pc-mingw32/bin/strip build/Win32/xwt.exe \
- -o /var/www/master.dist.xwt.org/xwt-$(current_build).exe.unsigned
-
- echo "copying xwt.linux to distribution area..."
- upstream/install/i686-pc-linux-gnu/bin/strip build/Linux/xwt.linux \
- -o /var/www/master.dist.xwt.org/xwt-$(current_build).linux.unsigned
-
- echo "copying xwt.solaris to distribution area..."
- upstream/install/sparc-sun-solaris2.7/bin/strip build/Solaris/xwt.solaris \
- -o /var/www/master.dist.xwt.org/xwt-$(current_build).solaris.unsigned
-
- echo "copying xwt.darwin to distribution area..."
- upstream/install/powerpc-apple-darwin/bin/strip build/Darwin/xwt.darwin \
- -o /var/www/master.dist.xwt.org/xwt-$(current_build).darwin.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)
+propose-patch:
+ @darcs push --and-apply --edit-description -o .darcspatch -T patches@xwt.org http://darcs.ibex.org/ibex/
+ @(echo "To: patches@xwt.org";\
+ SUB=`grep -A2 New.patches .darcspatch | tail -n 1 | cut -b 2-`;\
+ echo "Subject: $$SUB";\
+ echo;\
+ cat .darcspatch) | cat > /tmp/foo #/usr/sbin/sendmail -bm -f $(USER)@xwt.org patches@xwt.org;
+ @rm .darcspatch
- echo
- echo "*** DONE ******************************************"