Reputation: 2409
I am attempting to get the following filter statement to work correctly, however, it does not. exportedLibaries contains the relative path to the files from where make it being executed from (i.e. export/*/*/*/filename
)
dev := $(filter HelloWorld%, $(exportedLibraries))
I use a similar filter for my unit tests and it works wonderfully (with the relative path being the same):
unitTests := $(filter %_Test, $(exportedUnitTests))
This however works...
dev := $(filter $(wildcard export/**/**/**/HelloWorld*), $(exportedLibraries))
What am I doing wrong?
Upvotes: 0
Views: 50
Reputation: 2898
$(notdir) is what you want in this case:
exportedLibraries := export/foo/helloworld.lib export/bar/HelloWorld.lib export/baz/HelloWorldTwo.lib
dev := $(foreach lib,$(exportedLibraries),$(if $(filter HelloWorld%,$(notdir $(lib))),$(lib)))
$(info $(dev))
You could $(strip)
the result of the $(foreach)
to get rid of surplus spaces in the result.
Upvotes: 2