English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] ocamldsort 0.1 release
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-02 (18:28)
From: Dimitri Ara <dimitri@n...>
Subject: [Caml-list] ocamldsort 0.1 release

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:

PPFLAGS=-pp camlp4o
SORTED_ML_FILES=$(shell cat .depsort >/dev/null || echo ERROR)

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

	@echo Did you run \`make 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