[Omake] Changing OCAMLPACKS in a section fails

Renald Buter buter at cwts.leidenuniv.nl
Wed Feb 14 23:13:42 PST 2007


On Thursday 15 February 2007, Aleksey Nogin wrote:
Thanks again, Aleksey. It now works beautifully.

> Ah, I see.
>
> Note that OCamlProgram only specifies the _linking_ step, not the
> compilation step (it has to be that way, otherwise we'd end with
> incompatible specifications where in the above example the compilation
> of main_target would be specified to both use and not use oUnit).
>

I see. Since I have quite a java background and worked extensively with ant, 
with its extensive use of sections, my neurons were probably wrongly prewired 
for coming back to make-like building specification...

> By default, the compilation for OCaml files is done via implicit rules
> and, again by default, implicit rules are instantiated using the values
> at the _end_ of the corresponding OMakefile (more precisely - at the end
> of the corresponding .SUBDIRS body).
>
> If you want to force instantiation of implicit rules for a target to be
> "pinned" to a specific variable scope, you need to specify an empty
> dependency for it. E.g:
>
> section
> 	PROGRAM = main_target_test
> 	FILES = main_target main_target_test
> 	OCAMLPACKS = oUnit
>          $(addprefix main_target_test, .cmx .cmi $(EXT_OBJ)):
> 	.DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))

Ah.

I think I need to go read the paper, now...:)

Now, given the fact that the thing I do here is, seemingly, far from default, 
do you (or anybody else on this list), have any suggestion on how to specify 
this more properly? That is: specifying the compilation and linking of a 
target and its unit test in the same OMakefile?

Thanks for all the help!

Renald

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



More information about the Omake mailing list