update stale stuff in an old prototype

This commit is contained in:
Kartik Agaram 2022-02-03 10:31:44 -08:00
parent 38a9370673
commit 54423826c7
6 changed files with 46 additions and 46 deletions

6
archive/1.vm/build0 generated
View File

@ -4,7 +4,7 @@
set -v set -v
set -e # stop immediately on error set -e # stop immediately on error
cd ../../tools cd ../../linux/bootstrap/tools
# auto-generate various lists (ending in '_list' by convention) { # auto-generate various lists (ending in '_list' by convention) {
# list of function declarations, so I can define them in any order # list of function declarations, so I can define them in any order
grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' > tangle.function_list grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' > tangle.function_list
@ -14,7 +14,7 @@ cd ../../tools
# } # }
g++ -std=c++98 -g -O3 tangle.cc -o tangle g++ -std=c++98 -g -O3 tangle.cc -o tangle
./tangle test ./tangle test
cd ../archive/1.vm cd ../../../archive/1.vm
cd termbox cd termbox
gcc -g -O2 -c termbox.c gcc -g -O2 -c termbox.c
@ -22,7 +22,7 @@ cd termbox
ar rcs libtermbox.a *.o ar rcs libtermbox.a *.o
cd .. cd ..
../../tools/tangle [0-9]*.cc > mu.cc ../../linux/bootstrap/tools/tangle [0-9]*.cc > mu.cc
# auto-generate function declarations, so I can define them in any order # 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 ') {' # functions start out unindented, have all args on the same line, and end in ') {'
# #

12
archive/1.vm/build1 generated
View File

@ -21,9 +21,9 @@ export CXXFLAGS="-std=c++98 $CFLAGS" # CI has an ancient version; don't expect
# (layers) | | # (layers) | |
# tangle $CXX # tangle $CXX
$CXX $CFLAGS ../../tools/enumerate.cc -o ../../tools/enumerate $CXX $CFLAGS ../../linux/bootstrap/tools/enumerate.cc -o ../../linux/bootstrap/tools/enumerate
cd ../../tools cd ../../linux/bootstrap/tools
# auto-generate various lists (ending in '_list' by convention) { # auto-generate various lists (ending in '_list' by convention) {
# list of function declarations, so I can define them in any order # list of function declarations, so I can define them in any order
grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' > tangle.function_list grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' > tangle.function_list
@ -33,7 +33,7 @@ cd ../../tools
# } # }
$CXX $CXXFLAGS tangle.cc -o tangle $CXX $CXXFLAGS tangle.cc -o tangle
./tangle test ./tangle test
cd ../archive/1.vm cd ../../../archive/1.vm
cd termbox cd termbox
$CC $CFLAGS -c termbox.c $CC $CFLAGS -c termbox.c
@ -41,8 +41,8 @@ cd termbox
ar rcs libtermbox.a *.o ar rcs libtermbox.a *.o
cd .. cd ..
LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.cc$') LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.cc$')
../../tools/tangle $LAYERS > mu.cc ../../linux/bootstrap/tools/tangle $LAYERS > mu.cc
# auto-generate function declarations, so I can define them in any order # 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 ') {' # functions start out unindented, have all args on the same line, and end in ') {'
# #
@ -55,5 +55,5 @@ $CXX $CXXFLAGS mu.cc termbox/libtermbox.a -o mu_bin
## [0-9]*.mu -> core.mu ## [0-9]*.mu -> core.mu
MU_LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files MU_LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files
cat $MU_LAYERS > core.mu cat $MU_LAYERS > core.mu

18
archive/1.vm/build2 generated
View File

