NetBSD-Users archive

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

Re: bmake variable expansion: ${X:ts:}



On Tue, 5 Jul 2022, Brook Milligan wrote:

Below is a small Makefile.  Its intent is for the loops to have three iterations (a, b, and c) by separating ${X} on the colons.


:ts won't produce new words without a whitespace there.

This do the job?

---
# Makefile

X=      hello world:embedded	tab:xxx
Z=	${X:Q}
Y=	${Z:S/:/ /g}

all:
	@echo "Y=${Y}"
	@echo "make .for loop:"
.for f in ${Y}
	@echo "===> ${f}"
.endfor
	@echo "shell for loop:"
	for f in ${Y}; do echo "===> $${f}"; done
---

-RVP



Home | Main Index | Thread Index | Old Index