[Top][All Lists]

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

[bug #44308] combination of $(call ...) and $(value ...) functions

From: Alex Maystrenko
Subject: [bug #44308] combination of $(call ...) and $(value ...) functions
Date: Thu, 19 Feb 2015 11:35:06 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36


                 Summary: combination of $(call ...) and $(value ...)
                 Project: make
            Submitted by: technic93
            Submitted on: Чтв 19 Фев 2015 11:35:05
                Severity: 3 - Normal
              Item Group: Enhancement
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.0
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None



There is a well-known make feature. If you want to define some piece of code
to call it with different parameters, for example:

define code
x_$1 = some value
y_$1 = $(x_$1) append value
    @echo x = $(x_$1)
    @echo y = $(y_$1)
$(eval $(call code,foo))
$(eval $(call code,bar))
all: echo-foo echo-bar

You can't do it like this, you must escape evaluation during $(call ...) and
type $$(x_$1) and $$(y_$1) instead. I don't think this is cool I've seen
Makefiles with four or five dollars in a row.

So since make 4.x added support for writing custom functions I've add $(callv
...) and I want to share it with you:


usage: $(callv var,x1,x2,...,x9)
It simply calls $(value var) and than replaces $1,$2,...,$9 with x1,x2,...x9
properly. But $$1 stays untouched. 


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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