automake
[Top][All Lists]
Advanced

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

source files in subdirs and VPATH build


From: Guillaume Rousse
Subject: source files in subdirs and VPATH build
Date: Wed, 10 Jan 2007 11:56:09 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20070105)

Hello.

My source tree is something as
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)

Howevever it breaks VPATH build for object files in subdirectories, as
it tries to output a file in a non-existing build subdirectory...

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

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
MYSOURCEFILES = foo1.ml foo2.ml subdir/foo3.ml subdir/foo4.ml
MYOBJECTFILES = $(notdir $(MYSOURCEFILES))

I don't really care if VPATH build is GNU-make specific, but I have to
ensure standard build is portable however.




reply via email to

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