about summary refs log tree commit diff stats
path: root/html/edit
ModeNameSize
-rw-r--r--001-editor.mu.html52465log stats plain blame
-rw-r--r--002-typing.mu.html132248log stats plain blame
-rw-r--r--003-shortcuts.mu.html475403log stats plain blame
-rw-r--r--004-programming-environment.mu.html73979log stats plain blame
-rw-r--r--005-sandbox.mu.html163923log stats plain blame
-rw-r--r--006-sandbox-copy.mu.html57487log stats plain blame
-rw-r--r--007-sandbox-delete.mu.html48385log stats plain blame
-rw-r--r--008-sandbox-edit.mu.html46924log stats plain blame
-rw-r--r--009-sandbox-test.mu.html31742log stats plain blame
-rw-r--r--010-sandbox-trace.mu.html36063log stats plain blame
-rw-r--r--011-errors.mu.html119776log stats plain blame
-rw-r--r--012-editor-undo.mu.html225190log stats plain blame
tle='author Kartik K. Agaram <vc@akkartik.com> 2018-03-13 08:32:48 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2018-03-13 08:34:05 -0700 4219 - add an even simpler build script' href='/akkartik/mu/commit/build1?h=main&id=c912b7319fb204e95e6d97c2c9c182bcaca8f93e'>c912b731 ^
5763322b ^
c912b731 ^
5763322b ^
c912b731 ^
f898ee7a ^
5763322b ^

c912b731 ^
f898ee7a ^
c912b731 ^






a232af2f ^
745a6dee ^
c912b731 ^
5763322b ^



c912b731 ^
5763322b ^
c912b731 ^
53172ce1 ^
c912b731 ^
a232af2f ^


745a6dee ^
c912b731 ^
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
         

                                                                             

                          
 
      

                                   

                                                                            
                        

                             
                                        


                                                                  


                              
 


                                                          

                                                                   



                                                                       
                                                                    
                                                                    
                                 
                                                                              
                                 
                                                                
                        
                                                                                              
                                                                                             

                                                     
                                
               






                          
 
                                                                   
                                



                                                                                  
                                                                                        
                                    
                                                                                
                                                                                       
                                                 


                       
                                                                                                      
                         
#!/bin/sh
# Alternative to build0 that supports a --until flag to include only a subset
# of layers.
#   $ ./build1 --until 050
UNTIL_LAYER=${2:-zzz}

set -v
set -e  # stop immediately on error

# Some environment variables that can be passed in. For example, to turn off
# optimization:
#   $ CFLAGS=-g ./build1
test "$CXX" || export CXX=c++
test "$CC" || export CC=cc
test "$CFLAGS" || export CFLAGS="-g -O2"
export CFLAGS="$CFLAGS -Wall -Wextra -ftrapv -fno-strict-aliasing"

# Outline:
# [0-9]*.cc -> mu.cc -> mu_bin
# (layers)   |        |
#          tangle   $CXX

$CXX $CFLAGS enumerate/enumerate.cc -o enumerate/enumerate

cd tangle
  # auto-generate various lists (ending in '_list' by convention) {
  # list of types
  {
    grep -h "^struct .* {" [0-9]*.cc  |sed 's/\(struct *[^ ]*\).*/\1;/'
    grep -h "^typedef " [0-9]*.cc
  }  > type_list
  # list of function declarations, so I can define them in any order
  grep -h "^[^ #].*) {" [0-9]*.cc  |sed 's/ {.*/;/'  > function_list
  # list of code files to compile
  ls [0-9]*.cc  |grep -v "\.test\.cc$"  |sed 's/.*/#include "&"/'  > file_list
  # list of test files to compile
  ls [0-9]*.test.cc  |sed 's/.*/#include "&"/'  > test_file_list
  # list of tests to run
  grep -h "^[[:space:]]*void test_" [0-9]*.cc  |sed 's/^\s*void \(.*\)() {$/\1,/'  > test_list
  grep -h "^\s*void test_" [0-9]*.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  > test_name_list
  # }
  # Now that we have all the _lists, compile 'tangle'
  $CXX $CFLAGS boot.cc -o tangle
  ./tangle test
cd ..

cd termbox
  $CC $CFLAGS -c termbox.c
  $CC $CFLAGS -c utf8.c
  ar rcs libtermbox.a *.o
cd ..

LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER  |grep '\.cc$')
./tangle/tangle $LAYERS  > mu.cc
# auto-generate function declarations, so I can define them in any order
# functions start out unindented, have all args on the same line, and end in ') {'
#
#                                      \/ ignore methods
grep -h "^[^[:space:]#].*) {$" mu.cc  |grep -v ":.*("  |sed 's/ {.*/;/'  > function_list
# auto-generate list of tests to run
grep -h "^\s*void test_" mu.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  > test_list
grep -h "^\s*void test_" mu.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  > test_name_list
$CXX $CFLAGS mu.cc termbox/libtermbox.a -o mu_bin

## [0-9]*.mu -> core.mu

MU_LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER  |grep '\.mu$') || exit 0  # ok if no .mu files
cat $MU_LAYERS  > core.mu