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

 
 

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

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

Submitter:  None
Submitted:  Wed 23 Mar 2005 01:03:12 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is 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

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-03-23 palmin Carbon-Copy- Added palmin
2005-03-23 None Carbon-Copy- Added palmin --AT-- gmail --DOT-- com

Back to the top

Powered by Savane 3.14-79a4.
Corresponding source code