bugmake - Bugs: bug #8308, Request for the addition of...

 
 

bug #8308: Request for the addition of "elseif" to make nested if's more maintainable.

Submitted by:  None
Submitted on:  Fri 26 Mar 2004 06:55:51 AM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.80Operating System: Any
Fixed Release: 3.81Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 25 Jun 2005 06:53:40 PM UTC, comment #1:

The next version of GNU make allows you to place another conditional on the same line as an "else" statement, without increasing the depth of the conditional (so you don't need an extra endif in that case):

ifdef (....)
...
else ifeq (....)
...
else
...
endif

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Fri 26 Mar 2004 06:55:51 AM UTC, original submission:

The conditionals used by make are very useful but can be difficult to work with where a variable might have a number of values.

Usually, this means you can be left with:

ifeq (0,$(FRED))
FRED_PROCESS=$(call xxx,xxx)
then
ifeq (1,$(FRED))
FRED_PROCESS=$(call yyy,yyy)
then
ifeq (2,$(FRED))
FRED_PROCESS=$(call zzz,zzz)
then
$(error FRED is not a value value.)
endif
endif
endif

This is quite difficult to maintain in some instants where the range of values for FRED is large.

Discussion on the help-make mailing list suggested that a good compromise which was low cost was to add "elseif" or equivalent functionality.

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 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 01 Apr 2006 07:10:24 AM UTCpsmithFixed Release4.0=>3.81
Sat 25 Jun 2005 06:53:40 PM UTCpsmithStatusNone=>Fixed
  Assigned toNone=>psmith
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.0

Back to the top


Powered by Savane 3.1-cleanup1