+build/java/org/xwt/Builtin.java: $(shell ls src/org/xwt/builtin/*.png src/org/xwt/builtin/*.xwt src/org/xwt/builtin/*.xwf)
+ @mkdir -p `dirname $@` build build/java build/class build/h build
+ echo -e "\n\033[1mzipping/uuencoding .xwt -> .java: build/java/org/xwt/Builtin.java\033[0m"
+ echo "package org.xwt;" > build/java/org/xwt/Builtin.java
+ echo "class Builtin {" >> build/java/org/xwt/Builtin.java
+ echo "public static String encoded = " >> build/java/org/xwt/Builtin.java
+ cd src; $(jar) cf - $(<:src/%=%) | \
+ uuencode foo | tail -n +2 | grep -v '^end$$' | grep -v '^`$$' | \
+ sed 's_\(.+\)_"\1" +_' >> ../build/java/org/xwt/Builtin.java
+ echo "\"\"; }" >> build/java/org/xwt/Builtin.java
+
+
+# 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) .compile $(target_bin)
+build/JVM/xwt.jar: .compile
+ @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; $(jar) cfm ../JVM/xwt.jar ../JVM/.manifest `find . -name \*.class`;
+
+
+
+##############################################################################
+# Freetype
+#
+
+build/mips/%.c.o: src/%.c
+ make .install_freetype-2.1.4_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 $@ $<
+
+build/mips/freetype.mips: build/mips/org/xwt/imp/Freetype.c.o build/mips/org/xwt/imp/crt0.c.o build/mips/org/xwt/imp/syscalls.c.o
+ make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
+ @echo -e "\n\033[1mlinking .o -> .mips: $@\033[0m"
+ mkdir -p build/mips
+ upstream/install/bin/mips-unknown-elf-gcc \
+ -nostdlib \
+ --static \
+ -march=mips1 \
+ -T src/org/xwt/imp/linker.ld \
+ -Lbuild/mips \
+ -Lupstream/freetype-2.1.4/src/objs \
+ -o $@ \
+ build/mips/org/xwt/imp/Freetype.c.o \
+ --strip \
+ -lfreetype
+
+build/java/org/xwt/imp/Freetype.java: build/mips/freetype.mips build/class/org/xwt/imp/MIPS.class
+ @echo -e "\n\033[1mtranslating .mips -> .java: $@\033[0m"
+ mkdir -p build/java/org/xwt/imp/
+ rm -f $@
+ java -cp build/class org.xwt.imp.MIPS org.xwt.imp.Freetype build/mips/freetype.mips > build/java/org/xwt/imp/Freetype.java
+
+
+
+##############################################################################
+# 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