helpmake - Support: sr #104033, Additional pattern matchers (%) in...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

sr #104033: Additional pattern matchers (%) in pattern rules

Submitted by:  None
Submitted on:  Wed 23 Mar 2005 01:03:12 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 1 - WishStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Wed 23 Mar 2005 01:03:12 PM UTC, original submission:

I propose the ability to use patterns with several pattern-matching tokens in the pattern rules.

This would enable fewer rules to cover more cases. One example where this might be (slightly) advantageous, is when compiling some files in both debug and non-debug mode. The pattern (%) is normally used to match the part of the file before postfix, and different rules are used for debug and non-debug cases.

%-dbg.o : %.c
gcc -o$@ -DDEBUG $<

%.o : %.c
gcc -o$@ -DNDEBUG $<

But the linking command also needs a command for each case. If it was possible to have two pattern-matching-tokens (% and ‰) a single rule would suffice.

%‰ : %‰.o
gcc -o$@ $<

There are off-course a thousand ways to get around this restriction in practice - especially in this toy example.

But when both the number of versions of targets and the number of source files are large, the ability to have more than one pattern-matching-token per pattern rule, would be a huge improvement. I currently get the work done by using $(foreach), $(patsubst) and $(shell) extensively.

This makes writing and reading the Makefile pretty hard. I believe multiple pattern-matchers would appeal to many people. Especially those having experience with functional languages supporting pattern matching (ML variants or Haskell).

I realize there is no quick fix to make this happen. It would just be a really nice feature.

Best regards,
Anders Borum

Anonymous

 

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
Wed 23 Mar 2005 01:07:18 PM UTCpalminCarbon-Copy-=>Added palmin
Wed 23 Mar 2005 01:03:12 PM UTCNoneCarbon-Copy-=>Added palmin --AT-- gmail --DOT-- com

Back to the top


Powered by Savane 3.1-cleanup