[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 |
URL:
<http://savannah.gnu.org/bugs/?44308>
Summary: combination of $(call ...) and $(value ...)
functions
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
_______________________________________________________
Details:
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
do-$1:
@echo x = $(x_$1)
@echo y = $(y_$1)
endef
$(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:
https://github.com/technic/make-callv
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:
<http://savannah.gnu.org/bugs/?44308>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #44308] combination of $(call ...) and $(value ...) functions,
Alex Maystrenko <=