Re: [A-A-P-develop] BDIR, was: More than one matching rule?
Brought to you by:
vimboss
From: Bram M. <Br...@mo...> - 2003-01-27 16:04:20
|
George Bronnikov wrote: > > I think the result of a child recipe should not be put in the build > > directory, since it is exported to other recipes. Would it be a problem > > to remove $BDIR in the example you gave? > > Well I assume the whole point of $BDIRs is to separate builds for > different architectures/flag combinations from each other. This concern > is as valid for subdirs as for the main directory. (And no, this is not a > major concern in my specific situation.) If you are building variants or building for different platforms, you could produce the result in the build directory. But the problem then is that you need to find it there. For a program you would usually include the variant or platform in the name of the executable. For example "foo" for the release version and "foo_debug" for the debug version. For intermediate results (e.g., libraries) the choice is not so simple. Including the variant in the file name makes it complicated, expecially if there are several variants. I think we need to leave this up to the user, since it also depends on what you do with the intermediate results (install them or throw them away?). But the default needs to be to use the build directory, since the file names need to be selected by the user. > > I assume you have a recipe "main/one.aap" that has a child > > "main/sub/two.aap" that includes the lines above. Then the $BDIR in > > two.aap is "main/sub/build-something". > > > > The reason for this is that it would be possible to execute "two.aap" > > separately. It would have no knowledge of the "main" directory or any > > build directory in it. > > > > Let's assume the build directory is in the right place. The problem > > then becomes: How can a parent recipe obtain a result of a child recipe? > > When it has been produced in its build directory that is quite > > difficult, since the parent recipe doesn't know what the $BDIR is in the > > child. It's possible to pass back the name of the resulting file to the > > parent recipe. > > OK, if the results of sub/two.aap should remain inside sub/, then it seems > that the most simple and general rule is one mentioned in one of the > previous posts: > > Files produced from sources in dir/ go to dir/$BDIR/. > > Then all get_bdir() needs to do is try and strip BDIR from the last > directory component. That does sound like the simplest solution. I think it should be done by remembering the absolute path for "dir/$BDIR". Thus there will be a list of build directories. Not sure if this always works, a file may be found in several build directories, might need some more clever mechanism (use the $BDIR from the recipe where the build commands are?). > Another idea: do we need BDIR as a directory? Why not put the build > information inside the filename? Do we need to care about systems with > heavy restrictions on filename length? The advantage of using a directory name is that it's impossible that a file with the same name exists. E.g., when compiling "foo.c" to "foo_freebsd.o", there might be a "foo_freebsd.c" as well. -- Light travels faster than sound. This is why some people appear bright until you hear them speak /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html /// |