[ovs-dev] [PATCH v3 3/6] makefile: create destdir when generating files
Aaron Conole
aconole at redhat.com
Wed Aug 2 21:25:36 UTC 2017
Ben Pfaff <blp at ovn.org> writes:
> On Tue, Aug 01, 2017 at 06:05:40PM -0400, Aaron Conole wrote:
>> When intermediary files are generated, the destination directory is assumed
>> to exist. This has worked so far because most files are built prior to
>> the dist-packaging step. However, any files which require rebuild after
>> the packaging step may end up in failure if the output directory is not
>> available. This commit adds a 'mkdir -p' before generating the output files.
>>
>> Signed-off-by: Aaron Conole <aconole at redhat.com>
>
> Thanks for working on the makefiles.
>
> What's an example of a file for which this makes a difference? I'm
> having trouble understanding when this helps.
Thanks for reviewing, Ben!
The next patch in the series adds an example of this. I should have put
that into the commit message as well.
I'll go over the effect I observed, and maybe there's a better way to do
it:
1. I added a 'preprocessor' to be able to have dpdk vs. non-dpdk
functionality in generated files (ex: the vswitchd service file)
2. I execute `./configure --with-dpdk` and observe that the correct
lines are included. So far so good.
3. I completely clean the tree, and do a `./configure` without
specifying dpdk. The lines are not included, and still so far so
good.
4. I use the resulting distribution (made with make dist) to build,
doing `./configure --with-dpdk`. Now, I would think the file should
have the correct lines included, but it does not.
To resolve this, I tried adding the generated file as BUILT_SOURCES, but
experienced errors when doing a `make distcheck`, since the $(srcdir)
directory is read only. So, I implemented the approach where I added
$(builddir)/config.status which would behave as I expect, but for the
fact that the sed will do a redirect into a subdirectory that isn't
created.
I'm sure a better way could exist, but I don't know it.
I guess that's a long-winded (apologies) way of saying there are
currently no examples in tree - this commit adds one.
More information about the dev
mailing list