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
Why does the order in the Makefile matter?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mattias Waldau <mattias.waldau@a...>
Subject: Why does the order in the Makefile matter?
Two runs 'make all', the only difference in the order in the OBJS-line in
the Makefile.

What is the needed order? Should I use the order of .depend?


c:\data\ocaml\stocks\extract>make all
ocamlc -g  -c regexp.mli
ocamlc -g   -c
ocamlc -g   -c
ocamlc -g -o all -custom str.cma unix.cma  extract.cmo source.cmo column.cmo
Error while linking source.cmo: Reference to undefined global `Regexp'
make: *** [all] Error 2

c:\data\ocaml\stocks\extract>make depend
make depend
make all
ocamldep  *.ml *.mli > .depend

c:\data\ocaml\stocks\extract>make all
ocamlc -g -o all -custom str.cma unix.cma  column.cmo regexp.cmo extract.cmo

The only difference made between these two compilations is that I moved
source.cmo last in
the OBJS-row in the Makefile

OBJS=column.cmo regexp.cmo extract.cmo source.cmo

Mattias Waldau