help-make
[Top][All Lists]
Advanced

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

RE: Multiple patterns (or Wildcards) in targets?


From: Nestor Amaya
Subject: RE: Multiple patterns (or Wildcards) in targets?
Date: Wed, 8 Aug 2001 09:39:48 -0400

Thank you all for your help. I won't be banging my head any longer.

Is this perhaps a feature that should be added? It seems both useful and
harmless to me...

I am not familiar with open-source development (I'm a chip designer), so I
don't know what the procedure is for submitting new features (or even if
there is one). Also, I would to join this distribution list, so that I can
perhaps pitch in what I can.

Cheers,

_______________________________________________________
Nestor A. Amaya                     Catena Networks
I.C. Development                    307 Legget Drive
                                    Kanata, ON
voice: (613) 599-6430 x8255         K2K 3C8
  fax: (613) 599-6433


-----Original Message-----
From: Jens Schweikhardt [mailto:address@hidden
Sent: Wednesday, August 08, 2001 2:06 AM
To: Nestor Amaya
Cc: 'address@hidden'
Subject: Re: Multiple patterns (or Wildcards) in targets?


On Tue, Aug 07, 2001 at 09:39:31PM +0000, Nestor Amaya wrote:
# This is somewhat related to my previous posting titled "help with the
scope
# of pattern-specific variables".
# 
# I have searched books, websites, man pages, and cannot find any clues as
to
# how one might define a pattern-specific variable (or target, for that
# matter) when the pattern is neither a suffix nor a prefix to the target.
For
# example, I need:
# 
#       %pattern% : PAT_DEP_VAR = success
 
As Paul already pointed out, you just can't do this.

# To match any target that has "pattern" in it. A simple testcase follows:
#       ====================== Makfile ================================
#       %.1.% : PAT_DEP_VAR = yes
#       first.1.1 :
#               @echo $(PAT_DEP_VAR)
#       second.1.2 :
#               @echo $(PAT_DEP_VAR)
# 
# The output of either "make first.1.1" or "make second.1.2" should yield
# "yes". In this case, I am not particularly interested in the/either "stem"
# (but note that the "prefix-stem" and the "suffix-stem" usually do differ).
# 
# Note that I cannot automatically generate a list of the possible targets
# from an "ls", since the files may or may not exist, and the combinations
may
# be too many... So in other words, I cannot search a variable
# $(POSSIBLE_TARGETS) for a match.

I'm afraid you have to bite the bullet and use target specific variables
for each target:

   first.1.1 : PAT_DEP_VAR = success
   first.1.1 :
           @echo $(PAT_DEP_VAR)
   second.1.2 : PAT_DEP_VAR = success
   second.1.2 :
           @echo $(PAT_DEP_VAR)

Not too elegant, but does the job. If you're wanting to be fancy,
autogenerate that part of the makefile and include it in the master.

Regards,

        Jens
-- 
Jens Schweikhardt  http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)



reply via email to

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