% Copyright (C) 1994, Digital Equipment Corporation
% All rights reserved.
% See the file COPYRIGHT for a full description.
%
% Last modified on Wed Apr  5 17:12:45 PDT 1995 by mhb   
%      modified on Fri Sep 16 13:44:30 PDT 1994 by bharat
%      modified on Wed Mar 23 14:11:53 1994 by luca

readonly use_path = TRUE

import ("libm3")

resource ("volib.obl")
resource ("vorestrict.obl")
resource ("templates.obl")
resource ("vowidgets.obl")
resource ("vocheckpt.obl")

bundle ("VORunBundle")

import("obliqlibm3")
import("obliqlibui")
import("obliq")
implementation("Main")

if equal (OS_TYPE, "POSIX")

  program("vorun")

  %
  % create vostart
  %
  if defined ("_all")
    local script = path_of ("vostart")
    if stale ("vostart", script)
      % build a version of vostart bound to the current /bin directory
      > "vostart" in  write ("#! ", BIN_USE, SL & "vorun -r", CR)  end
      exec ("cat ", script, " >> vostart")
      exec ("chmod +x vostart")
    end
    deriveds ("vostart", [])
  end
  % BindExport ("vostart")

else

  if use_path 
    Program("vorun")
    %export_program ("vorun") % documented but does not exist
    BinExport ("vostart")
    BindExport ("vostart.cmd")
  else
    program("vorun")
    deriveds ("vostart", [])
    deriveds ("vostart.cmd", [])
    install_derived ("..\\src\\vostart") % This isn't derived, but it gets it to the pkg\target directory.
    install_derived ("vostart.cmd")
  end
  %
  % create vostart
  %
  > "vostart.cmd" in
    %
    % vostart, vostart.cmd, and vorun.exe all three colocated in the same directory
    % e.g.: C:\cm3\pkg\vorun\NT386 or c:\cm3\bin.
    %
    write("@%~dp0vorun %~dp0vostart", CR)
  end
end
