On 01/25/2017 10:14 AM, Daniel P. Berrange wrote: > If there are generated headers files to be used by the migration > code in '$BUILD_DIR/migration', these will not be found by the > relative include, an absolute include is needed instead. This > has not been a problem so far, since nothing has been generating > headers in sub-dirs, but the trace code will shortly be doing > that. So it is needed to list '-I$(BUILD_DIR)/$(@D)' as well as > '-I$(@D)' to ensure both directories are searched when building > target dependant code. So the search order ends up being: > > 1. source dir corresponding to input file (implicit by compiler) > 2. build dir corresponding to output file (absolute) > 3. build dir corresponding to output file (relative to cwd) > 4. top level build dir > 5. top level source dir > 6. top level source include/ dir
Lots clearer than v3. > > One final complication is that the absolute '-I$(BUILD_DIR)/$(@D)' > will sometimes end up pointing to a non-existant directory if > that sub-dir does not have any target-independant files to be > built. Rather than try to dynamically filter this, a simple > 'mkdir' ensures $(BUILD_DIR)/$(@D) is guaranteed to exist at > all times. > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> > --- > rules.mak | 30 +++++++++++++++++++++++------- > 1 file changed, 23 insertions(+), 7 deletions(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature