Suppose I’ve got a simple #Makefile w/ a few URLs that I’d like to process as dynamic targets.
For example here is a not working snippet:
.DEFAULT_GOAL := all
#####
URLS = https://foo.example.com
URLS += https://bar.example.com
URLS += https://www.example.org
#####
% :
@echo the url is $(*)
#####
.PHONY : all
all : $(URLS)
It fails w/
*** target pattern contains no ‘%’
I believe that’s b/c of the character :
being part of URLS
which confuses Make after expansion (order o
As a workaround, I’ve removed https://
from all URLs. For example this works:
URLS = foo.example.com
URLS += bar.example.com
I know Make generally doesn’t play well w/ targets w/ space or colon in the name but I wonder if the above is the best I can do. What do you think?
I didn’t try yet: https://www.cmcrossroads.com/article/gnu-make-escaping-walk-wild-side
Unfortunately didn’t work. I got the same
*** target pattern contains no ‘%’
error.@jlsalvador @bahmanm@lemmy.ml This is interesting. I’ll give it a shot though I think it will expand to
:
too soon and will have the same effect.