caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dimitri Ara <dimitri@nerim.net>
To: OCaml <caml-list@inria.fr>
Subject: [Caml-list] ocamldsort 0.1 release
Date: 02 Aug 2002 20:28:00 +0200	[thread overview]
Message-ID: <873ctxundb.fsf@corwin.mutu.net> (raw)

        Hi,

ocamldsort (dsort stands for dependency sorting) is a tiny command line 
tool to sort .ml files according to their dependencies in order
to link the corresponding .cmo files.

ocamldsort was thought to be used in makefiles. Here is a typical makefile:

OCAMLC=ocamlc
OCAMLDEP=ocamldep
OCAMLDSORT=ocamldsort
PPFLAGS=-pp camlp4o
SORTED_ML_FILES=$(shell cat .depsort >/dev/null || echo ERROR)
CMO_FILES=$(SORTED_ML_FILES:.ml=.cmo)

a.out: $(CMO_FILES)
	$(OCAMLC) ...	

ERROR:
	@echo Did you run \`make depend\'?
	@false

depend:
	$(OCAMLDEP) $(PPFLAGS) *.ml *.mli > .depend
	< .depend $(OCAMLDSORT) *.ml *.mli > .depsort

In fact, ocamldep doesn't need any .depend. It can be used this way:

$ ocamldsort -pp camlp4o *.ml *.mli > .depsort

Beware: if your program relies on linking order because of side effects,
ocamldsort can't help you.

You can download it at http://dimitri.mutu.net/ocaml.html

-- 
Dimitri Ara
-------------------
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


                 reply	other threads:[~2002-08-02 18:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873ctxundb.fsf@corwin.mutu.net \
    --to=dimitri@nerim.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).