I have a makefile, which includes several other makefiles, which in turn all add to a variable like this:
VAR := Something SomethingElse VAR += SomeOtherThin
On top of the correct answer above:
VAR = bla1 bla2 bla3 bla4 bla5 TMPVAR := $(VAR) VAR = $(filter-out bla3, $(TMPVAR)) all: @echo "VAR is: $(VAR)"
Output: VAR is: bla1 bla2 bla4 bla5
Note that this breaks all "recursivity" when filter-out is executed, but that might not matter in your case.