#!/bin/bash
[% c("var/set_default_env") -%]
distdir="/var/tmp/dist/[% project %]"

[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]

mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c("version") %].tar.gz
cd /var/tmp/build/[% project %]-[% c("version") %]

make x64

mkdir -p $distdir/bin/
cp fxc2.exe $distdir/bin/
cp dll/d3dcompiler_47_32.dll $distdir/bin/d3dcompiler_47_32.dll
cp dll/d3dcompiler_47.dll $distdir/bin/

cd /var/tmp/dist

[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
    }) %]
