Removed tailing whitespace from all Ngaro implementations
[retro.git] / build
blob47cef34c81cc34191427d5f398f122076b8794b0
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. Graphical Build \(SDL based\)
36 echo 2. Console Build 1 \(slower VM\)
37 echo 3. Console Build 2 \(faster VM\)
38 echo 4. Retro image for Ngaro JS
39 echo
40 echo Choice:
42 option=`input`;
43 case $option in
44 [1])
45 toka
46 image
47 ngaro_crc_sdl
48 cont=0
50 [2])
51 toka
52 image
53 ngaro_crc_tty
54 cont=0
56 [3])
57 toka
58 image
59 ngaro_mat_tty
60 cont=0
62 [4])
63 toka
64 image
65 image_js
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
144 options