This is closely related to Remove item from a Makefile variable?.
The answer tells us to use filter-out
, but it returns in in a new variable. I need it to modify the existing variable.
The issue I am facing is a GNUmakefile that does the following:
SRCS = $(wildcard *.cpp)
ifeq ($(SRCS),) # workaround wildcard function bug in GNU Make 3.77
SRCS = $(shell echo *.cpp)
endif
OBJS = $(SRCS:.cpp=.o)
SRCS
ends up with a few *.cpp
files it does not need, like one that is used in a Borland Developer Studio project.
How do we filter in-place without using a new variable?