about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsubx/c4
-rwxr-xr-xsubx/cb4
-rwxr-xr-xsubx/cr4
-rwxr-xr-xsubx/dcr4
-rwxr-xr-xsubx/dgen23
-rwxr-xr-xsubx/drun5
-rwxr-xr-xsubx/edit7
-rwxr-xr-xsubx/gen23
-rwxr-xr-xsubx/run5
-rwxr-xr-xsubx/test_layers7
10 files changed, 57 insertions, 29 deletions
diff --git a/subx/c b/subx/c
deleted file mode 100755
index ddfde99a..00000000
--- a/subx/c
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env zsh
-# Make editing various versions of the Crenshaw compiler even more convenient.
-
-./edit crenshaw$1
diff --git a/subx/cb b/subx/cb
deleted file mode 100755
index 924d9c9e..00000000
--- a/subx/cb
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env zsh
-# Make building various versions of the Crenshaw compiler even more convenient.
-
-gen crenshaw$1
diff --git a/subx/cr b/subx/cr
deleted file mode 100755
index e8ccb420..00000000
--- a/subx/cr
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env zsh
-# Make running various versions of the Crenshaw compiler even more convenient.
-
-run crenshaw$1
diff --git a/subx/dcr b/subx/dcr
deleted file mode 100755
index 938dbb56..00000000
--- a/subx/dcr
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env zsh
-# Make opening various versions of the Crenshaw compiler even more convenient.
-
-./dgen crenshaw$1  &&  ./drun crenshaw$1
diff --git a/subx/dgen b/subx/dgen
index c4afbfb2..34f49deb 100755
--- a/subx/dgen
+++ b/subx/dgen
@@ -1,11 +1,26 @@
-#!/usr/bin/env zsh
-# Build commonly-used SubX programs in 'debug mode'.
+#!/bin/sh
+# Little helper to quickly build SubX programs in 'debug mode' from the commandline.
+# Only works for programs in some standard places the repo knows about.
+
+if [ $# -eq 0 ]
+then
+  echo "Usage: $0 <file root without subdirectory or .subx extension>"
+  echo
+  echo "Naming convention: Files starting with 'ex' will be assumed to live in examples/ and be self-contained."
+  echo "Other files will be assumed to live in apps/ and need the standard library."
+  exit 1
+fi
+
+# Build in debug mode since the common case at the moment is building small
+# files. To override, calling scripts should do their own builds to ensure
+# subx_bin is up to date.
+export CFLAGS=-g
 
 if [[ $1 == 'ex'* ]]
 then
-  CFLAGS=-g ./subx --map translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
+  ./subx --map translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
   exit $?
 fi
 
-CFLAGS=-g ./subx --map translate *.subx apps/$1.subx  -o apps/`echo $1 |sed 's/\..*//'`
+./subx --map translate *.subx apps/$1.subx  -o apps/`echo $1 |sed 's/\..*//'`
 exit $?
diff --git a/subx/drun b/subx/drun
index 87092a9d..82584772 100755
--- a/subx/drun
+++ b/subx/drun
@@ -3,7 +3,10 @@
 
 if [ $# -eq 0 ]
 then
-  echo "drun <binary> <args>"
+  echo "Usage: $0 <binary name without directory> <args>"
+  echo
+  echo "Naming convention: Binaries starting with 'ex' will be assumed to live in examples/"
+  echo "Other binaries will be assumed to live in apps/"
   exit 1
 fi
 
diff --git a/subx/edit b/subx/edit
index ef20d85f..dc434f58 100755
--- a/subx/edit
+++ b/subx/edit
@@ -1,9 +1,12 @@
 #!/usr/bin/env zsh
-# Open commonly-used SubX programs.
+# Helper to more conveniently open commonly-used SubX programs.
 
 if [ $# -eq 0 ]
 then
-  echo "edit <file>"
+  echo "Usage: $0 <file root without subdirectory or .subx extension>"
+  echo
+  echo "Naming convention: Files starting with 'ex' will be assumed to live in examples/"
+  echo "Other files will be assumed to live in apps/"
   exit 1
 fi
 
diff --git a/subx/gen b/subx/gen
index 91370ea4..a2f1de4a 100755
--- a/subx/gen
+++ b/subx/gen
@@ -1,11 +1,26 @@
-#!/usr/bin/env zsh
-# Build commonly-used SubX programs.
+#!/bin/sh
+# Little helper to quickly build SubX programs from the commandline.
+# Only works for programs in some standard places the repo knows about.
+
+if [ $# -eq 0 ]
+then
+  echo "Usage: $0 <file root without subdirectory or .subx extension>"
+  echo
+  echo "Naming convention: Files starting with 'ex' will be assumed to live in examples/ and be self-contained."
+  echo "Other files will be assumed to live in apps/ and need the standard library."
+  exit 1
+fi
+
+# Build in debug mode since the common case at the moment is building small
+# files. To override, calling scripts should do their own builds to ensure
+# subx_bin is up to date.
+export CFLAGS=-g
 
 if [[ $1 == 'ex'* ]]
 then
-  CFLAGS=-g ./subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
+  ./subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
   exit $?
 fi
 
-CFLAGS=-g ./subx translate *.subx apps/$1.subx  -o apps/`echo $1 |sed 's/\..*//'`
+./subx translate *.subx apps/$1.subx  -o apps/`echo $1 |sed 's/\..*//'`
 exit $?
diff --git a/subx/run b/subx/run
index 87fa5569..cbb3e576 100755
--- a/subx/run
+++ b/subx/run
@@ -3,7 +3,10 @@
 
 if [ $# -eq 0 ]
 then
-  echo "run <binary> <args>"
+  echo "Usage: $0 <binary name without directory> <args>"
+  echo
+  echo "Naming convention: Binaries starting with 'ex' will be assumed to live in examples/"
+  echo "Other binaries will be assumed to live in apps/"
   exit 1
 fi
 
diff --git a/subx/test_layers b/subx/test_layers
index 5f210c31..306f5d3a 100755
--- a/subx/test_layers
+++ b/subx/test_layers
@@ -13,9 +13,14 @@ do
   ./build_and_test_until $f
 done
 
+# build everything one last time
+clean
+CFLAGS=$CFLAGS ./build  # build optimized by default since we'll be running it repeatedly below
+
 # add SubX files one at a time
 for f in [0-9]*.subx
 do
   echo "=== $f"
-  CFLAGS=-g ./subx translate $(../enumerate/enumerate --until $f |grep '\.subx$') -o foo  &&  ./subx run foo
+  ./subx translate $(../enumerate/enumerate --until $f |grep '\.subx$') -o foo  &&  ./subx run foo
+  echo
 done
K. Agaram <vc@akkartik.com> 2017-07-09 14:25:48 -0700 3965 - get rid of the teardown() function' href='/akkartik/mu/commit/001help.cc?h=hlt&id=6573fe1f1aa6d87c027d10429ded7e0162e52902'>6573fe1f ^
5b5ef63b ^






df37108f ^
5b5ef63b ^



5b5ef63b ^
5a6645bc ^
5b5ef63b ^












5b5ef63b ^





c58e2368 ^
5a6645bc ^
6573fe1f ^
5a6645bc ^



74262581 ^

5a6645bc ^






06084095 ^
5a6645bc ^










795f5244 ^







91abd257 ^




795f5244 ^



f3760b0f ^







c58e2368 ^
08cf048f ^


c58e2368 ^
08cf048f ^


ac0e9db5 ^
b39ceb27 ^
385ff136 ^
d98e1a18 ^
385ff136 ^
b39ceb27 ^





385ff136 ^
b39ceb27 ^
10f415a6 ^
385ff136 ^
b39ceb27 ^
fd72ec75 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258