[Top][All Lists]

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

[bug #20502] Allow attaching target-specific variables to implicit rules

From: Matt McCutchen
Subject: [bug #20502] Allow attaching target-specific variables to implicit rules
Date: Tue, 17 Jul 2007 05:03:32 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20070603 Fedora/ Firefox/


                 Summary: Allow attaching target-specific variables to
implicit rules
                 Project: make
            Submitted by: hashproduct
            Submitted on: Tuesday 07/17/2007 at 05:03
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.81
        Operating System: POSIX-Based
           Fixed Release: None



I'm using GNU make 3.81 on Fedora Core 7 Linux.

Suppose I have some documentation files, some of which use a hash symbol to
mark comments and some of which use a double slash; a file's extension (.hc
or .ssc) tells what format it's in.  I want to generate comment-free versions
of all the files.  Here's the makefile:

UNCOMMENT = grep -v '^$(commentsymbol)'

all: foo.txt bar.txt
# foo.hc and bar.ssc exist

%.txt: %.hc
        $(UNCOMMENT) $< -o $@

%.txt: %.ssc
        $(UNCOMMENT) $< -o $@

I want to associate a target-specific variable definition for
$(commentsymbol) with each implicit rule so that a target's $(commentsymbol)
will be correct based on which rule was chosen to build it.  Make will let me
attach definitions to the target pattern %.txt, but that's no good because I
can't get make to use one definition for the first rule and a different
definition for the second.  Make should provide a way for me attach a
definition to an implicit rule.  Since only one implicit rule can exist with
a given target pattern and a given set of prerequisite patterns, attaching
the definition to those patterns comes to the same.  The syntax could be
something like this:

%.txt: %.hc: commentsymbol = \#
%.txt: %.ssc: commentsymbol = //


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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