@ -81,12 +81,12 @@ noisy_cd() {
echo "-- `pwd`" >&2 echo "-- `pwd`" >&2
} }
older_than ../../tools/enumerate ../../tools/enumerate.cc && { older_than ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/enumerate.cc && {
$CXX $CXXFLAGS ../../tools/enumerate.cc -o ../../tools/enumerate $CXX $CXXFLAGS ../../linux/bootstrap/tools/enumerate.cc -o ../../linux/bootstrap/tools/enumerate
} }
older_than ../../tools/tangle ../../tools/tangle.cc && { older_than ../../linux/bootstrap/tools/tangle ../../linux/bootstrap/tools/tangle.cc && {
noisy_cd ../../tools noisy_cd ../../linux/bootstrap/tools
# auto-generate various lists (ending in '_list' by convention) { # auto-generate various lists (ending in '_list' by convention) {
# list of function declarations, so I can define them in any order # list of function declarations, so I can define them in any order
grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list
@ -96,13 +96,13 @@ older_than ../../tools/tangle ../../tools/tangle.cc && {
# } # }
$CXX $CFLAGS tangle.cc -o tangle $CXX $CFLAGS tangle.cc -o tangle
./tangle test ./tangle test
noisy_cd ../archive/1.vm # no effect; just to show us returning to the parent directory noisy_cd ../../../archive/1.vm # no effect; just to show us returning to the parent directory
} }
LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.cc$') LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.cc$')
older_than mu.cc $LAYERS ../../tools/enumerate ../../tools/tangle && { older_than mu.cc $LAYERS ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/tangle && {
# no update here; rely on 'update' calls downstream # no update here; rely on 'update' calls downstream
../../tools/tangle $LAYERS > mu.cc ../../linux/bootstrap/tools/tangle $LAYERS > mu.cc
} }
older_than cleave/cleave cleave/cleave.cc && { older_than cleave/cleave cleave/cleave.cc && {
@ -150,7 +150,7 @@ older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
## [0-9]*.mu -> core.mu ## [0-9]*.mu -> core.mu
MU_LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files MU_LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files
cat $MU_LAYERS |update core.mu cat $MU_LAYERS |update core.mu
exit 0 exit 0

18
archive/1.vm/build3 generated
View File

@ -106,12 +106,12 @@ noisy_cd() {
echo "-- `pwd`" >&2 echo "-- `pwd`" >&2
} }
older_than ../../tools/enumerate ../../tools/enumerate.cc && { older_than ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/enumerate.cc && {
$CXX $CXXFLAGS ../../tools/enumerate.cc -o ../../tools/enumerate $CXX $CXXFLAGS ../../linux/bootstrap/tools/enumerate.cc -o ../../linux/bootstrap/tools/enumerate
} }
older_than ../../tools/tangle ../../tools/tangle.cc && { older_than ../../linux/bootstrap/tools/tangle ../../linux/bootstrap/tools/tangle.cc && {
noisy_cd ../../tools noisy_cd ../../linux/bootstrap/tools
# auto-generate various lists (ending in '_list' by convention) { # auto-generate various lists (ending in '_list' by convention) {
# list of function declarations, so I can define them in any order # list of function declarations, so I can define them in any order
grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list
@ -121,13 +121,13 @@ older_than ../../tools/tangle ../../tools/tangle.cc && {
# } # }
$CXX $CFLAGS tangle.cc -o tangle $CXX $CFLAGS tangle.cc -o tangle
./tangle test ./tangle test
noisy_cd ../archive/1.vm # no effect; just to show us returning to the parent directory noisy_cd ../../../archive/1.vm # no effect; just to show us returning to the parent directory
} }
LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.cc$') LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.cc$')
older_than mu.cc $LAYERS ../../tools/enumerate ../../tools/tangle && { older_than mu.cc $LAYERS ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/tangle && {
# no update here; rely on 'update' calls downstream # no update here; rely on 'update' calls downstream
../../tools/tangle $LAYERS > mu.cc ../../linux/bootstrap/tools/tangle $LAYERS > mu.cc
} }
older_than cleave/cleave cleave/cleave.cc && { older_than cleave/cleave cleave/cleave.cc && {
@ -175,7 +175,7 @@ older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
## [0-9]*.mu -> core.mu ## [0-9]*.mu -> core.mu
MU_LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files MU_LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files
cat $MU_LAYERS |update core.mu cat $MU_LAYERS |update core.mu
exit 0 exit 0

36
archive/1.vm/build4 generated
View File

@ -125,24 +125,24 @@ all_exist() {
} }
TMP=`mktemp` TMP=`mktemp`
mv_if_exists ../../tools/enumerate $TMP mv_if_exists ../../linux/bootstrap/tools/enumerate $TMP
( (
wait_for_all ../../tools/enumerate.cc wait_for_all ../../linux/bootstrap/tools/enumerate.cc
older_than $TMP ../../tools/enumerate.cc && { older_than $TMP ../../linux/bootstrap/tools/enumerate.cc && {
echo "building enumerate" echo "building enumerate"
$CXX $CXXFLAGS ../../tools/enumerate.cc -o $TMP || quit $CXX $CXXFLAGS ../../linux/bootstrap/tools/enumerate.cc -o $TMP || quit
echo "done building enumerate" echo "done building enumerate"
} }
mv $TMP ../../tools/enumerate mv $TMP ../../linux/bootstrap/tools/enumerate
) & ) &
TMP=`mktemp` TMP=`mktemp`
mv_if_exists ../../tools/tangle $TMP mv_if_exists ../../linux/bootstrap/tools/tangle $TMP
( (
wait_for_all ../../tools/tangle.cc wait_for_all ../../linux/bootstrap/tools/tangle.cc
older_than $TMP ../../tools/tangle.cc && { older_than $TMP ../../linux/bootstrap/tools/tangle.cc && {
echo "building tangle" echo "building tangle"
cd ../../tools cd ../../linux/bootstrap/tools
# auto-generate various lists (ending in '_list' by convention) { # auto-generate various lists (ending in '_list' by convention) {
# list of function declarations, so I can define them in any order # list of function declarations, so I can define them in any order
grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list grep -h "^[^ #].*) {" tangle.cc |sed 's/ {.*/;/' |update tangle.function_list
@ -153,25 +153,25 @@ mv_if_exists ../../tools/tangle $TMP
# Now that we have all the _lists, compile 'tangle' # Now that we have all the _lists, compile 'tangle'
$CXX $CXXFLAGS tangle.cc -o $TMP || quit $CXX $CXXFLAGS tangle.cc -o $TMP || quit
$TMP test $TMP test
cd ../archive/1.vm cd ../../../archive/1.vm
echo "done building tangle" echo "done building tangle"
} }
mv $TMP ../../tools/tangle mv $TMP ../../linux/bootstrap/tools/tangle
) & ) &
wait_for_all ../../tools/enumerate wait_for_all ../../linux/bootstrap/tools/enumerate
echo "enumerating layers" echo "enumerating layers"
LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.cc$') LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.cc$')
echo "done enumerating layers" echo "done enumerating layers"
TMP=`mktemp` TMP=`mktemp`
mv_if_exists mu.cc $TMP mv_if_exists mu.cc $TMP
( (
wait_for_all $LAYERS ../../tools/enumerate ../../tools/tangle wait_for_all $LAYERS ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/tangle
older_than $TMP $LAYERS ../../tools/enumerate ../../tools/tangle && { older_than $TMP $LAYERS ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/tangle && {
echo "running tangle" echo "running tangle"
# no update here; rely on 'update' calls downstream # no update here; rely on 'update' calls downstream
../../tools/tangle $LAYERS >$TMP || quit ../../linux/bootstrap/tools/tangle $LAYERS >$TMP || quit
echo "done running tangle" echo "done running tangle"
} }
mv $TMP mu.cc mv $TMP mu.cc
@ -273,9 +273,9 @@ mv_if_exists mu_bin $TMP
## [0-9]*.mu -> core.mu ## [0-9]*.mu -> core.mu
wait_for_all ../../tools/enumerate wait_for_all ../../linux/bootstrap/tools/enumerate
echo "building core.mu" echo "building core.mu"
MU_LAYERS=$(../../tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files MU_LAYERS=$(../../linux/bootstrap/tools/enumerate --until $UNTIL_LAYER |grep '\.mu$') || exit 0 # ok if no .mu files
cat $MU_LAYERS |update core.mu cat $MU_LAYERS |update core.mu
echo "done building core.mu" echo "done building core.mu"

2
archive/1.vm/clean generated
View File

@ -6,4 +6,4 @@ rm -rf mu.cc core.mu mu_bin* *_list .build
rm -rf termbox/*.o termbox/libtermbox.a rm -rf termbox/*.o termbox/libtermbox.a
rm -rf .until .quit rm -rf .until .quit
test $# -gt 0 && exit 0 # convenience: 'clean top-level' to leave subsidiary tools alone test $# -gt 0 && exit 0 # convenience: 'clean top-level' to leave subsidiary tools alone
rm -rf ../../tools/enumerate ../../tools/tangle ../../tools/*_list cleave/cleave cleave/cleave.dSYM ../../*/*.dSYM rm -rf ../../linux/bootstrap/tools/enumerate ../../linux/bootstrap/tools/tangle ../../linux/bootstrap/tools/*_list cleave/cleave cleave/cleave.dSYM ../../linux/bootstrap/tools/*.dSYM