bugmake - Bugs: bug #13008, ifeq cannot compare automatic...

 
 

bug #13008: ifeq cannot compare automatic variables

Submitted by:  None
Submitted on:  Sat 07 May 2005 09:01:52 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.80Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 07 May 2005 11:39:35 AM UTC, comment #1:

Correct. According to the GNU make documentation, automatic variables are only available WITHIN the command script context. Preprocessor statements like ifeq are parsed as the makefile is being read in; at that time no automatic variables are set. Please see the GNU make manual section "How make Reads a Makefile" for more information on this.

If you want to work with automatic variables you need to use shell conditionals not make conditionals, and make them part of the command script; for example:

.c.o:
@if [ "$<" = hello.c ]; then \
echo hello; \
else \
echo not hello; \
fi

Paul D. Smith <psmith>
Project Administrator
Sat 07 May 2005 09:01:52 AM UTC, original submission:

Follow case.

.c.o:

ifeq ($<,hello.c)
@echo hello
else
@echo not hello
endif

This rule always output "not hello".

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 07 May 2005 11:39:35 AM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1