#!/bin/csh -f

echo Injecting linux into version $argv
echo Run this script from support/scripts
echo The source .zip should be in home directory

cd ../..

echo Now in
pwd
rm -rf pointless_"$argv"
cp ~/pointless_"$argv".zip .
7za x pointless_"$argv".zip
cd pointless_"$argv"

mkdir linux
cd linux
cp ../../linux/* .
chmod +x defocus.sh
# Remove makefiles as they are confusing
rm Makefile*
rm BUILD.TXT
cd ..
mkdir lib
cd lib
cp -R ../../lib/libtcod-1.15.1_build .
cp -R ../../lib/mimalloc-2.1.2 .
cd ..

cd ..
rm -f pointless_"$argv".zip
7za a pointless_"$argv".zip pointless_"$argv"
cp pointless_"$argv".zip ~

echo All done and result should be in home directory.
