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

mkdir linux
cd linux
cp ../../linux/* .
chmod +x wtf.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 .
cd ..

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

echo All done and result should be in home directory.
