fixed bug 500
[org.ibex.core.git] / Makefile
1 ############################################################################# 
2 #
3 # The Ibex Makefile
4 #
5
6 #  auto directory creation with %/%: %?
7
8 ifeq ($(platform),)
9 # default
10 platform := Java2
11 endif
12
13 target_Darwin := powerpc-apple-darwin
14 target_Win32  := i686-pc-mingw32
15 target_Solaris := sparc-sun-solaris2.7
16 target_Linux := i686-pc-linux-gnu
17 target := $(target_$(platform))
18
19 all:         Java2 Linux Win32 Darwin Solaris
20
21 clean:      ; rm -rf build
22 dist-clean:
23         rm -rf .jikes .configure* .install* build .compile .build*
24         find upstream -name config.cache -exec rm {} \;
25         test -e upstream/mips && make -C upstream/mips clean
26
27 libwing_Linux := -Lupstream/install/i686-pc-linux-gnu/lib/
28 libwing_Linux +=   upstream/install/i686-pc-linux-gnu/lib/libWINGs.a
29 libwing_Linux +=   upstream/install/i686-pc-linux-gnu/lib/libwraster.a
30
31 libwing_Solaris := -Lupstream/install/sparc-sun-solaris2.7/lib/
32 libwing_Solaris +=   upstream/install/sparc-sun-solaris2.7/lib/libWINGs.a
33 libwing_Solaris +=   upstream/install/sparc-sun-solaris2.7/lib/libwraster.a
34
35 Java2:        build/Java2/ibex.jar
36 JVM:; make Java2
37 Linux:    ; make gcj platform=Linux   link_flags="$(libwing_Linux) -lXpm -lX11 -lXext"
38 Solaris:  ; make gcj platform=Solaris link_flags="$(libwing_Solaris) -lXpm -lX11 -lXext -lpthread"
39 Win32:    ; make gcj platform=Win32   link_flags="-Wl,--subsystem,windows -lcomdlg32"
40 Darwin:   ; make gcj platform=Darwin  link_flags="$(darwin_linker_flags)"
41
42 darwin_libdir       := upstream/install/powerpc-apple-darwin/lib
43 darwin_linker_flags := -Wl,-dylib_file,/usr/lib/libSystem.B.dylib:$(darwin_libdir)/libSystem.B.dylib
44 darwin_linker_flags += -Wl,-dylib_file,/usr/lib/system/libmathCommon.A.dylib:$(darwin_libdir)/libmathCommon.A.dylib
45 darwin_ogl_libdir   := /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
46 darwin_linker_flags += -Wl,-dylib_file,$(darwin_ogl_libdir)/libGL.dylib:$(darwin_libdir)/libGL.dylib
47 darwin_linker_flags += -Wl,-dylib_file,$(darwin_ogl_libdir):$(darwin_libdir)/libGLU.dylib
48 darwin_linker_flags += -lSystem.B -lmathCommon.A -lGL -lGLU
49
50 # stupid broke-ass darwin linker...
51 darwin_linker_flags += build/Darwin/org/ibex/plat/OpenGL.java.o build/Darwin/org/ibex/plat/POSIX.java.o
52
53 target_bin_extension_$(platform) := $(shell echo $(platform) | tr A-Z a-z)
54 target_bin_extension_Win32       := exe
55 target_bin_extension_Java2       := jar
56 target_bin_extension             := $(target_bin_extension_$(platform))
57 target_bin                       := ibex.$(target_bin_extension)
58
59 jikes_flags        := -nowarn
60 gcc_optimizations  := -Os
61 #gcc_optimizations  := -O9 -ffast-math -fomit-frame-pointer -foptimize-sibling-calls
62 #gcc_optimizations  += -finline-functions -funroll-loops -ffunction-sections -fdata-sections
63 gcc_flags          := -nostdinc $(gcc_optimizations) -Ibuild/h -Iupstream/jpeg-6b/src -Iupstream/jpeg-6b/build-$(target) -g
64 gcc_flags          += -Iupstream/install/lib/gcc-lib/$(target)/3.3/include -Iupstream/install/$(target)/include
65 gcc_flags          += -ffunction-sections -fdata-sections -fno-omit-frame-pointer
66 gcj                := upstream/install/bin/$(target)-gcj $(gcc_flags) -fCLASSPATH=build/java
67 gcj                += -fassume-compiled -fmerge-all-constants -finhibit-reflection
68 gcj                += -foptimize-static-class-initialization -feliminate-dwarf2-dups -w
69 gcjh               := $(shell pwd)/upstream/install/bin/$(shell test -e upstream/install/bin/$(target)-gcjh && echo $(target)-)gcjh
70 g++                := upstream/install/bin/$(target)-gcj $(gcc_flags) -Iupstream/install/include -Wno-multichar
71 gcc                := upstream/install/bin/$(target)-gcc $(gcc_flags)
72 jar                := $(shell ((type fastjar &>/dev/null) && echo fastjar) || echo jar)
73
74 gcj: .install_gcc-3.3_$(target)
75         make build/$(platform)/$(target_bin) link_flags="$(link_flags)" platform=$(platform)
76
77 include Makefile.upstream
78
79 # find the superclasses of a platform class
80 #superclass_%:
81 #       @if [ "$*" = "org.ibex.plat.Darwin" ]; then echo org.ibex.plat.OpenGL; fi
82 #       @echo $*
83 #       @grep -s extends src/$(subst .,/,$*).java | sed s_.\*extends\ __ | head -n 1 | sed s_\ .\*__ |\
84 #               xargs --replace make -s superclass_org.ibex.plat.{}
85
86 plat_classes_AWT     := org.ibex.plat.AWT
87 plat_classes_Java2   := org.ibex.plat.Java2 $(plat_classes_AWT)
88 plat_classes_GCJ     := org.ibex.plat.GCJ
89 plat_classes_Win32   := org.ibex.plat.Win32 $(plat_classes_GCJ)
90 plat_classes_POSIX   := org.ibex.plat.POSIX $(plat_classes_GCJ)
91 plat_classes_X11     := org.ibex.plat.X11 $(plat_classes_POSIX)
92 plat_classes_Linux   := org.ibex.plat.Linux $(plat_classes_X11)
93 plat_classes_Solaris := org.ibex.plat.Solaris $(plat_classes_X11)
94 plat_classes_Darwin  := org.ibex.plat.Darwin org.ibex.plat.OpenGL $(plat_classes_POSIX)
95
96 plat_java_src_sources     := $(patsubst %,build/java/%.java,$(subst .,/,$(plat_classes_$(platform))))
97 java_src_sources          := $(shell find src -name '*.java' | grep -v Preprocessor | grep -v /plat/)
98 java_src_sources          += $(plat_java_src_sources)
99 java_sources              := $(patsubst src/%.java,     build/java/%.java, $(java_src_sources))
100 java_sources              += build/java/org/xwt/mips/util/SeekableByteArray.java
101 java_sources              += build/java/org/xwt/mips/util/SeekableData.java
102 java_sources              += build/java/org/xwt/mips/util/SeekableFile.java
103 java_sources              += build/java/org/xwt/mips/util/SeekableInputStream.java
104 java_sources              += build/java/org/xwt/mips/Compiler.java
105 java_sources              += build/java/org/xwt/mips/ELF.java
106 java_sources              += build/java/org/xwt/mips/Interpreter.java
107 java_sources              += build/java/org/xwt/mips/Registers.java
108 java_sources              += build/java/org/xwt/mips/Runtime.java
109 java_sources              += build/java/org/xwt/mips/UnixRuntime.java
110 java_sources              += build/java/org/xwt/mips/Errno.java
111 java_sources              += build/java/org/xwt/mips/Syscalls.java
112 java_sources              += build/java/org/xwt/mips/Unistd.java
113
114 java_classes              := $(java_sources:build/java/%.java=build/class/%.class)
115 java_classes              += build/class/gnu/regexp/CharUnit.class build/class/gnu/regexp/IntPair.class
116
117 build/java/org/xwt/mips/util/%:
118         @test -e .install_mips2java || make .install_mips2java
119         @echo linking $@
120         @mkdir -p $(@D)
121         @cd $(@D); ln -sf ../../../../../../upstream/mips/org/xwt/mips/util/$*
122
123 build/java/org/xwt/mips/%:
124         @test -e .install_mips2java || make .install_mips2java
125         @echo linking $@
126         @mkdir -p $(@D)
127         @test -e upstream/mips/build/org/xwt/mips/$* && (cd $(@D); \
128                 ln -sf ../../../../../upstream/mips/build/org/xwt/mips/$*); true
129         @test -e upstream/mips/org/xwt/mips/$* && (cd $(@D); \
130                 ln -sf ../../../../../upstream/mips/org/xwt/mips/$*); true
131
132
133 ### Java Source Files ##############################################################################
134
135 ifeq ($(platform),Java2)
136 .preprocessor: src/org/ibex/util/Preprocessor.java src/org/ibex/util/Vec.java src/gnu/regexp/*.java
137         @make .jikes
138         @mkdir -p build/class/org/ibex/util build/class/gnu/regexp
139         ./.jikes $^ -d build/class
140         @touch $@
141 else
142 .preprocessor: src/org/ibex/util/Preprocessor.java src/org/ibex/util/Vec.java src/gnu/regexp/*.java
143         @mkdir -p build/class/org/ibex/util build/class/gnu/regexp
144         $(gcj) -Isrc -C $^ -d build/class
145         @touch $@
146 endif
147 build/cc/%.cc:     src/%.c    ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
148 build/res/%:       src/%      ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
149 build/java/org/ibex/%.java: src/org/ibex/%.java .preprocessor
150         @echo -e "\n\033[1mpreprocessing      .java -> .java:  $<\033[0m"
151         mkdir -p `dirname $@`; java -cp build/class org.ibex.util.Preprocessor < $^ > $@
152 build/java/%.java: src/%.java ; @echo linking $@; mkdir -p $(@D); ln -fs `echo $(@D)/ | sed 's_[^/]*//*_../_g'`/$< $@
153
154
155 ### Java Class Files ##############################################################################
156
157 build/class/org/ibex/translators/MIPSApps.class: build/mips/mipsapps.mips .jikes
158         mkdir -p build/java/org/ibex/translators
159         @echo -e "\n\033[1mtranslating        .mips -> .java:  $<\033[0m"
160         (echo -e 'package org.ibex.translators;\n';                           \
161          java -Xint -cp upstream/mips/build org.xwt.mips.Compiler MIPSApps build/mips/mipsapps.mips) \
162          | sed 's,//.*$$,,;'| tr -d '\n' > build/java/org/ibex/translators/MIPSApps.java
163         @echo -e "\n\033[1mcompiling          .java -> .class: $<\033[0m"
164         ./.jikes -g:none build/java/org/ibex/translators/MIPSApps.java
165
166 compile: .compile
167 .compile: .install_mips2java .download_bcel-5.1 $(java_sources) $(java_classes); touch $@
168
169 ifeq ($(platform),Java2)
170 build/class/%.class: build/java/%.java .preprocessor .jikes
171         @echo -e "\n\033[1mcompiling          .java -> .class: $<\033[0m"
172         mkdir -p build/class
173         @./.jikes $< -d build/class
174 else
175 build/class/%.class: build/java/%.java
176         @echo -e "\n\033[1mcompiling          .java -> .class: $<\033[0m"
177         mkdir -p $(@D)
178         $(gcj) -I$(bcel_jar) -C -O0 $< -d build/class
179 endif
180
181 build/Java2/ibex.jar: .compile build/res/builtin.jar build/class/org/ibex/translators/MIPSApps.class
182         @echo -e "\n\033[1marchiving         .class -> .jar:   build/Java2/ibex.jar\033[0m"
183         mkdir -p build/Java2
184         echo -e "Manifest-Version: 1.0\nMain-Class: org.ibex.Main\n" > build/Java2/.manifest
185         cd build/class/org/ibex; ln -sf ../../../res/builtin.jar
186         cd build/class; $(jar) cfm ../Java2/ibex.jar ../Java2/.manifest \
187                 `find . \! -type d` \
188                 $(patsubst %,../../upstream/mips/build/org/xwt/mips/%*.class, Runtime Registers Syscalls Errno)
189
190
191 ### Headers ##################################################################################
192
193 java_headers          := $(java_sources:build/java/%.java=build/h/%.h) 
194 build/h/edu/stanford/ejalbert/BrowserLauncher.h:; mkdir -p $(@D); touch $@
195 build/h/%.h: build/class/%.class .compile
196         @echo -e "\n\033[1mextracting        .class -> .h:     $<\033[0m"
197         mkdir -p `dirname $@`
198         ls `echo $< | sed s/.class\$$//`*.class |\
199                  sed s_build/class/__ | sed s/.class\$$//g | sed s_/_._g | (cd build/class; xargs $(gcjh) -d ../h --classpath .)
200
201
202 ### Native Code ##############################################################################
203
204 # a hack since we've disabled gcj's awt implementation
205 build/$(platform)/org/ibex/plat/Linux.cc.o: .install_WindowMaker-0.80.2_$(target) 
206 build/$(platform)/org/ibex/plat/Solaris.cc.o: .install_WindowMaker-0.80.2_$(target) 
207
208 libjava_dir := $(shell pwd)/upstream/gcc-3.3/build-$(target)/$(target)/libjava
209 nat_libjava_files_ := boehm.o exception.o posix-threads.o posix.o prims.o resolve.o java/net/natInetAddress.o
210 nat_libjava_files_ += java/net/natPlainSocketImpl.o java/util/zip/nat*.o gnu/gcj/runtime/natFirstThread.o
211 nat_libjava_files_ += gnu/gcj/runtime/natNameFinder.o gnu/gcj/runtime/natStackTrace.o gnu/gcj/runtime/natSharedLibLoader.o
212 nat_libjava_files_ += gnu/gcj/runtime/natStringBuffer.o gnu/gcj/runtime/natVMClassLoader.o gnu/gcj/runtime/natFinalizerThread.o
213 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name \*.o -not -name '*[A-Z]*' 2>/dev/null)
214 nat_libjava_files_ += $(shell cd $(libjava_dir) 2>/dev/null; find java/lang -name nat\*.o 2>/dev/null)
215 nat_libjava_files := $(nat_libjava_files_:%=$(libjava_dir)/%)
216 nat_libjava_files += $(libjava_dir)/java/io/natFile.o $(libjava_dir)/java/io/natFileDescriptor.o
217
218 build/$(platform)/org/ibex/plat/$(platform).cc.o: src/org/ibex/plat/$(platform).cc src/org/ibex/plat/*.cc .configure_jpeg-6b_$(target)
219         @make $(java_headers)
220         @echo -e "\n\033[1mcompiling            .cc -> .o:     $<\033[0m"
221         mkdir -p `dirname $@`
222         $(g++) -Iupstream/gcc-3.3/build-$(target)/$(target)/libjava -c $< -o $@
223
224
225 bcel_jar := upstream/bcel-5.1/src/bcel-5.1.jar
226 build/$(platform)/ibex.pruned.jar: .compile $(java_classes) .install_jpeg-6b_$(target) build/$(platform)/builtin.o build/$(platform)/org/ibex/plat/$(platform).cc.o
227         @echo -e "\n\033[1mpruning              .jar -> .jar\033[0m"
228         cp upstream/install/share/java/libgcj-3.3.jar build/$(platform)/ibex.jar
229         cd build/class; jar uf ../$(platform)/ibex.jar $(java_classes:build/class/%.class=%*.class)
230         (nm $(nat_libjava_files) build/$(platform)/org/ibex/plat/$(platform).cc.o; echo org.ibex.plat.$(platform).main) |\
231                 grep _ZN | c++filt --format java | grep " U " | sed 's_ * U __' | sed 's_(.*__' \
232                 | java -cp $(bcel_jar):build/class org.ibex.util.NanoGoat build/$(platform)/ibex.jar | tee nanogoat.log
233         mkdir tmp; cd tmp; fastjar xvf ../build/$(platform)/ibex.jar.pruned; rm gnu/gcj/runtime/FirstThread*; cp ../build/class/org/ibex/plat/GCJ* org/ibex/plat/; cp -r ../build/class/org/xwt/mips/* org/xwt/mips/; mkdir -p $(shell pwd)/build/$(platform)/java/lang; mv java/lang/Class.class $(shell pwd)/build/$(platform)/java/lang; fastjar cvf ../build/$(platform)/ibex.jar.pruned .; cd ..; rm -rf tmp
234         mv build/$(platform)/ibex.jar.pruned $@
235
236 ifeq ($(platform),Win32)
237 filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileWin32.cc
238 filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorWin32.cc
239 else
240 filedes := $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFilePosix.cc
241 filedes += $(shell pwd)/upstream/gcc-3.3/src/libjava/java/io/natFileDescriptorPosix.cc
242 endif
243
244 ifneq ($(target_bin_extension),jar)
245 build/$(platform)/$(target_bin): build/$(platform)/ibex.pruned.jar src/org/ibex/plat/*.cc build/$(platform)/builtin.o $(java_headers)
246
247         @echo -e "\n\033[1mlinking              .jar -> $(target_bin).phat\033[0m"
248 # -Os
249         cd build/$(platform); $(shell pwd)/upstream/install/bin/$(target)-gcj        \
250                 -fCLASSPATH=$(shell pwd)/upstream/install/share/java/libgcj-3.3.jar  \
251                 -finhibit-reflection                                                 \
252                 -fno-store-check                                                     \
253                 -c java/lang/Class.class
254         cd upstream/gcc-3.3/src/libjava/java/lang;\
255                 ln -sf ../../../../build-$(target)/$(target)/libjava/java/lang/natConcreteProcess.cc
256 # we need -fno-store-check since we can't dynamically resolve references to array classes
257         PATH=upstream/install/bin:$$PATH upstream/install/bin/$(target)-gcj              \
258                 -Wl,-O2,--relax,--gc-sections,--noinhibit-exec,--no-whole-archive        \
259                 --main=org.ibex.plat.$(platform)                                         \
260                 -Dfile.encoding=UTF8                                                     \
261                 -DPREFIX=\"\"                                                            \
262                 -Lupstream/install/$(target)/lib -Lupstream/install/lib                  \
263                 -finhibit-reflection                                                     \
264                 -fno-store-check                                                         \
265                 -w -g                                                                    \
266                 -Iupstream/jpeg-6b/build-$(target)/                                      \
267                 -Iupstream/jpeg-6b/src                                                   \
268                 -Ibuild/h                                                                \
269                 -Iupstream/gcc-3.3/src/gcc \
270                 -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/    \
271                 -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/boehm-gc/include    \
272                 -Iupstream/gcc-3.3/src/boehm-gc                                           \
273                 -Iupstream/gcc-3.3/src/boehm-gc/include                                       \
274                 -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/    \
275                 -Iupstream/gcc-3.3/build-i686-pc-linux-gnu/i686-pc-linux-gnu/libjava/include    \
276                 -Iupstream/gcc-3.3/src/libjava                                           \
277                 -Iupstream/gcc-3.3/src/libjava/include                                       \
278                 -Ufile \
279                 build/$(platform)/ibex.pruned.jar                                        \
280                 src/org/ibex/plat/$(platform).cc                                         \
281                 $(nat_libjava_files_:%.o=$(shell pwd)/upstream/gcc-3.3/src/libjava/%.c*) \
282                 $(filedes) \
283                 build/$(platform)/builtin.o                                              \
284                 upstream/jpeg-6b/build-$(target)/libjpeg.a                               \
285                 $(link_flags)                                                            \
286                 $(libjava_dir)/../boehm-gc/.libs/libgcjgc.a                              \
287                 build/$(platform)/Class.o                                                \
288                 $(libjava_dir)/gnu/gcj/runtime/FirstThread.o \
289                 -lz -o $@.phat
290         @echo; ls -l $@.phat
291
292         @echo -e "\n\033[1mstripping              $(target_bin).phat -> $(target_bin)\033[0m"
293         strip $@.phat -o $@
294         @echo; ls -l $@.phat
295
296         @echo -e "\n\033[1mcompressing              $(target_bin) -> $(target_bin)\033[0m"
297         upx-ucl-beta $@
298         @echo; ls -l $@.phat
299 endif
300
301 ### Builtin Resources ##############################################################################
302
303 builtin_src := $(shell find src/org/ibex/builtin -name '*.*' \! -name '*.xcf')
304 build/res/fonts/vera: .download_vera-1.10
305         mkdir -p build/res/fonts/vera
306         cd build/res/fonts/vera; ln -fs ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/Vera.ttf
307         cd build/res/fonts/vera; ln -fs ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraMono.ttf
308         cd build/res/fonts/vera; ln -fs ../../../../upstream/vera-1.10/ttf-bitstream-vera-1.10/VeraSe.ttf
309 build/res/builtin.jar: $(builtin_src:src/%=build/res/%) build/res/fonts/vera
310         @echo -e "\n\033[1mzipping            res/* -> .jar: builtin.jar\033[0m"
311         cd build/res; $(jar) cf builtin.jar org/ibex/builtin/scar.png fonts
312 build/$(platform)/builtin.o: build/res/builtin.jar
313         @echo -e "\n\033[1mwrapping            .jar -> .o: resources.o\033[0m"
314         @mkdir -p $(@D)
315         @(echo "unsigned int builtin_length = ";                                \
316                 (wc -c build/res/builtin.jar | sed "s_build.*__");              \
317                 echo \;;                                                        \
318                 echo "unsigned char builtin_bytes[] = {";                       \
319                 hexdump -ve '"0x" 1/1 "%x,\n"' build/res/builtin.jar;           \
320                 echo "};") > .builtin.c
321         $(gcc) -c .builtin.c -o build/$(platform)/builtin.o
322
323 build/mips/%.c.o: src/%.c .download_libmspack-20030726
324         make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
325         make .install_libmspack-20030726_mips-unknown-elf target=mips-unknown-elf
326         mkdir -p $(@D)
327         echo -e "\n\033[1mcompiling $< -> $@ (mips)\033[0m"
328         upstream/install/bin/mips-unknown-elf-gcc -march=r3000 \
329                 -Iupstream/freetype-2.1.4/src/include  \
330                 -Iupstream/libmspack-20030726/src/mspack \
331                 -c -o $@ $<
332
333 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 
334         make .install_freetype-2.1.4_mips-unknown-elf target=mips-unknown-elf
335         make .install_libmspack-20030726_mips-unknown-elf target=mips-unknown-elf
336         @echo -e "\n\033[1mlinking               .o -> .mips:  $@\033[0m"
337         mkdir -p build/mips build/res
338         upstream/install/bin/mips-unknown-elf-gcc \
339                 --static \
340                 -march=mips1 \
341                 -T upstream/mips/org/xwt/mips/linker.ld \
342                 -L upstream/mips/build/org/xwt/mips/ \
343                 -L upstream/freetype-2.1.4/src/objs \
344                 -L upstream/libmspack-20030726/build-mips-unknown-elf/ \
345                 -o $@ \
346                 $^ \
347                 -lfreetype \
348                 -lmspack   \
349                 -Wl,--gc-sections
350
351
352 ### Maintainer ######################################################################################
353
354 current_build         := $(shell cat next.build)
355 strip_$(platform)     := upstream/install/$(target)/bin/strip build/$(platform)/$(target_bin) -o 
356 strip_Java2             := cp build/$(platform)/$(target_bin)
357 install-dist:;     $(strip_$(platform)) /var/www/org/xwt/dist/master/ibex-$(current_build).$(target_bin_extension).unsigned
358 dist: compile
359         (echo -n 0000; (echo "10k16o16i"; cat next.build | tr a-z A-Z; echo "1+f") | dc) | tail --bytes=5 > next.build-
360         mv next.build- next.build
361         echo -n "Next build will be "; cat next.build
362         nice -n 19 make all
363         make install-dist platform=Win32
364         make install-dist platform=Linux
365         make install-dist platform=Solaris
366         make install-dist platform=Darwin
367         make install-dist platform=Java2
368         echo -e "\n\n\n*** DONE ******************************************"
369
370 propose-patch:
371         @darcs push --and-apply --edit-description -o .darcspatch -T patches@xwt.org http://darcs.ibex.org/ibex/
372         @(echo "To: patches@xwt.org";\
373          SUB=`grep -A10000 New.patches .darcspatch | grep '^\\[' | cut -b 2- | tr \\\n , | sed s_,_,\ _g | sed "s_, *\\$$__"`;\
374          echo "Subject: $$SUB";\
375          echo;\
376          cat .darcspatch) | /usr/sbin/sendmail -bm -f $(USER)@xwt.org patches@xwt.org;
377         @rm .darcspatch 
378