automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: source files in subdirs and VPATH build


From: Ralf Wildenhues
Subject: Re: source files in subdirs and VPATH build
Date: Thu, 11 Jan 2007 00:21:49 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Guillaume,

* Guillaume Rousse wrote on Wed, Jan 10, 2007 at 11:56:09AM CET:
> 
> foo1.ml
> foo2.ml
> subdir/foo3.ml
> subdir/foo4.ml
> etc...
> 
> My current option is to build object files in the same directory as the
> corresponding ource file (actually, it is ocaml compiler defaut
> behaviour). It makes computing object files list quite easy:
> MYSOURCEFILES = foo1.ml foo2.ml subdir/foo3.ml subdir/foo4.ml
> MYOBJECTFILES = $(MYSOURCEFILES:.ml=.cmo)

This is what Automake usually does in the subdir-objects mode.
Without the subdir-objects option, it flattens all file names
(and renames based on conflicts).  Of course, I'm speaking about
the case where Automake does the computation of the object file
names.

> Is there a a way to pre-create all those subdirectories in my build tree
> if they don't pre-exist ?

Yes.  The object handling code in automake.in should take care of all of
that, by depending on the respective .dirstamp files in those
directories.

> Other alternative is to switch compilation model to always output object
> files in local directory, rather as in original source subdirectory.
> Howeverm then I'll have to find a make-portable way to compute a list of
> files from another one by applying a function to each member, as in GNU make

This machinery is all present in automake.in (but not accessible from
outside).  Sorry, I haven't worked on this more yet.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]