On Sun 6/17/12 15:30 CDT [email protected] wrote: --snip > This uses mktemp. The 'cat' w/in the makefile is only there (temporarily) > to show what the macro defs are. > > $ cat makefile > TMPF=$(shell tmpf=$$(mktemp /tmp/ddefs.XXXXXXXXX);_29r_dirdefs-make > > $$tmpf;echo $$tmpf)
above line should be TMPF:=$(shell tmpf=$$(mktemp /tmp/ddefs.XXXXXXXXX);_29r_dirdefs-make > $$tmpf;echo $$tmpf) so mktemp runs just once. > $(foreach v,$(shell set -- $$(wc -l $(TMPF)); seq $$1),$(eval $(shell sed > -ne $(v)p $(TMPF)))) > > $(shell set -x;cat $(TMPF) >&2; :;rm -f $(TMPF)) > > .PHONEY: bar > bar: > @echo _29C: $(_29C) > @echo _29lib: $(_29lib) > $ make bar > + cat /tmp/ddefs.ybJa29425 > _29C = /usr/local/7Rq/commands/cur > _29c = /usr/local/7Rq/scommands/cur > _29eloc = /etc/local > _29lg = /var/local/team/mke/log > _29lib = /usr/local/7Rq/lib/cur > _29r = /usr/local/7Rq > _29rev = cur > _29team = /etc/local/team/mke > _29pkg = /usr/local/7Rq/package/cur > + : > + rm -f /tmp/ddefs.PdKt29433 > _29C: /usr/local/7Rq/commands/cur > _29lib: /usr/local/7Rq/lib/cur > $ ls /tmp/ddefs.PdKt29433 > ls: /tmp/ddefs.PdKt29433: No such file or directory > $ > > Above forks a shell and a sed for each line in the macro file, > so it's inefficient, but I may go ahead and use it. > > -- > Tom _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
