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.