caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Automake support for OCaml
@ 2003-12-22  7:48 Tom Murray
  2003-12-22 10:36 ` Stefano Zacchiroli
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Murray @ 2003-12-22  7:48 UTC (permalink / raw)
  To: caml-announce

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

Bonjour--

I've been working on a patch to automake to support packages with Caml 
code.

Current features include compilation of programs and libraries, 
possibly with mixed Caml and C code, automatic dependency generation, 
and both bytecode and native code compilation. To get an idea, here is 
a sample Makefile.am:

CAML_INCLUDES = -I ../ -pp "camlp4o pa_extend.cmo"
CAML_LDADD    = unix.cma

bin_MLPROGRAMS = myprog
lib_MLLIBRARIES = mylib.cma

myprog_SOURCES = myprog.mli myprog.ml myprog_c.c

mylib_cma_SOURCES = mylib1.ml mylib2.ml
mylib_cma_LIBADD  = otherlib.cma

This defines a program and a library to be built. Typing "make all" 
will build myprog and mylib.cma. Typing "make opt" will build 
myprog.opt and mylib.cmxa. The CAML_INCLUDES variable applies the -I 
flag and an invocation of Camlp4 to all targets. The CAML_LDADD links 
in unix.cma with bytecode targets, unix.cmxa with native code. Also 
note that myprog includes an interface file myprog.mli that is compiled 
to myprog.cmi, but of course excluded from the link. The mylib.cma 
library also links in otherlib.cma (or otherlib.cmxa).

The main things left to do are:
* install support (I plan to use ocamlfind)
* m4 macros to ease searching for Caml libraries on the system
* support for more tools such as ocamllex/ocamlyacc (you _can_ do this 
manually now, of course)
* improved integration with C

A little page and download are at 
http://www.lemurz.org/projects/autocaml/

Your comments and suggestions are appreciated.

Enjoy!

tm

[-- Attachment #2: Type: text/enriched, Size: 1572 bytes --]

Bonjour--


I've been working on a patch to automake to support packages with Caml
code.


Current features include compilation of programs and libraries,
possibly with mixed Caml and C code, automatic dependency generation,
and both bytecode and native code compilation. To get an idea, here is
a sample Makefile.am:


<fontfamily><param>Courier</param>CAML_INCLUDES = -I ../ -pp "camlp4o
pa_extend.cmo"

CAML_LDADD    = unix.cma


bin_MLPROGRAMS = myprog

lib_MLLIBRARIES = mylib.cma


myprog_SOURCES = myprog.mli myprog.ml myprog_c.c


mylib_cma_SOURCES = mylib1.ml mylib2.ml

mylib_cma_LIBADD  = otherlib.cma 


</fontfamily>This defines a program and a library to be built. Typing
"make all" will build myprog and mylib.cma. Typing "make opt" will
build myprog.opt and mylib.cmxa. The CAML_INCLUDES variable applies
the -I flag and an invocation of Camlp4 to all targets. The CAML_LDADD
links in unix.cma with bytecode targets, unix.cmxa with native code.
Also note that myprog includes an interface file myprog.mli that is
compiled to myprog.cmi, but of course excluded from the link. The
mylib.cma library also links in otherlib.cma (or otherlib.cmxa).


The main things left to do are:

* install support (I plan to use ocamlfind)

* m4 macros to ease searching for Caml libraries on the system

* support for more tools such as ocamllex/ocamlyacc (you _can_ do this
manually now, of course)

* improved integration with C


A little page and download are at
http://www.lemurz.org/projects/autocaml/


Your comments and suggestions are appreciated.


Enjoy!


tm


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

* Re: [Caml-list] Automake support for OCaml
  2003-12-22  7:48 [Caml-list] Automake support for OCaml Tom Murray
@ 2003-12-22 10:36 ` Stefano Zacchiroli
  2003-12-22 17:43   ` Tom Murray
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Zacchiroli @ 2003-12-22 10:36 UTC (permalink / raw)
  To: Tom Murray; +Cc: Inria Ocaml Mailing List

On Sun, Dec 21, 2003 at 11:48:10PM -0800, Tom Murray wrote:
> CAML_LDADD    = unix.cma 
<snip>
> Your comments and suggestions are appreciated. 

You plan to use ocamlfind only at install time, right? Why not
supporting it also at compile time? I'm thinking about something like:

CAML_PACKAGES = unix pcre

Surely you can do the same using yours CAML_LDADD in conjunction with
"ocamlfind query", but it will be harder to use and less intuitive.

It shouldn't be a major change, should it?

Thanks for your work
from an ocaml user that
has fought a lot with
automake in the past :-(

-- 
^Stefano Zacchiroli -- Master in Computer Science @ Uni. Bologna, Italy$
^zack@{cs.unibo.it,debian.org,bononia.it} -- http://www.bononia.it/zack$
^Frequentando il mio maestro mi ero reso conto [.] che la logica poteva$
^servire a molto a condizione di entrarci dentro e poi di uscirne -Adso$

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] Automake support for OCaml
  2003-12-22 10:36 ` Stefano Zacchiroli
@ 2003-12-22 17:43   ` Tom Murray
  2003-12-22 18:25     ` skaller
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Murray @ 2003-12-22 17:43 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: Inria Ocaml Mailing List

> You plan to use ocamlfind only at install time, right? Why not
> supporting it also at compile time? I'm thinking about something like:

I hadn't fully thought about it, but you're right that I should use it 
at compile and link time, tool.


> CAML_PACKAGES = unix pcre
>
> Surely you can do the same using yours CAML_LDADD in conjunction with
> "ocamlfind query", but it will be harder to use and less intuitive.

_PACKAGES sounds good. I'll add it on a per-makefile and per-target 
basis.


> It shouldn't be a major change, should it?

No, and you're making me think I should just tackle the install stuff, 
too and get it over with. I do want to make things work without 
ocamlfind, too, though.


> Thanks for your work
> from an ocaml user that
> has fought a lot with
> automake in the past :-(

Yes, so many times I want to abandon the autotools for their messiness, 
but they always turn out to be _so_ convenient. I have yet to see a 
make replacement that is as flexible.

Cheers,

tm

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] Automake support for OCaml
  2003-12-22 17:43   ` Tom Murray
@ 2003-12-22 18:25     ` skaller
  0 siblings, 0 replies; 4+ messages in thread
From: skaller @ 2003-12-22 18:25 UTC (permalink / raw)
  To: Tom Murray; +Cc: Stefano Zacchiroli, Inria Ocaml Mailing List

On Tue, 2003-12-23 at 04:43, Tom Murray wrote:
> > You plan to use ocamlfind only at install time, right? Why not

> Yes, so many times I want to abandon the autotools for their messiness, 
> but they always turn out to be _so_ convenient. I have yet to see a 
> make replacement that is as flexible.

I have seen, and use regularly, a *much* better and
infinitely superior tool.

Its called Python.


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2003-12-22 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-22  7:48 [Caml-list] Automake support for OCaml Tom Murray
2003-12-22 10:36 ` Stefano Zacchiroli
2003-12-22 17:43   ` Tom Murray
2003-12-22 18:25     ` skaller

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).