caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* OCaml makefile template comments
@ 1999-11-24 10:12 David Mentré
  1999-11-24 20:49 ` Markus Mottl
  2000-01-09  0:22 ` Porting OCaml to A Custom OS Ravi Chamarty
  0 siblings, 2 replies; 6+ messages in thread
From: David Mentré @ 1999-11-24 10:12 UTC (permalink / raw)
  To: caml-list

I've used the generic OCaml Makfile (at:
http://caml.inria.fr/FAQ/Makefile_ocaml.tpl) and I have 2 comments:

 1. target $(EXEC).opt

$(EXEC).opt: $(OPTOBJS)
        $(CAMLOPT) -o $(EXEC) $(LIBS:.cma=.cmxa) $(OPTOBJS)
                      ^^^^^^I think it is $(EXEC).opt here, no?

 2. Makefile with subdirectories. This makefile is not made to allow
    subdirectories. I've managed to use it for a subdir by adding a '-I
    subdir' option to $(CAMLC) and $(CAMLOPT) and modifying targets
    depend:, .depend: (to add -I option) and clean:.

    Does anybody know a good makefile model to compile in subdirs
    (without recursive makefile) for OCaml?


Best regards,
david
-- 
 David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/
 Opinions expressed here are only mine.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: OCaml makefile template comments
  1999-11-24 10:12 OCaml makefile template comments David Mentré
@ 1999-11-24 20:49 ` Markus Mottl
  1999-11-25 12:38   ` Recursive Makefile (was: Re: OCaml makefile template comments) David Mentré
  2000-01-09  0:22 ` Porting OCaml to A Custom OS Ravi Chamarty
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Mottl @ 1999-11-24 20:49 UTC (permalink / raw)
  To: David Mentré; +Cc: OCAML

>     Does anybody know a good makefile model to compile in subdirs
>     (without recursive makefile) for OCaml?

Is there a particular reason for objecting to recursive makefiles?
Actually, projects that are spread over several directories have always
been a bit awkward to handle with the traditional "make". The easiest
solution is in most cases to have a specialized makefile in each directory,
which possibly makes use of some "meta-makefile".

I am not sure whether you have tried "OcamlMakefile" before (it strongly
relies on recursive invocation), but it has so far been appropriate for
just about any project I have undertaken. In general, the specialized
makefiles only require a few (=5-10) lines of code.

Here an example from the distribution:

---------------------------------------------------------------------------
  OCAMLMAKEFILE = ../OcamlMakefile

  SOURCES = test_impl.c test.idl parser.mly lexer.mll calc.ml
  RESULT  = calc
  THREADS = yes

  -include $(OCAMLMAKEFILE)
---------------------------------------------------------------------------

For more infos, see:
  http://miss.wu-wien.ac.at/~mottl/ocaml_sources/intro.html

Regards,
Markus

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Recursive Makefile (was: Re: OCaml makefile template comments)
  1999-11-24 20:49 ` Markus Mottl
@ 1999-11-25 12:38   ` David Mentré
  0 siblings, 0 replies; 6+ messages in thread
From: David Mentré @ 1999-11-25 12:38 UTC (permalink / raw)
  To: Markus Mottl; +Cc: OCAML

Markus Mottl <mottl@miss.wu-wien.ac.at> writes:

> Is there a particular reason for objecting to recursive makefiles?

<religious-war>

I think you should read:
  Recursive Make Considered Harmful (Peter Miller)
   http://www.canb.auug.org.au/~millerp/rmch/recu-make-cons-harm.html

and *make your own opinion*. I've made mine.

</religious-war>


Anyway, thanks for your pointer. I'll take a look at it.

Best regards,
d.
-- 
 David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/
 Opinions expressed here are only mine.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Porting OCaml to A Custom OS
  1999-11-24 10:12 OCaml makefile template comments David Mentré
  1999-11-24 20:49 ` Markus Mottl
@ 2000-01-09  0:22 ` Ravi Chamarty
  2000-01-10 13:14   ` Xavier Leroy
  1 sibling, 1 reply; 6+ messages in thread
From: Ravi Chamarty @ 2000-01-09  0:22 UTC (permalink / raw)
  To: caml-list

Hi, 
 I am trying to port OCaml to a custom operating system which is tailored
to my needs. I wish to know what things to be taken care of. I would be
specifically interested to know which parts of the code I may be required
to modify? 
  What are the interfaces OCaml uses to talk with the OS ?

Thanks,
Ravi 

----------------------------------------------------------
Ravi S Chamarty                   E-mail: ravi@ittc.ukans.edu
Graduate Research Assistant,       Voice :785-864-7799 
ITTC,2291 Irving Hill Road,                
University of Kansas,
Lawrence KS 66044-7541




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Porting OCaml to A Custom OS
  2000-01-09  0:22 ` Porting OCaml to A Custom OS Ravi Chamarty
@ 2000-01-10 13:14   ` Xavier Leroy
  0 siblings, 0 replies; 6+ messages in thread
From: Xavier Leroy @ 2000-01-10 13:14 UTC (permalink / raw)
  To: Ravi Chamarty, caml-list

> Hi, 
>  I am trying to port OCaml to a custom operating system which is tailored
> to my needs. I wish to know what things to be taken care of. I would be
> specifically interested to know which parts of the code I may be required
> to modify? 
>   What are the interfaces OCaml uses to talk with the OS ?

The core runtime system uses essentially ANSI C plus a little bit of POSIX
(file descriptors, open/read/write/lseek/close).  In particular, all
memory is allocated using malloc().

Some of the external libraries are more OS-dependent.  For instance,
the "Unix" library relies heavily on POSIX, although a partial port to
Win32 is also available.

If you have more specific questions, feel free to ask us (caml@inria.fr)
directly.

- Xavier Leroy




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Porting OCaml to a Custom OS
       [not found] <Pine.LNX.4.10.10002231549560.5472-100000@george.ittc.ukans.edu>
@ 2000-02-25 14:05 ` Xavier Leroy
  0 siblings, 0 replies; 6+ messages in thread
From: Xavier Leroy @ 2000-02-25 14:05 UTC (permalink / raw)
  To: Ravi Chamarty, caml

>   I am trying to port ocaml to a custom operating system made using Oskit. I
> have got *ocamlrun* and *ocamlyacc* ported to it. I compiled these on
> Linux 2.2.13 on Redhat 6.0. I forced these tools to be built by using
> 'gcc' with the -nostdinc and -nostdlib so that it only uses the libraries
> and include files I want.  

Sounds good.

>  OSkit presently resides on Linux as a set of libraries and device
> drivers. It has no filesystem .I can boot images of executables which can
> then be loaded as a kernel . 
>   In the case of ocaml, I cannot compile .ml files at this stage since
> they will not run on Linux. How do i force it to compile  .ml files ?

You'll need to cross-compile.  That is, install a regular OCaml on
your Linux development machine and use it to generate bytecode
executables.  Then, hopefully, you should be able to transfer those
bytecode executables to the OSkit memory and execute them from there
using your modified ocamlrun.

- Xavier Leroy



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-02-25 17:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-24 10:12 OCaml makefile template comments David Mentré
1999-11-24 20:49 ` Markus Mottl
1999-11-25 12:38   ` Recursive Makefile (was: Re: OCaml makefile template comments) David Mentré
2000-01-09  0:22 ` Porting OCaml to A Custom OS Ravi Chamarty
2000-01-10 13:14   ` Xavier Leroy
     [not found] <Pine.LNX.4.10.10002231549560.5472-100000@george.ittc.ukans.edu>
2000-02-25 14:05 ` Porting OCaml to a " Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).