#########################################################################
#                                                                       #
#                            Objective Caml                             #
#                                                                       #
#            Damien Doligez, projet Para, INRIA Rocquencourt            #
#                                                                       #
#   Copyright 1999 Institut National de Recherche en Informatique et    #
#   en Automatique.  All rights reserved.  This file is distributed     #
#   under the terms of the GNU Library General Public License, with     #
#   the special exception on linking described in file ../LICENSE.      #
#                                                                       #
#########################################################################

# $Id$

RUNTIME = ::boot:ocamlrun
COMPILER = ::ocamlc
CAMLC = {RUNTIME} {COMPILER}
CAMLDEP = ::boot:ocamlrun ::tools:ocamldep

OBJS = pervasives.cmo array.cmo list.cmo char.cmo string.cmo sys.cmo �
  hashtbl.cmo sort.cmo marshal.cmo obj.cmo �
  lexing.cmo parsing.cmo �
  set.cmo map.cmo stack.cmo queue.cmo stream.cmo �
  buffer.cmo printf.cmo format.cmo arg.cmo printexc.cmo gc.cmo �
  digest.cmo random.cmo oo.cmo camlInternal.cmo �
  genlex.cmo callback.cmo weak.cmo �
  lazy.cmo filename.cmo int32.cmo int64.cmo nativeint.cmo complex.cmo

all � stdlib.cma std_exit.cmo camlheader camlheader_ur

install �
    duplicate -y stdlib.cma std_exit.cmo �.cmi �.mli camlheader camlheader_ur �
              "{LIBDIR}"

stdlib.cma � {OBJS}
    {CAMLC} -a -o stdlib.cma {OBJS}

camlheader �
    begin
      quote -n "ocamlrun"; echo ' "{command}" {"Parameters"}'
      echo 'exit {status}'
      echo
    end > camlheader

camlheader_ur �
    echo -n ' ' > camlheader_ur

clean ��
    delete -i camlheader camlheader_ur

pervasives.cmi � pervasives.mli
    {CAMLC} {COMPFLAGS} -nopervasives -c pervasives.mli

pervasives.cmo � pervasives.ml
    {CAMLC} {COMPFLAGS} -nopervasives -c pervasives.ml

# camlinternalOO.cmi must be compiled with -nopervasives for applets
camlinternalOO.cmi � camlinternalOO.mli
    {CAMLC} {COMPFLAGS} -nopervasives -c camlinternalOO.mli

.cmi � .mli
    {CAMLC} {COMPFLAGS} -c {default}.mli

.cmo � .ml
    {CAMLC} {COMPFLAGS} -c {default}.ml

{OBJS} std_exit.cmo � pervasives.cmi

clean ��
    delete -i �.cm[aio] || set status 0

depend �
    {CAMLDEP} �.mli �.ml > Makefile.Mac.depend