My makefile contains these snippets (among others):
SRC = src
OBJ = obj
DEPS = $(wildcard $(SRC)/*.cpp)
# ...
all : $(BINARIES)
@echo $(pathsubst $(SRC)/%.cpp,$(OBJ)/%.d,$(DEPS))
@echo $(DEPS:$(SRC)/%.cpp=$(OBJ)/%.d)
When I make all, only the second @echo outputs something:
$ make all
obj/sample1.d obj/sample1_U.d
The (gnu make) manual states:
Another type of substitution reference lets you use the full power of the patsubst function. It has the same form ‘$(var:a=b)’ described above, except that now a must contain a single ‘%’ character. This case is equivalent to ‘$(patsubst a,b,$(var))’
From this explanation, I would expect that both @echo statements produce the same output, which they clearly don’t. What is wrong with the first form using the explicit pathsubst?
(I am using gnu make 3.81 on OS X.)
Presumably you want
patsubst, notpathsubst.