Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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

Dimitri Ara
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: