about summary refs log blame commit diff stats
path: root/build_until
blob: 8abdb5eb0c5dc15a4ddde1153726d2f857aed2a7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14



                                                                              









                                                                             

      
 








                                                                                            
                                                                                     
 
                                                                                                                      
 

                                                                               
#!/bin/bash
# Load all files sorting before the given argument.
# You can pass in a prefix, but files matching the prefix *won't* be included.

# We'll avoid using cleave/ here and use the old flow for building everything
# every single time:
#
#   layers -> mu.cc -> mu_bin
#           |        |
#         tangle    g++
#
# This has the nice side-effect of acting like an earlier/simpler 'layer' for
# the build system.

set -e
set -v

( cd enumerate && make; )
( cd tangle && make; )

# build mu_bin
./tangle/tangle $(./enumerate/enumerate --until ${1:-zzz} |grep -v '.mu$') > mu.cc

( cd termbox && make; )

grep -h "^[^[:space:]#].*) {$" mu.cc |grep -v ":.*(" |perl -pwe 's/ \{.*/;/' > function_list
grep -h "^\s*void test_" mu.cc |perl -pwe 's/^\s*void (.*)\(\) \{.*/$1,/' > test_list

eval ${CXX:-c++} ${CXXFLAGS:-"-g -O3"} -Wall -Wextra -ftrapv -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin

# build core.mu
cat /dev/null $(./enumerate/enumerate --until ${1:-zzz} |grep '.mu$') > core.mu