DEFINITION MODULE MakeForest;
  (*
   * MAKEMAKE.  Create a MAKEFILE for a MODULA-2 program.
   *
   * Written by Steve Tynor, 30 September 1986.
   *            UUCP  : tynor@gitpyr
   *            USNAIL: 2550 Akers Mill Rd. T-2, Atlanta GA. 30339
   *
   * Permission is granted to distribute, copy and change this program as long
   * as this notice remains...
   ---
   *
   * Make.
   * Modified and extended for MacMETH by :
   * J?rgen N?rgaard, 23 october 1987.
   *            UUCP  : jnp@daimi.dk
   *            MAIL  : Dybb?lvej 29, v?r. 2+3, 8240 Risskov, DENMARK
   *
   * Essentially only the parser remains from the original.
   * Extensions are a dependency-tree and a make-like facility.
   *
   *)
  
IMPORT System;
IMPORT FileSystem;

TYPE
  NameString = ARRAY[0..60] OF CHAR;  (* Total filename length is 64 - '.EXT' *)
  DepList = POINTER TO DepListEntity;
  DepTree = DepList;
  EntityPtr = POINTER TO DepEntity;
  DepEntity = RECORD
                moduleName : NameString;
                defName,
                impName    : System.Path;
                seen,
                checked,
                library    : BOOLEAN;
                date       : LONGINT;
                DEFDepends,
                MODDepends : DepTree;
              END;
              
  DepListEntity = RECORD
                    next   : DepList;
                    actual : EntityPtr;
                  END;

VAR
  root : DepTree;
                  
  (*----------------------------------------------------------------------*)
  PROCEDURE AddModule (VAR name : NameString;
                       VAR dp : DepTree;
                       VAR de : EntityPtr) : BOOLEAN;
    (* returns TRUE if file added, FALSE if the file was already there, and a
       POINTER to a new entity *)
    (*----------------------------------------------------------------------*)
  
  PROCEDURE RemoveTree(VAR dp : DepTree);
  
    (*----------------------------------------------------------------------*)
  PROCEDURE Make(dp : DepTree; VAR fd : FileSystem.File);
  
END MakeForest.
