#!/bin/bash

rm -rf install &&
cd musl &&
git clean -fdx &&
git checkout -f &&
git pull &&
./configure --prefix=$(readlink -f $PWD/../install) &&
make -j 3 install &&
cd .. &&
ln -sf $(find /usr/include -name asm) install/include/asm &&
ln -sf /usr/include/linux install/include/linux &&
ln -sf /usr/include/asm-generic install/include/asm-generic &&
ln -sf $(which strip) install/bin/musl-strip &&
ln -sf musl-gcc install/bin/musl-cc
