tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: NetBSD make: determining a relative OBJDIR?
In article <20180413081040.j6lby3dwqq4srw3r@erebor>,
Joseph Koshy <jkoshy%netbsd.org@localhost> wrote:
>Consider a source tree with sub-directories (A) and (B),
>where the code in directory (B) uses a file that is generated
>by the build steps in directory (A).
>
>For an in-place build, the directory hierarchy might look like:
>
> $(TOP)/
> |
> +-- A/
> | |
> | +- generated-file
> |
> +-- B/
> | |
> | +- uses-generated-file
> etc.
>
>In the event an 'obj' directory is used, the tree might be
>something like:
>
> $(TOP)/
> |
> +-- A/
> | |
> | +- obj/
> | |
> | +- generated-file
> |
> +-- B/
> | |
> | +- uses-generated-file
> etc.
>
>If MAKEOBJDIRPREFIX is used, the obj/ tree could reside
>somewhere else entirely:
>
> $(TOP)/
> |
> +-- A/
> |
> +-- B/
> | |
> | +- uses-generated-file
> etc.
>
> $(MAKEOBJDIRPREFIX)/$(TOP)/
> |
> +-- A/
> | |
> | +- generated-file
> |
> +-- B/
> |
> etc.
>
>What would be the cleanest way to is there a way to determine
>the path to an obj/ directory, given relative locations of
>source directories (A) and (B)?
>
>For the Elftoolchain build I currently use nested conditional
>blocks:
>
> .if exists(${.OBJDIR}/../A)
> # For in-place builds, or when MAKEOBJDIRPREFIX is used.
> .elif exists(${.CURDIR}/../A/${.OBJDIR:S,${.CURDIR}/,,}
> # For builds using an obj/ directory.
> .endif
>
There is BINDPLIBS and LIBDPLIBS. Where is the actual example?
christos
Home |
Main Index |
Thread Index |
Old Index