echo "amiga.c"
if exists amiga.c
  protect amiga.c +rd
  ceol <amiga.c >t.cr
  if exists t.cr
    delete amiga.c quiet
    rename t.cr amiga.c
  endif
else
  echo "missing file: amiga.c"
endif

echo "amiga.cat"
if exists amiga.cat
  protect amiga.cat +rd
  ceol <amiga.cat >t.cr
  if exists t.cr
    delete amiga.cat quiet
    rename t.cr amiga.cat
  endif
else
  echo "missing file: amiga.cat"
endif

echo "amigainf.cat"
if exists amigainf.cat
  protect amigainf.cat +rd
  if not exists amiga.cat.info
    rename amigainf.cat amiga.cat.info
  endif
else
  if not exists amiga.cat.info
    echo "missing file: amigainf.cat"
  endif
endif

echo "amiga.doc"
if exists amiga.doc
  protect amiga.doc +rd
  ceol <amiga.doc >t.cr
  if exists t.cr
    delete amiga.doc quiet
    rename t.cr amiga.doc
  endif
else
  echo "missing file: amiga.doc"
endif

echo "amigainf.doc"
if exists amigainf.doc
  protect amigainf.doc +rd
  if not exists amiga.doc.info
    rename amigainf.doc amiga.doc.info
  endif
else
  if not exists amiga.doc.info
    echo "missing file: amigainf.doc"
  endif
endif

echo "amigacon.h"
if exists amigacon.h
  protect amigacon.h +rd
  if not exists config.h
    ceol <amigacon.h >config.h
    if exists config.h
      delete amigacon.h quiet
    endif
  endif
else
  if not exists config.h
    echo "missing file: amigacon.h"
  endif
endif

echo "amiga.mak"
if exists amiga.mak
  protect amiga.mak +rd
  if not exists makefile
    ceol <amiga.mak >makefile
    if exists makefile
      delete amiga.mak quiet
    endif
  endif
else
  if not exists makefile
    echo "missing file: amiga.mak"
  endif
endif

echo "read.me"
if exists read.me
  protect read.me +rd
  ceol <read.me >t.cr
  if exists t.cr
    delete read.me quiet
    rename t.cr read.me
  endif
else
  echo "missing file: read.me"
endif

echo "bounce.pov"
if exists bounce.pov
  protect bounce.pov +rd
  ceol <bounce.pov >t.cr
  if exists t.cr
    delete bounce.pov quiet
    rename t.cr bounce.pov
  endif
else
  echo "missing file: bounce.pov"
endif

echo "testloop.pov"
if exists testloop.pov
  protect testloop.pov +rd
  ceol <testloop.pov >t.cr
  if exists t.cr
    delete testloop.pov quiet
    rename t.cr testloop.pov
  endif
else
  echo "missing file: testloop.pov"
endif


if exists //

  echo "//povinf.doc"
  if exists //povinf.doc
    protect //povinf.doc +rd
    ceol <//povinf.doc >t.cr
    if exists t.cr
      delete //povinf.doc quiet
      rename t.cr //povinf.doc
    endif
  else
    echo "missing file: //povinf.doc"
  endif

  echo "//povininf.doc"
  if exists //povininf.doc
    protect //povininf.doc +rd
    if not exists //povinf.doc.info
      rename //povininf.doc //povinf.doc.info
    endif
  else
    if not exists //povinf.doc.info
      if exists icons/povininf.doc
        copy icons/povininf.doc //povinf.doc.info
      endif
    endif
  endif

  echo "//povlegal.doc"
  if exists //povlegal.doc
    protect //povlegal.doc +rd
    ceol <//povlegal.doc >t.cr
    if exists t.cr
      delete //povlegal.doc quiet
      rename t.cr //povlegal.doc
    endif
  else
    echo "missing file: //povlegal.doc"
  endif

  echo "//povlginf.doc"
  if exists //povlginf.doc
    protect //povlginf.doc +rd
    if not exists //povlegal.doc.info
      rename //povlginf.doc //povlegal.doc.info
    endif
  else
    if not exists //povlegal.doc.info
      if exists icons/povlginf.doc
        copy icons/povlginf.doc //povlegal.doc.info
      endif
    endif
  endif

  echo "//povdoc.cat"
  if exists //povdoc.cat
    protect //povdoc.cat +rd
    ceol <//povdoc.cat >t.cr
    if exists t.cr
      delete //povdoc.cat quiet
      rename t.cr //povdoc.cat
    endif
  else
    echo "missing file: //povdoc.cat"
  endif

  echo "//povdoinf.cat"
  if exists //povdoinf.cat
    protect //povdoinf.cat +rd
    if not exists //povdoc.cat.info
      rename //povdoinf.cat //povdoc.cat.info
    endif
  else
    if not exists //povdoc.cat.info
      if exists icons/povdoinf.cat
        copy icons/povdoinf.cat //povdoc.cat.info
      endif
    endif
  endif

  echo "//povscn.cat"
  if exists //povscn.cat
    protect //povscn.cat +rd
    ceol <//povscn.cat >t.cr
    if exists t.cr
      delete //povscn.cat quiet
      rename t.cr //povscn.cat
    endif
  else
    echo "missing file: //povscn.cat"
  endif

  echo "//povscinf.cat"
  if exists //povscinf.cat
    protect //povscinf.cat +rd
    if not exists //povscn.cat.info
      rename //povscinf.cat //povscn.cat.info
    endif
  else
    if not exists //povscn.cat.info
      if exists icons/povscinf.cat
        copy icons/povscinf.cat //povscn.cat.info
      endif
    endif
  endif

  echo "//povsrc.cat"
  if exists //povsrc.cat
    protect //povsrc.cat +rd
    ceol <//povsrc.cat >t.cr
    if exists t.cr
      delete //povsrc.cat quiet
      rename t.cr //povsrc.cat
    endif
  else
    echo "missing file: //povsrc.cat"
  endif

  echo "//povsrinf.cat"
  if exists //povsrinf.cat
    protect //povsrinf.cat +rd
    if not exists //povsrc.cat.info
      rename //povsrinf.cat //povsrc.cat.info
    endif
  else
    if not exists //povsrc.cat.info
      if exists icons/povsrinf.cat
        copy icons/povsrinf.cat //povsrc.cat.info
      endif
    endif
  endif

  echo "//whatsnew.doc"
  if exists //whatsnew.doc
    protect //whatsnew.doc +rd
    ceol <//whatsnew.doc >t.cr
    if exists t.cr
      delete //whatsnew.doc quiet
      rename t.cr //whatsnew.doc
    endif
  else
    echo "missing file: //whatsnew.doc"
  endif

  echo "//whnewinf.doc"
  if exists //whnewinf.doc
    protect //whnewinf.doc +rd
    if not exists //whatsnew.doc.info
      rename //whnewinf.doc //whatsnew.doc.info
    endif
  else
    if not exists //whatsnew.doc.info
      if exists icons/whnewinf.doc
        copy icons/whnewinf.doc //whatsnew.doc.info
      endif
    endif
  endif

endif


if exists //demo

  echo "//demo/demo.cat"
  if exists //demo/demo.cat
    protect //demo/demo.cat +rd
    ceol <//demo/demo.cat >t.cr
    if exists t.cr
      delete //demo/demo.cat quiet
      rename t.cr //demo/demo.cat
    endif
  else
    echo "missing file: //demo/demo.cat"
  endif

  echo "//demo/demoinf.cat"
  if exists //demo/demoinf.cat
    protect //demo/demoinf.cat +rd
    if not exists //demo/demo.cat.info
      rename //demo/demoinf.cat //demo/demo.cat.info
    endif
  else
    if not exists //demo/demo.cat.info
      if exists icons/demoinf.cat
        copy icons/demoinf.cat //demo/demo.cat.info
      endif
    endif
  endif

endif

