rootfs.sh: allow re-run with same tmp, fix build

This commit is contained in:
fosslinux 2021-01-13 21:37:07 +11:00
parent bca6f897a2
commit 6cdf911161
1 changed files with 10 additions and 10 deletions

View File

@ -25,17 +25,17 @@ cp -r ../bootstrap-seeds tmp/
mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run mv tmp/kaem.run tmp/mescc-tools-seed.kaem.run
cp base.kaem.run tmp/kaem.run cp base.kaem.run tmp/kaem.run
# create directories needed # create directories needed
mkdir tmp/bin mkdir -p tmp/bin
# after mescc-tools-seed we get into our own directory because # after mescc-tools-seed we get into our own directory because
# the mescc-tools-seed one is hella messy # the mescc-tools-seed one is hella messy
mkdir tmp/after/bin -p mkdir -p tmp/after/bin
mkdir tmp/after/{lib,include} mkdir -p tmp/after/{lib,include}
mkdir tmp/after/lib/{tcc,linux} mkdir -p tmp/after/lib/{tcc,linux}
ln -s . tmp/after/lib/x86-mes ln -s . tmp/after/lib/x86-mes
ln -s . tmp/after/lib/linux/x86-mes ln -s . tmp/after/lib/linux/x86-mes
mkdir tmp/after/include/{mes,gnu,linux,sys,mach} mkdir -p tmp/after/include/{mes,gnu,linux,sys,mach}
mkdir tmp/after/include/linux/{x86,x86_64} mkdir -p tmp/after/include/linux/{x86,x86_64}
cp after.kaem tmp/ cp after.kaem tmp/
cp after.kaem.run tmp/after/kaem.run cp after.kaem.run tmp/after/kaem.run
@ -46,7 +46,7 @@ cp -r mescc-tools-extra tmp/after/
pushd tmp/after pushd tmp/after
git clone ../../blynn-compiler-oriansj blynn-compiler git clone ../../blynn-compiler-oriansj blynn-compiler
cp ../../blynn-compiler.kaem blynn-compiler/go.kaem cp ../../blynn-compiler.kaem blynn-compiler/go.kaem
mkdir blynn-compiler/{bin,generated} mkdir -p blynn-compiler/{bin,generated}
popd popd
# mes # mes
@ -94,12 +94,12 @@ get_file() {
popd popd
ext="${url##*.}" ext="${url##*.}"
if [ "$ext" = "tar" ]; then if [ "$ext" = "tar" ]; then
bname=$(basename "$url" .tar) bname=$(basename "$url" ".tar")
else else
bname=$(basename "$url" ".tar.${ext}") bname=$(basename "$url" ".tar.${ext}")
fi fi
if [ -f "{bname}.*" ]; then if [ -f "${bname}."* ]; then
cp "${bname}.*" tmp/after cp "${bname}."* tmp/after
fi fi
cp "../sources/$(basename "$url")" tmp/after cp "../sources/$(basename "$url")" tmp/after
} }