lean4-htt/script/update-stage0
Sebastian Ullrich a6fbf3c20e refactor: make stages internally consistent by compiling the stageN lib with the stageN compiler, rename static libraries
The old stage1 is now stage0.5, which at least suggests that it's not an entirely consistent stage in general
2020-05-14 23:13:51 +02:00

12 lines
508 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
rm -r stage0 || true
mkdir -p stage0/
c_files="$(cd src; find Init -name '*.lean' | sed s/.lean/.c/ | sort | tr '\n' ' ')"
for f in $c_files; do mkdir -p $(dirname stage0/stdlib/$f); cp $LIB/temp/$f stage0/stdlib/$f; done
# ensure deterministic ordering
echo "add_library (stage0 OBJECT $c_files)" > stage0/stdlib/CMakeLists.txt
# don't copy untracked crap
git ls-files -z src | xargs -0 -I '{}' bash -c 'mkdir -p `dirname stage0/{}` && cp {} stage0/{}'
git add stage0