if exists //docs

  echo "//docs/povray.doc"
  if exists //docs/povray.doc
    protect //docs/povray.doc +rd
    ceol <//docs/povray.doc >t.cr
    if exists t.cr
      delete //docs/povray.doc quiet
      rename t.cr //docs/povray.doc
    endif
  else
    echo "missing file: //docs/povray.doc"
  endif

  echo "//docs/povpvinf.doc"
  if exists //docs/povpvinf.doc
    protect //docs/povpvinf.doc +rd
    if not exists //docs/povray.doc.info
      rename //docs/povpvinf.doc //docs/povray.doc.info
    endif
  else
    if not exists //docs/povray.doc.info
      if exists icons/povpvinf.doc
        copy icons/povpvinf.doc //docs/povray.doc.info
      endif
    endif
  endif

  echo "//docs/textures.doc"
  if exists //docs/textures.doc
    protect //docs/textures.doc +rd
    ceol <//docs/textures.doc >t.cr
    if exists t.cr
      delete //docs/textures.doc quiet
      rename t.cr //docs/textures.doc
    endif
  else
    echo "missing file: //docs/textures.doc"
  endif

  echo "//docs/povtxinf.doc"
  if exists //docs/povtxinf.doc
    protect //docs/povtxinf.doc +rd
    if not exists //docs/textures.doc.info
      rename //docs/povtxinf.doc //docs/textures.doc.info
    endif
  else
    if not exists //docs/textures.doc.info
      if exists icons/povtxinf.doc
        copy icons/povtxinf.doc //docs/textures.doc.info
      endif
    endif
  endif

endif

if exists //include

  echo "//include/include.cat"
  if exists //include/include.cat
    protect //include/include.cat +rd
    ceol <//include/include.cat >t.cr
    if exists t.cr
      delete //include/include.cat quiet
      rename t.cr //include/include.cat
    endif
  else
    echo "missing file: //include/include.cat"
  endif

  echo "//include/povininf.cat"
  if exists //include/povininf.cat
    protect //include/povininf.cat +rd
    if not exists //include/include.cat.info
      rename //include/povininf.cat //include/include.cat.info
    endif
  else
    if not exists //include/include.cat.info
      if exists icons/povininf.cat
        copy icons/povininf.cat //include/include.cat.info
      endif
    endif
  endif

endif

if exists //machine

  echo "//machine/machine.cat"
  if exists //machine/machine.cat
    protect //machine/machine.cat +rd
    ceol <//machine/machine.cat >t.cr
    if exists t.cr
      delete //machine/machine.cat quiet
      rename t.cr //machine/machine.cat
    endif
  else
    echo "missing file: //machine/machine.cat"
  endif

  echo "//machine/machninf.cat"
  if exists //machine/machninf.cat
    protect //machine/machninf.cat +rd
    if not exists //machine/machine.cat.info
      rename //machine/machninf.cat //machine/machine.cat.info
    endif
  else
    if not exists //machine/machine.cat.info
      if exists icons/machninf.cat
        copy icons/machninf.cat //machine/machine.cat.info
      endif
    endif
  endif

endif

