#! /bin/tcsh

# First copy all general case .dl3 files here
echo Copying...
foreach i (../solutions/*/*.dl3 ../solutions/*/*/*.dl3 ../solutions/*/*/*/*.dl3)
  echo $i
  cp --preserve=mode,timestamps $i .
end


# Now, copy the special cases where we have several alternatives for a file.

# There are three alternatives for audiodec.dl3. If you want to use some other
# than the base audiodec.dl3 driver, copy one of the alternatives on top of it.
echo Fixing audiodec/audiodecdebug/audiodecsmall...
cp --preserve=mode,timestamps ../solutions/audiodec/audiodec/audiodec.dl3 .
cp --preserve=mode,timestamps ../solutions/audiodec/audiodec/audiodec.dl3 audiodec_base.dl3
cp --preserve=mode,timestamps ../solutions/audiodecdebug/audiodec/audiodec.dl3 audiodec_debug.dl3
cp --preserve=mode,timestamps ../solutions/audiodecsmall/audiodec/audiodec.dl3 audiodec_small.dl3

# There are three alternatives for decwav.dl3: the full version, and an
# example PCM version. If you want to the other alternative for the
# decwav.dl3 driver, copy the alternative version on top of it.
echo Fixing decwav...
cp --preserve=mode,timestamps ../../vs1005h/decwav/decwav.dl3 .
cp --preserve=mode,timestamps ../../vs1005h/decwav/decwav.dl3 decwav_full.dl3
cp --preserve=mode,timestamps ../solutions/decwavpcm/decwav.dl3 decwav_pcm.dl3
echo Done

# Copy to root/SYS/
echo Copying to root...
du -s ../root/SYS
foreach i (../root/SYS/*)
  echo = $i
  cp --preserve=mode,timestamps `basename $i` $i
end
du -s ../root/SYS

# Copy to small_root/SYS/
echo Copying to small_root...
du -s ../small_root/SYS
foreach i (../small_root/SYS/*)
  echo = $i
  cp --preserve=mode,timestamps `basename $i` $i
end
du -s ../small_root/SYS
