Build menu only lists experimental targets now.
[retro/experimental.git] / build
blob08bb9d37ac9e75b357f14ece0b36e1e21777b884
1 #! /bin/bash
2 #! --------------------------------------------------------------
3 #! Retro Development Kit
4 #!
5 #! This is the build script for RDEV. It is currently being
6 #! updated to be a bit more modular and easier to extend in the
7 #! future.
8 #! --------------------------------------------------------------
10 SDL="no"
11 THIS=`pwd`
14 #! --------------------------------------------------------------
15 #! Read input from the user
16 #! --------------------------------------------------------------
17 input()
19 read response
20 echo $response
24 #! --------------------------------------------------------------
25 #! Display menu of build options
26 #! --------------------------------------------------------------
27 function options
29 clear
30 echo Retro Development Kit http://retroforth.org
31 echo --------------------------------------------------------------
32 echo Please select the target you wish to build from the list
33 echo below.
34 echo
35 echo 1. Console Build 2 \(faster VM\)
36 echo 2. Retro image for Ngaro JS
37 echo 3. Java Web Build
38 echo 4. J2ME
39 echo
40 echo Choice:
42 option=`input`;
43 case $option in
44 [1])
45 toka
46 image
47 ngaro_mat_tty
48 cont=0
50 [2])
51 toka
52 image
53 image_js
54 cont=0
56 [3])
57 toka
58 image
59 image_java
60 cont=0
62 [4])
63 toka
64 image
65 image_j2me
66 cont=0
68 esac
72 #! --------------------------------------------------------------
73 #! Build Toka
74 #! --------------------------------------------------------------
75 function toka
77 cd $THIS/toka
78 gcc *.c -o toka
79 cd $THIS
80 mv toka/toka bin
85 #! --------------------------------------------------------------
86 #! Build Ngaro (C, with SDL)
87 #! --------------------------------------------------------------
88 function ngaro_crc_sdl
90 cd $THIS/ngaro/c-crc/sdl
91 gcc -Wall -O3 -fomit-frame-pointer disassemble.c endian.c loader.c ngaro.c devices.c vm.c -DUSE_SDL -Wall `sdl-config --cflags --libs` -o ngaro
92 cd $THIS
93 mv ngaro/c-crc/sdl/ngaro bin
98 #! --------------------------------------------------------------
99 #! Build Ngaro (C, text only)
100 #! --------------------------------------------------------------
101 function ngaro_crc_tty
103 cd $THIS/ngaro/c-crc/console
104 gcc -Wall -O3 -fomit-frame-pointer disassemble.c endian.c loader.c ngaro.c vm.c -o ngaro
105 cd $THIS
106 mv ngaro/c-crc/console/ngaro bin
109 function ngaro_mat_tty
111 cd $THIS/ngaro/c-mat
112 gcc -Wall -O3 -fomit-frame-pointer endian.c loader.c ngaro.c tty_devices.c vm.c -o ngaro
113 cd $THIS
114 mv ngaro/c-mat/ngaro bin
119 #! --------------------------------------------------------------
120 #! Build the RETRO image.
121 #! --------------------------------------------------------------
122 function image
124 cd $THIS/retro
125 ln -s $THIS/bin/bootstrap.toka
126 $THIS/bin/toka retro.toka
127 rm bootstrap.toka
128 cd $THIS
129 mv retro/forth.image bin
130 mv retro/forth.image.map bin
132 gcc _build/fix-image.c -o bin/fix-image
133 cd $THIS/bin
134 ./fix-image forth.image
138 function image_js
140 cd $THIS/bin
141 $THIS/bin/toka $THIS/_build/image2js.toka forth.image >image.js
145 function image_java
147 cd $THIS/bin
148 $THIS/bin/toka $THIS/_build/image2java.toka forth.image >$THIS/ngaro/java/image.java
149 cd $THIS/ngaro/java
150 cat Ngaro.top image.java Ngaro.bottom >NgaroVM.java
151 javac NgaroVM.java
152 rm image.java
153 mv NgaroVM.class $THIS/bin
154 rm NgaroVM.java
158 function image_j2me
160 cd $THIS/bin
161 $THIS/bin/toka $THIS/_build/image2j2me.toka forth.image >$THIS/ngaro/j2me/src/Retro/Img.java.middle
162 cd $THIS/ngaro/j2me/src/Retro
163 cat Img.java.top Img.java.middle Img.java.bottom >Img.java
164 cd $THIS/ngaro/j2me
166 rm src/Retro/Img.java.middle src/Retro/Img.java
167 cp bin/* $THIS/bin
168 rm bin/*.jar
172 options