if exists //source

  echo "//source/source.cat"
  if exists //source/source.cat
    protect //source/source.cat +rd
    ceol <//source/source.cat >t.cr
    if exists t.cr
      delete //source/source.cat quiet
      rename t.cr //source/source.cat
    endif
  else
    echo "missing file: //source/source.cat"
  endif

  echo "//source/sourcinf.cat"
  if not exists //source/source.cat.info
    if exists //source/sourcinf.cat
      rename //source/sourcinf.cat //source/source.cat.info
    else
      if exists icons/sourcinf.cat
        copy icons/sourcinf.cat //source/source.cat.info
      endif
    endif
  endif

  echo "//source/bezier.c"
  if exists //source/bezier.c
    protect //source/bezier.c +rd
    ceol <//source/bezier.c >t.cr
    if exists t.cr
      delete //source/bezier.c quiet
      rename t.cr //source/bezier.c
    endif
  else
    echo "missing file: //source/bezier.c"
  endif

  echo "//source/blob.c"
  if exists //source/blob.c
    protect //source/blob.c +rd
    ceol <//source/blob.c >t.cr
    if exists t.cr
      delete //source/blob.c quiet
      rename t.cr //source/blob.c
    endif
  else
    echo "missing file: //source/blob.c"
  endif

  echo "//source/bound.c"
  if exists //source/bound.c
    protect //source/bound.c +rd
    ceol <//source/bound.c >t.cr
    if exists t.cr
      delete //source/bound.c quiet
      rename t.cr //source/bound.c
    endif
  else
    echo "missing file: //source/bound.c"
  endif

  echo "//source/boxes.c"
  if exists //source/boxes.c
    protect //source/boxes.c +rd
    ceol <//source/boxes.c >t.cr
    if exists t.cr
      delete //source/boxes.c quiet
      rename t.cr //source/boxes.c
    endif
  else
    echo "missing file: //source/boxes.c"
  endif

  echo "//source/camera.c"
  if exists //source/camera.c
    protect //source/camera.c +rd
    ceol <//source/camera.c >t.cr
    if exists t.cr
      delete //source/camera.c quiet
      rename t.cr //source/camera.c
    endif
  else
    echo "missing file: //source/camera.c"
  endif

  echo "//source/colour.c"
  if exists //source/colour.c
    protect //source/colour.c +rd
    ceol <//source/colour.c >t.cr
    if exists t.cr
      delete //source/colour.c quiet
      rename t.cr //source/colour.c
    endif
  else
    echo "missing file: //source/colour.c"
  endif

  echo "//source/cones.c"
  if exists //source/cones.c
    protect //source/cones.c +rd
    ceol <//source/cones.c >t.cr
    if exists t.cr
      delete //source/cones.c quiet
      rename t.cr //source/cones.c
    endif
  else
    echo "missing file: //source/cones.c"
  endif

  echo "//source/csg.c"
  if exists //source/csg.c
    protect //source/csg.c +rd
    ceol <//source/csg.c >t.cr
    if exists t.cr
      delete //source/csg.c quiet
      rename t.cr //source/csg.c
    endif
  else
    echo "missing file: //source/csg.c"
  endif

  echo "//source/discs.c"
  if exists //source/discs.c
    protect //source/discs.c +rd
    ceol <//source/discs.c >t.cr
    if exists t.cr
      delete //source/discs.c quiet
      rename t.cr //source/discs.c
    endif
  else
    echo "missing file: //source/discs.c"
  endif

  echo "//source/dump.c"
  if exists //source/dump.c
    protect //source/dump.c +rd
    ceol <//source/dump.c >t.cr
    if exists t.cr
      delete //source/dump.c quiet
      rename t.cr //source/dump.c
    endif
  else
    echo "missing file: //source/dump.c"
  endif

  echo "//source/express.c"
  if exists //source/express.c
    protect //source/express.c +rd
    ceol <//source/express.c >t.cr
    if exists t.cr
      delete //source/express.c quiet
      rename t.cr //source/express.c
    endif
  else
    echo "missing file: //source/express.c"
  endif

  echo "//source/frame.h"
  if exists //source/frame.h
    protect //source/frame.h +rd
    ceol <//source/frame.h >t.cr
    if exists t.cr
      delete //source/frame.h quiet
      rename t.cr //source/frame.h
    endif
  else
    echo "missing file: //source/frame.h"
  endif

  echo "//source/gif.c"
  if exists //source/gif.c
    protect //source/gif.c +rd
    ceol <//source/gif.c >t.cr
    if exists t.cr
      delete //source/gif.c quiet
      rename t.cr //source/gif.c
    endif
  else
    echo "missing file: //source/gif.c"
  endif

  echo "//source/gifdecod.c"
  if exists //source/gifdecod.c
    protect //source/gifdecod.c +rd
    ceol <//source/gifdecod.c >t.cr
    if exists t.cr
      delete //source/gifdecod.c quiet
      rename t.cr //source/gifdecod.c
    endif
  else
    echo "missing file: //source/gifdecod.c"
  endif

  echo "//source/hfield.c"
  if exists //source/hfield.c
    protect //source/hfield.c +rd
    ceol <//source/hfield.c >t.cr
    if exists t.cr
      delete //source/hfield.c quiet
      rename t.cr //source/hfield.c
    endif
  else
    echo "missing file: //source/hfield.c"
  endif

  echo "//source/iff.c"
  if exists //source/iff.c
    protect //source/iff.c +rd
    ceol <//source/iff.c >t.cr
    if exists t.cr
      delete //source/iff.c quiet
      rename t.cr //source/iff.c
    endif
  else
    echo "missing file: //source/iff.c"
  endif

  echo "//source/image.c"
  if exists //source/image.c
    protect //source/image.c +rd
    ceol <//source/image.c >t.cr
    if exists t.cr
      delete //source/image.c quiet
      rename t.cr //source/image.c
    endif
  else
    echo "missing file: //source/image.c"
  endif

  echo "//source/lighting.c"
  if exists //source/lighting.c
    protect //source/lighting.c +rd
    ceol <//source/lighting.c >t.cr
    if exists t.cr
      delete //source/lighting.c quiet
      rename t.cr //source/lighting.c
    endif
  else
    echo "missing file: //source/lighting.c"
  endif

  echo "//source/matrices.c"
  if exists //source/matrices.c
    protect //source/matrices.c +rd
    ceol <//source/matrices.c >t.cr
    if exists t.cr
      delete //source/matrices.c quiet
      rename t.cr //source/matrices.c
    endif
  else
    echo "missing file: //source/matrices.c"
  endif

  echo "//source/normal.c"
  if exists //source/normal.c
    protect //source/normal.c +rd
    ceol <//source/normal.c >t.cr
    if exists t.cr
      delete //source/normal.c quiet
      rename t.cr //source/normal.c
    endif
  else
    echo "missing file: //source/normal.c"
  endif

  echo "//source/objects.c"
  if exists //source/objects.c
    protect //source/objects.c +rd
    ceol <//source/objects.c >t.cr
    if exists t.cr
      delete //source/objects.c quiet
      rename t.cr //source/objects.c
    endif
  else
    echo "missing file: //source/objects.c"
  endif

  echo "//source/parse.c"
  if exists //source/parse.c
    protect //source/parse.c +rd
    ceol <//source/parse.c >t.cr
    if exists t.cr
      delete //source/parse.c quiet
      rename t.cr //source/parse.c
    endif
  else
    echo "missing file: //source/parse.c"
  endif

  echo "//source/parse.h"
  if exists //source/parse.h
    protect //source/parse.h +rd
    ceol <//source/parse.h >t.cr
    if exists t.cr
      delete //source/parse.h quiet
      rename t.cr //source/parse.h
    endif
  else
    echo "missing file: //source/parse.h"
  endif

  echo "//source/pigment.c"
  if exists //source/pigment.c
    protect //source/pigment.c +rd
    ceol <//source/pigment.c >t.cr
    if exists t.cr
      delete //source/pigment.c quiet
      rename t.cr //source/pigment.c
    endif
  else
    echo "missing file: //source/pigment.c"
  endif

  echo "//source/planes.c"
  if exists //source/planes.c
    protect //source/planes.c +rd
    ceol <//source/planes.c >t.cr
    if exists t.cr
      delete //source/planes.c quiet
      rename t.cr //source/planes.c
    endif
  else
    echo "missing file: //source/planes.c"
  endif

  echo "//source/point.c"
  if exists //source/point.c
    protect //source/point.c +rd
    ceol <//source/point.c >t.cr
    if exists t.cr
      delete //source/point.c quiet
      rename t.cr //source/point.c
    endif
  else
    echo "missing file: //source/point.c"
  endif

  echo "//source/poly.c"
  if exists //source/poly.c
    protect //source/poly.c +rd
    ceol <//source/poly.c >t.cr
    if exists t.cr
      delete //source/poly.c quiet
      rename t.cr //source/poly.c
    endif
  else
    echo "missing file: //source/poly.c"
  endif

  echo "//source/povproto.h"
  if exists //source/povproto.h
    protect //source/povproto.h +rd
    ceol <//source/povproto.h >t.cr
    if exists t.cr
      delete //source/povproto.h quiet
      rename t.cr //source/povproto.h
    endif
  else
    echo "missing file: //source/povproto.h"
  endif

  echo "//source/povray.c"
  if exists //source/povray.c
    protect //source/povray.c +rd
    ceol <//source/povray.c >t.cr
    if exists t.cr
      delete //source/povray.c quiet
      rename t.cr //source/povray.c
    endif
  else
    echo "missing file: //source/povray.c"
  endif

  echo "//source/quadrics.c"
  if exists //source/quadrics.c
    protect //source/quadrics.c +rd
    ceol <//source/quadrics.c >t.cr
    if exists t.cr
      delete //source/quadrics.c quiet
      rename t.cr //source/quadrics.c
    endif
  else
    echo "missing file: //source/quadrics.c"
  endif

  echo "//source/raw.c"
  if exists //source/raw.c
    protect //source/raw.c +rd
    ceol <//source/raw.c >t.cr
    if exists t.cr
      delete //source/raw.c quiet
      rename t.cr //source/raw.c
    endif
  else
    echo "missing file: //source/raw.c"
  endif

  echo "//source/ray.c"
  if exists //source/ray.c
    protect //source/ray.c +rd
    ceol <//source/ray.c >t.cr
    if exists t.cr
      delete //source/ray.c quiet
      rename t.cr //source/ray.c
    endif
  else
    echo "missing file: //source/ray.c"
  endif

  echo "//source/render.c"
  if exists //source/render.c
    protect //source/render.c +rd
    ceol <//source/render.c >t.cr
    if exists t.cr
      delete //source/render.c quiet
      rename t.cr //source/render.c
    endif
  else
    echo "missing file: //source/render.c"
  endif

  echo "//source/spheres.c"
  if exists //source/spheres.c
    protect //source/spheres.c +rd
    ceol <//source/spheres.c >t.cr
    if exists t.cr
      delete //source/spheres.c quiet
      rename t.cr //source/spheres.c
    endif
  else
    echo "missing file: //source/spheres.c"
  endif

  echo "//source/targa.c"
  if exists //source/targa.c
    protect //source/targa.c +rd
    ceol <//source/targa.c >t.cr
    if exists t.cr
      delete //source/targa.c quiet
      rename t.cr //source/targa.c
    endif
  else
    echo "missing file: //source/targa.c"
  endif

  echo "//source/texture.c"
  if exists //source/texture.c
    protect //source/texture.c +rd
    ceol <//source/texture.c >t.cr
    if exists t.cr
      delete //source/texture.c quiet
      rename t.cr //source/texture.c
    endif
  else
    echo "missing file: //source/texture.c"
  endif

  echo "//source/texture.h"
  if exists //source/texture.h
    protect //source/texture.h +rd
    ceol <//source/texture.h >t.cr
    if exists t.cr
      delete //source/texture.h quiet
      rename t.cr //source/texture.h
    endif
  else
    echo "missing file: //source/texture.h"
  endif

  echo "//source/tokenize.c"
  if exists //source/tokenize.c
    protect //source/tokenize.c +rd
    ceol <//source/tokenize.c >t.cr
    if exists t.cr
      delete //source/tokenize.c quiet
      rename t.cr //source/tokenize.c
    endif
  else
    echo "missing file: //source/tokenize.c"
  endif

  echo "//source/triangle.c"
  if exists //source/triangle.c
    protect //source/triangle.c +rd
    ceol <//source/triangle.c >t.cr
    if exists t.cr
      delete //source/triangle.c quiet
      rename t.cr //source/triangle.c
    endif
  else
    echo "missing file: //source/triangle.c"
  endif

  echo "//source/txttest.c"
  if exists //source/txttest.c
    protect //source/txttest.c +rd
    ceol <//source/txttest.c >t.cr
    if exists t.cr
      delete //source/txttest.c quiet
      rename t.cr //source/txttest.c
    endif
  else
    echo "missing file: //source/txttest.c"
  endif

  echo "//source/vect.c"
  if exists //source/vect.c
    protect //source/vect.c +rd
    ceol <//source/vect.c >t.cr
    if exists t.cr
      delete //source/vect.c quiet
      rename t.cr //source/vect.c
    endif
  else
    echo "missing file: //source/vect.c"
  endif

  echo "//source/vector.h"
  if exists //source/vector.h
    protect //source/vector.h +rd
    ceol <//source/vector.h >t.cr
    if exists t.cr
      delete //source/vector.h quiet
      rename t.cr //source/vector.h
    endif
  else
    echo "missing file: //source/vector.h"
  endif

endif
