Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Apr 2002 11:16:20 -0400
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        "Alex Semenyaka" <alexs@ratmir.ru>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: make(1) command-line variables
Message-ID:  <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca>
References:  <20020413141834.GA16339@snark.ratmir.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
> Dear Colleagues,
>
> I need some help. Consider I have a Makefile for
> application that can be build with different
> options. Some of them I need just to define
> via -D flag of the ``make'', but other need
> to be set to some specific values (for example,
> it can be path to my temporary dir). So I
> use
>
> make -DFIRST MYTMPDIR=/special/tmp
>
> And I want just to keep track of the parameters
> used to build that application. Nothing difficult
> to obtain the name of Makefile from .MAKEFILE, as well
> as make flags of make (including those -D, defining
> some variables) from the .MAKEFLAGS var. But I did
> NOT found the normal way to obtain the list of
> variables defined in the command line through the
> VAR=VAL construction. Strange, right?
>
> Man says that
>
>      .MAKEFLAGS
>                 The environment variable MAKEFLAGS may contain anything
that
>                 may be specified on make's command line.  Its contents are
>                 stored in make's .MAKEFLAGS variable.
>
> That is wrong, .MAKEFLAGS does not contain anything.

It won't contain anything unless you set MAKEFLAGS in the calling
environment.

[ Makefile ]
all:
    @echo "MAKEFLAGS: ${.MAKEFLAGS}"

gabby$ export MAKEFLAGS="-Dfirst -Dsecond"; make
MAKEFLAGS:  -Dfirst -Dsecond
gabby$

--
Matt Emmerton


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001901c1e2fe$2b64c740$1200a8c0>