[Top][All Lists]

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

RE: Problem setting a variable inside a target

From: Ed L Wolf
Subject: RE: Problem setting a variable inside a target
Date: Tue, 26 Sep 2023 12:17:51 +0000

Here is the strip down version

            @echo "A2L        $@"
            @find $(DIR_BSWPROJECT) -type f -name "*.a2l" | xargs -i cp {} 

ifneq ($(wildcard $(DIR_SUPPLIER)),)
            @find $(DIR_SUPPLIER) -type f -name "*.a2l" | xargs -i cp {} 
            $(eval SUPPLIER_A2l := $(sort $(shell find $(DIR_A2LGEN_SUPPLIER) 
-type f -name "*.a2l")))
            @echo "A2L        Supplier folder detected"
            @echo "Supplier a2l         $(SUPPLIER_A2l)"
# Just becuase there is a supplier folder does not mean it has a2l files. 
ifeq ($(SUPPLIER_A2l),"*.a2l")
            @echo "A2L        Supplier a2l files found"                       
            @cp $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l 
            @echo "A2L        Supplier folder detected but no a2l files present"
            @cp $(DIR_A2LGEN_SETUP)/McData-copyright-can.a2l 
            @echo "A2L        Supplier folder not available"

Ed L Wolf
Technical Advisor - Embedded Software
Cummins Inc.
Mail Code: C7004
1460 National Road
Columbus, Indiana 47201
United States

-----Original Message-----
From: Bahman Movaqar <bahman@bahmanm.com> 
Sent: Tuesday, September 26, 2023 6:35 AM
To: Ed L Wolf <e.l.wolf@cummins.com>; bug-make@gnu.org
Subject: Re: Problem setting a variable inside a target

EXTERNAL SENDER: This email originated outside of Cummins. Do not click links 
or open attachments unless you verify the sender and know the content is safe.

On Sun, 2023-09-24 at 17:23 +0000, Ed L Wolf wrote:

> ifneq ($(wildcard $(DIR_SUPPLIER)),)
> ...
> > $(eval SUPPLIER_A2l := $(sort $(shell find $(DIR_A2LGEN_SUPPLIER) - 
> > type f -name "*.a2l")))
> ...
> ifeq ($(SUPPLIER_A2l),"*.a2l")

Quickly skimming through your code, I can see that the above `ifneq'
and `ifeq' are evaluated at the very same time/pass.  That means the result of 
`eval' will not be visible to `ifeq'.


PS: I could have tried to come up w/ an alternative approach to laying out the 
code but, I found the snippet crowded w/ too much logic specific to your case 
which makes it hard for me to see the abstract patterns in play.  Can you try 
to slim down the snippet and push it to a public repo somewhere so I can take a 


reply via email to

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