#!/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 defocus_"$argv"
cp ~/defocus_"$argv".zip .
7za x defocus_"$argv".zip
cd defocus_"$argv"

mkdir linux
cd linux
cp ../../linux/* .
chmod +x defocus.sh
# Remove makefile as it is 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 defocus_"$argv".zip
7za a defocus_"$argv".zip defocus_"$argv"
cp defocus_"$argv".zip ~

echo All done and result should be in home directory.
