[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rules file and build directory



On Wed, Jul 15, 2015 at 11:04:38AM +0200, gregor herrmann wrote:
> On Wed, 15 Jul 2015 10:52:07 +0200, Eugen Wintersberger wrote:
> 
> > override_du_auto_test:
> > 	cd <BUILDDIR> && make my_super_test
> > 
> > My original question was: where do I get BUILDDIR from? For instance,
> > when you use cmake the build directory (relative to the location where
> > the rules file is running) is obj-x86_64-linux-gnu. I learned this from
> > the output of the build process. However, this obviously depends on the
> > architecture. What I would like to have is a procedure which retrieves
> > me this information.
> 
> Maybe dpkg-architecture can help here:
> 
> % dpkg-architecture | grep GNU_TYPE
> DEB_BUILD_GNU_TYPE=x86_64-linux-gnu
> DEB_HOST_GNU_TYPE=x86_64-linux-gnu
> DEB_TARGET_GNU_TYPE=x86_64-linux-gnu
> 
> Looks very much like your BUILDDIR. And can be queried (not sure
> which of the 3 variables) like:
> 
> % dpkg-architecture -qDEB_BUILD_GNU_TYPE
> x86_64-linux-gnu

I am sorry to tell you that using DEB_BUILD_GNU_TYPE most likely is
wrong here. "build" refers to the architecture you are building on, but
most commonly the build directory refers to the architecture you are
building for, which is be called the host architecture. (GNU
terminology, not braindead Mozilla terminology)

Now in native builds the build and host (and target) architecture are
always the same (by definition of "native"), so you wouldn't note the
difference, but cross builders will be less annoyed if you use
DEB_HOST_GNU_TYPE here.

Unless you are working on compilers (e.g. binutils, gcc, clang, ...),
please do not use the target architecture. It doesn't have a meaning for
non-compilers.

See https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html. Getting
used to the terms "build", "host" and "target" can take some time, at
least for me.

Helmut


Reply to: