Merge branch 'hotfix' into make-improv
[sliver-openvswitch.git] / planetlab / exp-tool / Makefile
1 # see README
2 # conf.mk is expected to define
3 # HOST_<id> and IP_<id> for all nodes involved, as well as 
4 # LINKS as a list of <node_id>-<node_id> elements
5
6 # should work with any shell, but we have only tested bash
7 SHELL=/bin/bash
8
9 # run make CONF=anotherconfig.mk if you need several configs
10
11 CONF ?= conf.mk
12 include $(CONF)
13
14 # if undefined in the conf file, use single dash
15 SEP?=-
16
17 # bridge name (XXX the same on all nodes)
18 BRIDGE?=$(SLICE)
19
20 ### helper functions
21 # flip(1) = 2
22 # flip(2) = 1
23 flip=$(if $(findstring 1,$(1)),2,1)
24 # cutsep (x-y)-> x y
25 cutsep=$(subst $(SEP), ,$(1))
26 # leftnode (x-y) -> x
27 leftnode=$(word 1,$(call cutsep,$(1)))
28 # rightnode (x-y) -> y
29 rightnode=$(word 2,$(call cutsep,$(1)))
30 # linkpart(x@y) = x
31 linkpart=$(word 1,$(subst @, ,$(1)))
32 # endpart(x@y) = y
33 endpart=$(word 2,$(subst @, ,$(1)))
34 # get(x-y@1) = x
35 # get(x-y@2) = y
36 get=$(word $(call endpart,$(1)),$(call cutsep,$(call linkpart,$(1))))
37 # opp(x-y@1) = x-y@2
38 # opp(x-y@2) = x-y@1
39 opp=$(call linkpart,$(1))@$(call flip,$(call endpart,$(1)))
40 # rget(x-y@1) = y
41 # rget(x-y@2) = x
42 rget=$(call get,$(call opp,$(1)))
43 ###
44 default=$(if $($(1)_$(2)),$($(1)_$(2)),$($(1)))
45 solve=$(HOST_$(1))
46 solve_ip=$(IP_$(1))
47 # can be redefined in conf.mk if that's not the expected behaviour
48 display?=host $(1) aka $(call solve,$(1))
49
50 # log file name
51 log=$(addprefix log/,$(notdir $(1)))
52
53 #################### set variables after conf.mk
54 ifeq "$(SSH_KEY)" ""
55 SSH_KEY_OPTION ?=
56 else
57 SSH_KEY_OPTION ?= -i $(SSH_KEY)
58 endif
59
60 SSH_OPTIONS ?= $(SSH_KEY_OPTION) -l $(SLICE)
61 SSH = ssh $(SSH_OPTIONS)
62
63 SUDO ?= sudo -S
64
65 ALL_NODE_IDS=$(sort $(foreach link,$(LINKS),$(call leftnode,$(link))) $(foreach link,$(LINKS),$(call rightnode,$(link))))
66 ALL_NODE_HOSTS=$(foreach id,$(ALL_NODE_IDS),$(call solve,$(id)))
67 ALL_LINK_IDS=$(addsuffix @1,$(LINKS)) $(addsuffix @2,$(LINKS))
68 CONF_NODE_IDS=$(subst HOST_,,$(filter HOST_%,$(.VARIABLES)))
69
70 ####################
71 init_all: init all
72 init:
73         @[ -d L ] || ( echo Creating tmp dir L; mkdir L)
74         @[ -d log ] || (echo Creating tmp dir log; mkdir log)
75         @[ -d cache ] || ( echo Creating tmp dir cache; mkdir cache)
76 .PHONY: init_all init
77
78 FORCE:
79
80 .SECONDARY:
81
82 LINKTARGETS=$(addprefix L/,$(LINKS))
83 all: $(LINKTARGETS)
84 .PHONY: all
85
86 # could also do make ++SLICE
87 showslice: ++SLICE FORCE
88
89 shownodes:
90         @$(foreach id,$(ALL_NODE_IDS),echo $(id)=$(call display,$(id));)
91 showhostnames: ++ALL_NODE_HOSTS
92 # xxx missing: something that outputs raw python stuff like
93 # SEND_IP="10.0.16.1"
94 # that would belong in the export to OF
95 showips:
96         @$(foreach id,$(ALL_NODE_IDS),echo $(id)=$(call display,$(id)) has ip/network set to $(IP_$(id));)
97 showlinks:
98         @$(foreach link,$(LINKS), echo $(call display,$(call leftnode,$(link))) '====>' $(call display,$(call rightnode,$(link)));)
99 showcontrollers:
100         @$(foreach id,$(ALL_NODE_IDS), echo $(call display,$(id)) has controller $(call default,CONTROLLER,$(id));)
101 .PHONY: shownodes showhostnames showips showlinks showcontrollers
102
103 sshchecks: $(foreach id,$(ALL_NODE_IDS),sshcheck-$(id))
104 .PHONY: sshchecks
105 ovsversions: $(foreach id,$(ALL_NODE_IDS),ovsversion-$(id))
106 .PHONY: ovsversions
107 # more general form; run with  make sshs SSH-COMMAND="bla bla bla"
108 sshs: $(foreach id,$(ALL_NODE_IDS),ssh-$(id))
109 .PHONY: sshs
110 showdpids: $(foreach id,$(ALL_NODE_IDS),showdpid-$(id))
111 .PHONY: showdpids
112 showmacs: $(foreach id,$(ALL_NODE_IDS),showmac-$(id))
113 .PHONY: showmacs
114 showports: $(foreach id,$(ALL_NODE_IDS),showports-$(id))
115 .PHONY: showports
116
117 DBS=$(foreach id,$(ALL_NODE_IDS),cache/db.$(id))
118 dbs: $(DBS)
119 .PHONY: dbs
120
121 SWITCHS=$(foreach id,$(ALL_NODE_IDS),cache/switch.$(id))
122 switchs: $(SWITCHS)
123 .PHONY: switchs
124
125 start: dbs switchs
126 .PHONY: start
127
128 stop:$(foreach id,$(ALL_NODE_IDS),cache/stop.$(id))
129 .PHONY: stop
130
131 status:$(foreach id,$(ALL_NODE_IDS),cache/status.$(id))
132 .PHONY: status
133
134 BRIDGES=$(foreach id,$(ALL_NODE_IDS),cache/bridge.$(id))
135 bridges: $(BRIDGES)
136 .PHONY: bridges
137
138 CONTROLLERS=$(foreach id,$(ALL_NODE_IDS),cache/controller.$(id))
139 controllers: $(CONTROLLERS)
140 .PHONY: controllers
141
142 del-controllers: $(foreach id,$(ALL_NODE_IDS),del-controller-$(id))
143 .PHONY: del-controllers
144
145 ### node-oriented targets
146 # check ssh connectivity
147 sshcheck-%: FORCE
148         @if $(SSH) $(HOST_$*) hostname > /dev/null 2>&1; then echo "ssh on" $(call display,$*) "OK" ; \
149          else echo "ssh on" $(call display,$*) "KO !!!"; fi
150
151 ovsversion-%: FORCE
152         @OVSVERSION=$$($(SSH) $(HOST_$*) rpm -q sliver-openvswitch); echo $(call display,$*) has $$OVSVERSION
153
154 ssh-%: FORCE
155         @$(SSH) $(HOST_$*) $(SUDO) $(SSH-COMMAND)
156
157 showdpid-%: FORCE
158         @echo $*_DPID=0x$$( $(SSH) $(HOST_$*) $(SUDO) ovs-vsctl get bridge $(BRIDGE) datapath_id | sed -e 's,",,g')
159
160 showmac-%: FORCE
161         @echo $*_MAC=\"$$( $(SSH) $(HOST_$*) $(SUDO) sliver-ovs show-mac)\"
162
163 showports-%: FORCE
164         @$(SSH) $(HOST_$*) $(SUDO) ovs-ofctl show $(BRIDGE) \
165                 | perl -nle '/(\d+)\(L(.*?)\Q$(SEP)\E(.*?)\):/ && \
166                         print "PORT_".("$$2" eq "$*" ? "$$2_$$3" : "$$3_$$2")."=$$1"'
167 # should probably replace sshcheck
168 cache/status.%: FORCE
169         @echo "=== DB and SWITCH processes on $(call display,$*)"
170         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs status ||:
171
172 cache/host.%:
173         @echo "IP lookup for $(call display,$*)"
174         @host $(HOST_$*) | sed -n 's/^.*has address *//p' > $@
175
176 cache/db.%:
177         @echo "Starting db server on $(call display,$*) - logs in $(call log,$@)"
178         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-db > $(call log,$@) 2>&1 && touch $@
179
180 cache/switch.%: | cache/db.%
181         @echo "Starting vswitchd on $(call display,$*) - logs in $(call log,$@)"
182         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-switch > $(call log,$@) 2>&1 && touch $@
183
184 cache/bridge.%: | cache/db.%
185         @echo "Creating bridge on $(call display,$*) - logs in $(call log,$@)"
186         @$(SSH) $(HOST_$*) $(SUDO) \
187                 sliver-ovs create-bridge $(BRIDGE) $(IP_$*) $(call default,BROPTIONS,$*) > $(call log,$@) 2>&1 \
188          && { echo "IP_$*=$(IP_$*)"; echo "BROPTIONS_$*=$(call default,BROPTIONS,$*)"; } > $@
189
190 cache/controller.%: cache/bridge.%
191         @echo "Setting controller $(call default,CONTROLLER,$*) on $(call display,$*) - logs in $(call log,$@)"
192         @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) > $(call log,$@) 2>&1 \
193          && echo "CONTROLLER_$*=$(call default,CONTROLLER,$*)" > $@
194
195 # xxx this probably needs a more thorough cleanup in cache/
196 cache/stop.%: del-bridge.%
197         @echo "Stopping switch & db on $(call display,$*)"
198         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop && rm cache/switch.$* cache/db.$*
199
200 ### link-oriented targets
201 # L/<nodeid1>-<node_id2>:
202 #       Establish a link between nodes <node_id1> and <node_id2>
203 L/%: cache/endpoint.%@1 cache/endpoint.%@2
204         @touch $@
205         @echo "Link $* is up"
206
207 # U/<node_id1>-<node_id2>
208 #       Tear down the link between nodes <node_id1> and <node_id2>
209 U/%: del-iface.%@1 del-iface.%@2
210         @rm -f L/$*
211         @echo "Deleted link $*"
212
213 # del-bridge.<node_id>: Delete the bridge on node <node_id>.
214 #
215 # We can do this only if the db on node <node_id> is running, but
216 # we don't need to re-delete if the db is restarted (hence the
217 # order-only dependency).
218 #
219 # Deleting a bridge also deletes all interfaces of the bridge
220 # as a side effect. This in turn invalidates local tunnel
221 # port numbers and endpoint info on both sides of each affected tunnel.
222 # The corresponding links obviously go down. 
223 # Controller information is also lost.
224 # We invalidate the cache accordingly.
225 del-bridge.%: | cache/db.%
226         @echo "Deleting bridge on $(call display,$*)"
227         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-bridge $(BRIDGE);
228         @rm -f cache/bridge.$* \
229               cache/iface.$*$(SEP)*@1 cache/iface.*$(SEP)$*@2 \
230               cache/port.$*$(SEP)*@1  cache/port.*$(SEP)$*@2  \
231               cache/endpoint.$*$(SEP)*@?  cache/endpoint.*$(SEP)$*@?  \
232               L/$*$(SEP)*             L/*$(SEP)$* \
233               cache/controller.$*
234
235 # del-switch.<node_id>: Stops the switch daemon on <node_id>.
236 #
237 # As a side effect, the local port numbers of the tunnels
238 # are no longer valid (they will change when the daemon is restarted)
239 # and, therefore, the endpoint info on the remote side of
240 # the tunnels must be invalidated. The links also go down.
241 # Controller information is also lost.
242 # We invalidate the cache accordingly.
243 del-switch.%:
244         @echo "Shutting down switch on $(call display,$*)"
245         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-switch
246         @rm -f cache/switch.$* \
247                cache/port.$*$(SEP)*@1  cache/port.*$(SEP)$*@2  \
248                cache/endpoint.$*$(SEP)*@2  cache/endpoint.*$(SEP)$*@1  \
249                L/$*$(SEP)*            L/*$(SEP)$* \
250                cache/controller.$*
251
252 # del-db.<node_id>: Stops the db daemon on <node_id>.
253 #
254 # This has no additional side effects.
255 del-db.%:
256         @echo "Shutting down db on $(call display,$*)"
257         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-db
258         @rm -f cache/db.$*
259
260 # del-controller.<node_id>:
261 #       Detaches <node_id> from the controller.
262 #
263 # This has no additional side effects.
264 del-controller-%: | cache/db.%
265         @echo "Removing controller for $(call display,$*)"
266         @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-controller $(BRIDGE)
267         @rm -f cache/controller.$*
268
269 # del-links: Shortcut to delete all currently up links.
270 del-links: $(addprefix U/,$(notdir $(wildcard L/*)))
271
272 # del-switchs: Shortcut to stop all currently running switch daemons.
273 del-switchs: $(addprefix del-,$(notdir $(wildcard cache/switch.*)))
274
275 # del-dbs: Shortcut to stop all currently running db daemona.s
276 del-dbs: $(addprefix del-,$(notdir $(wildcard cache/db.*)))
277
278 # shutdown: Shortcut to stop all currently running daemons.
279 shutdown: del-switchs del-dbs
280
281 .PHONY: del-links del-switchs del-dbs shutdown
282
283
284 ### snapshots
285 snapshot:
286         @echo BRIDGE=$(BRIDGE)
287         @cat cache/bridge.* 2>/dev/null || :
288         @cat cache/controller.* 2>/dev/null || :
289         @ls L | sed 's/^/LINKS += /'
290
291 remote-snapshot: remote-snapshot-ips remote-snapshot-links
292         @true
293
294 remote-snapshot-ips: $(addprefix cache/rsnap.ip.,$(CONF_NODE_IDS))
295         @cat /dev/null $^
296
297 remote-snapshot-links: $(addprefix cache/rsnap.links.,$(CONF_NODE_IDS))
298         @sort -u /dev/null $^
299
300 .PHONY: remote-snapshot remote-snapshot-ips remote-snapshot-links
301
302
303 cache/rsnap.ip.%: FORCE
304         @$(SSH) $(HOST_$*) $(SUDO) \
305                 sliver-ovs get-local-ip $(BRIDGE) | sed 's/^/IP_$*=/' > $@ \
306          || { rm $@; exit 1; }
307
308 cache/rsnap.links.%: FORCE
309         @$(SSH) $(HOST_$*) $(SUDO) \
310                 sliver-ovs get-local-links $(BRIDGE) | sed -n 's/^L/LINKS += /p' > $@ \
311          || { rm $@; exit 1; }
312
313 ### update sliver-ovs
314 update: $(addprefix update-,$(CONF_NODE_IDS))
315         @true
316
317 update-%: FORCE
318         @[ -n "$(SLIVER_OVS)" ] || { echo "SLIVER_OVS not set" >&2; exit 1; }
319         @[ -f "$(SLIVER_OVS)" ] || { echo "$(SLIVER_OVS) not found" >&2; exit 1; }
320         @echo "Sending $(SLIVER_OVS) to $(call display,$*)"
321         @scp $(SSH_KEY_OPTION) -q $(SLIVER_OVS) $(SLICE)@$(call solve,$*):
322         @$(SSH) $(call solve,$*) $(SUDO) mv $(notdir $(SLIVER_OVS)) /usr/sbin/sliver-ovs
323
324 .SECONDEXPANSION:
325
326 # del-iface.<node_id>-<node_id>@<endpoint>:
327 #       Deletes the interface of link <node_id1>-<node_id2> on either
328 #       <node_id1> or <node_id2>, according to <endpoint>.
329
330 # We need a running db daemon to do this, but we do not have to
331 # redo the delete if the db daemon is restarted.
332 #
333 # This also invalidates the local port of the tunnel and the endpoint
334 # info on both sides of the tunnel. The link goes down.
335 del-iface.%: | cache/db.$$(call get,%)
336         @echo "Removing interface for link $(call linkpart,$*) from $(call get,$*)"
337         @$(SSH) $(HOST_$(call get,$*)) \
338                 $(SUDO) sliver-ovs del-port L$(call linkpart,$*)
339         @rm -f cache/iface.$* \
340                cache/port.$* cache/endpoint.$* cache/endpoint.$(call opp,$*) \
341                L/$(call linkpart,$*)
342
343
344 ### '%' here is leftid-rightid@{1,2}
345 # we retrieve % as $(*F)
346 #linkid=$(call linkpart,%)
347 #nodeid=$(call get,%)
348 #bridgefile=cache/bridge.$(nodeid)
349
350 # cache/iface.<node_id1>-<node_id2>@<endpoint>:
351 #       Creates the interface for link <node_id1>-<node_id2> on
352 #       <node_id<endpoint>>. 
353 #
354 # The bridge of the local node must already exist, and we need to create
355 # the interface again if the bridge is re-created.
356 # We also need a running db daemon, but we do not need to do anything
357 # if the db daemon is restarted.
358 cache/iface.%: cache/bridge.$$(call get,%) | cache/db.$$(call get,%)
359         @echo "Creating interface for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
360         @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs create-port $(BRIDGE) \
361                 L$(call linkpart,$(*F)) > $(call log,$@) 2>&1 \
362          && touch $@
363
364 # cache/port.<node_id1>-<node_id2>@<endpoint>:
365 #       Retrieves the local port of link <node_id1>-<node_id2> on
366 #       node <node_id<endpoint>>.
367 #
368 # The local interface must have been created already and the
369 # switch daemon must be running. We need to retrieve the port
370 # number again if the interface is re-created, or the switch
371 # daemon is restarted.
372 cache/port.%: cache/iface.% cache/switch.$$(call get,%)
373         @echo "Getting port number for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
374         @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) \
375                 sliver-ovs get-local-endpoint L$(call linkpart,$(*F)) > $@ 2> $(call log,$@) \
376          || { rm $@; exit 1; }
377
378
379 # linkid=$(call linkpart,%)
380 # nodeid=$(call get,%)
381 # iface1=cache/iface.%
382 # iface2=cache/iface.$(call opp,%)
383
384 # cache/endpoint.<node_id1>-<node_id2>@<endpoint>:
385 #       Sets the other side (IP address, UDP port) info for link <node_id1>-<node_id2>
386 #       on <node_id<endpoint>>.
387 #
388 # We need the IP address and the UDP port of the other side and the interace of this side.
389 # We need to set the info again if any of these change.
390 cache/endpoint.%: cache/host.$$(call rget,%) cache/port.$$(call opp,%) cache/iface.%
391         @echo "Setting port number of link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)"
392         @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs set-remote-endpoint L$(call linkpart,$(*F)) \
393                         $$(cat cache/host.$(call rget,$(*F))) \
394                         $$(cat cache/port.$(call opp,$(*F))) 2> $(call log,$@) \
395          && touch $@
396
397 ####################
398 CLEANTARGETS=$(addprefix del-,$(notdir $(wildcard cache/bridge.*)))
399 clean: $(CLEANTARGETS)
400 distclean:
401         rm -rf L log cache
402 .PHONY: clean distclean
403
404 ####################
405 graph.dot:
406         ( echo "digraph $(SLICE) {"; ls L | sed 's/$(SEP)/->/;s/$$/;/'; echo "}" ) > $@
407 graph.ps: graph.dot
408         dot -Tps < $^ > $@      
409
410 ####################
411 # googlemap stuff
412 # Uses:
413 # GMAP_SERVER, the hostname that runs an ndnmap instance
414 # GMAP_PROBES, a list of tuples of the form
415 # <linkid>=<nodeid>=<internal_linkid>=<frequency>
416 # e.g.
417 # SENDER-MUX=SENDER=3=0.5
418 # which would mean, the link 'SENDER-MUX' should be monitored at the 'SENDER' node and is coded 
419 # in links.json with id=3, every half second
420 # sliver-ovs gmap-probe is designed to run in background,
421 # and so that a new run will kill any previously running instance
422 gprobes: $(foreach probe,$(GMAP_PROBES),gprobe-$(probe))
423
424 gprobe-%: FORCE
425         $(SSH) -n $(call solve,$(word 2,$(subst @, ,$(*F)))) $(SUDO) \
426         sliver-ovs gmap-probe L$(word 1,$(subst @, ,$(*F))) $(GMAP_SERVER) $(word 3,$(subst @, ,$(*F))) $(word 4,$(subst @, ,$(*F)))
427
428 jsons: routers.json links.json geocode.json
429 .PHONE: jsons
430
431 routers.json: $(CONF)
432         @{  echo "[";   \
433             sep="  ";   \
434             for n in $(CONF_NODE_IDS); do \
435                 echo "    $$sep\"$$n\"";  \
436                 sep=", "; \
437             done; \
438             echo "]"; \
439           } > $@
440
441 links.json: $(foreach l,$(LINKS),cache/json.$(l))
442         @{  echo "["; \
443             cat $^ | sed '2,$$s/^/, /'; \
444             echo "]"; \
445          } > $@
446
447 cache/json.%: $(CONF)
448         @echo "{\"id\": $($*_linkid), \"start\": \"$(call get,$*@1)\", \"end\": \"$(call get,$*@2)\"}" > $@
449
450 geocode.json: $(foreach n,$(CONF_NODE_IDS),cache/geocode.$(n))
451         @{  echo "{"; \
452             sep="  "; \
453             for f in $^; do \
454                 echo -n "$$sep"; \
455                 cat $$f; \
456                 sep=", "; \
457             done; \
458             echo "}"; \
459          } > $@
460              
461 cache/geocode.%: cache/loc.% $(CONF)
462         @{  echo "\"$*\": {"; \
463             echo "    \"name\": \"$(HOST_$*)\","; \
464             echo "    \"shortname\": \"$*\","; \
465             echo "    \"site\": \"\","; \
466             echo "    \"backbone\": false,"; \
467             echo "    \"position\": [ $(shell cat cache/loc.$*) ]"; \
468             echo "   }"; \
469          } > $@
470
471 cache/loc.%: $(CONF)
472         @wget -O - 'http://freegeoip.net/csv/$(HOST_$*)' | \
473             awk -F, '{ printf "%s, %s\n", $$8, $$9 }' > $@
474
475 ####################
476 # 'virtual' targets in that there's no real file attached
477 define node_shortcuts
478 sshcheck.$(1): sshcheck-$(1) FORCE
479 db.$(1): cache/db.$(1) FORCE
480 switch.$(1): cache/switch.$(1) FORCE
481 start.$(1): cache/start.$(1) FORCE
482 stop.$(1): cache/stop.$(1) FORCE
483 status.$(1): cache/status.$(1) FORCE
484 bridge.$(1): cache/bridge.$(1) FORCE
485 host.$(1): cache/host.$(1) FORCE
486 controller.$(1): cache/controller.$(1) FORCE
487 # switch already depends on db, but well
488 cache/start.$(1): cache/db.$(1) cache/switch.$(1) FORCE
489 endef
490
491 $(foreach id,$(ALL_NODE_IDS), $(eval $(call node_shortcuts,$(id))))
492
493 define link_shortcuts
494 iface.%: cache/iface.%
495 endpoint.%: cache/endpoint.%
496 endef
497
498 $(foreach id,$(ALL_LINK_IDS), $(eval $(call link_shortcuts,$(id))))
499
500 help:
501         @cat Makefile.help
502
503 #################### convenience, for debugging only
504 # make +foo : prints the value of $(foo)
505 # make ++foo : idem but verbose, i.e. foo=$(foo)
506 ++%: varname=$(subst +,,$@)
507 ++%:
508         @echo "$(varname)=$($(varname))"
509 +%: varname=$(subst +,,$@)
510 +%:
511         @echo "$($(varname))"