#! /bin/tcsh
# NOTE!
# This is a script for automatically building root directories. It is not
# intended to be in any way useful for entities outside of VLSI Solution.
echo Phase 1: dl3
rsync -a --inplace solutions/*/*/*/*.dl3 SYS_everything/
rsync -a --inplace solutions/*/*/*.dl3 SYS_everything/
rsync -a --inplace solutions/*/*.dl3 SYS_everything/

echo Phase 2: audiodec
rsync -a --inplace solutions/audiodec/audiodec/audiodec.dl3 \
      SYS_everything/audiodec_base.dl3
rsync -a --inplace solutions/audiodecsmall/audiodec/audiodec.dl3 \
      SYS_everything/audiodec_small.dl3
rsync -a --inplace solutions/audiodecdebug/audiodec/audiodec.dl3 \
      SYS_everything/audiodec_debug.dl3
rsync -a --inplace SYS_everything/audiodec_base.dl3 \
      SYS_everything/audiodec.dl3

echo Phase 3: Edit
rsync -a --inplace solutions/Edit/Edit.ini SYS_everything/

echo Phase 4: PReg
rsync -a --inplace solutions/preg/preg.dat SYS_everything/

echo Phase 5: shell
rsync -a --inplace solutions/shell/shell.ap3 root/
rsync -a --inplace solutions/shell/shell.ap3 small_root/

echo Phase 6: root
cd root/SYS
foreach i (*)
  rsync -a --inplace ../../SYS_everything/$i .
end
cd ../..

echo Phase 7: small_root
cd small_root/SYS
foreach i (*)
  rsync -a --inplace ../../SYS_everything/$i .
end
cd ../..

set SRC=../vs1005g/VSOS_367g_ExtFlash/kernel.sym
echo Phase 8: $SRC
echo   Remember to update to most current version!
rsync -a --inplace $SRC root/
rsync -a --inplace $SRC small_root/
