[Top][All Lists]

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

Variable passing at cmd-line vs in MAKEFLAGS

From: ketil . johnsen
Subject: Variable passing at cmd-line vs in MAKEFLAGS
Date: Tue, 18 Sep 2001 15:49:33 +0200


I belive I have found a bug in GNU make. The problem relates to passing
variables at command line to child make processes. This simple Makefile
demonstrates the problem:


        @echo SRC is $(SRC)
        @echo MAKEFLAGS is $(MAKEFLAGS)
        @make SRC=/new/src win32

        @echo SRC is $(SRC)
        @echo MAKEFLAGS is $(MAKEFLAGS)

My problem only happens when I use the -e option and specify a
the first time I call make;

ex: make -e SRC=/mysrc

As you can see from the Makefile, I try to give the second pass a new value
the SRC variable. This does not happen, as gnu-make looks at the MAKEFLAGS
variable first, finds it there, and totally ignores my attempt to manually
specify the SRC value.

Command line variables should have higher priority than this MAKEFLAGS
This is how the unix-versions of make we otherwise use do it.

I did manage to find a "hack" which is really ugly.... if I set MAKEFLAGS=e
befor I execute make, then the SRC-values will never be stored here. This do
totally ruin the use of MAKEFLAGS, so it is not a good solution.

Some system information:
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for Windows32.
The config.h has no relevant changes (I belive there is no changes from the
original config.w32 at all)
My OS is Windows 2000 with SP2.

Btw: thanx for great free software

Ketil Johnsen, Software Developer
Prof. Brochs gt. 6,  NO-7030 Trondheim,  Norway

reply via email to

[Prev in Thread] Current Thread [Next in Thread]