[Omake] Compiling files in different directories
Aleksey Nogin
anogin at hrl.com
Wed May 30 09:11:29 PDT 2007
On 30.05.2007 07:41, Hugo Ferreira wrote:
> The set-up you show is basically what I have. Unfortunately the "camlp4"
> project is set-up to create a test "application" by default and library.
> My "resolv" project also has the same set-up. Both these projects
> share certain targets (libraries of other projects). I have therefore
> two problems:
>
> 1. Avoiding an error from omake complaining about multiple ways to
> build targets.
>
> 2. Use only certain source files files from "camlp4" project.
>
> From your example I think my real problem is (1). I cannot seem to find
> a way to mix and match source files because the default target of the
> sub-projects use shared targets.
Hugo,
There are many ways of eliminating the most obvious problems (such as
the problem (1) above) by doing things like using .SUBDIRS directives
with a body (the body then is used in place of the subdir's OMakefile).
Alternatively, you can move the conflicting stuff from camlp4/OMakefile
to camlp4/OMakeroot (or just define "CAMLP4_STANDALONE=true" in
camlp4/OMakeroot, CAMLP4_STANDALONE=false in resolv/OMakefile and then
in camlp4/OMakefile simply test for $(STANDALONE) before defining common
targets).
Also, if the camlp4 project already defines the common targets and the
resolv project includes the camlp4 directory, why not just drop a
separate definition of the common targets from the resolv project?
Note, however, you will not be able to eliminate the basic issue of each
project having a separate build database. Because of that, actions made
by omake in one project will not be known by omake running for the other
project, so the other omake instance will not consider the file
up-to-date (omake does not consider a file to be up-to-date, unless it
knows that it have built the file before).
Is there some reason why you can not just create a single _shared_
project? Note that when you run omake (without arguments) from a
subdirectory, then by default it only builds the "local" .DEFAULT, not
the global one, so you can still set things up so that it builds the
right subset of targets when you run it from a subdirectory.
Aleksey
--
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA
More information about the Omake
mailing list