Reputation: 525
How would one test for the existence of files with a certain extension (.cpp in this case) in a directory at a specified location which is several directories down from the location of the makefile? I would like to print(echo) a message out if they are found
Upvotes: 0
Views: 364
Reputation: 101041
Your question is ambiguous. You mean, inside a make recipe you want to perform this test? If so then just write the appropriate shell scripting to check for the existence of said files.
If you mean outside of any recipe, in the makefile itself, if you're using GNU make you can use the $(wildcard ...)
function:
ifneq (,$(wildcard some/sub/directory/*.cpp))
$(info found some cpp files!)
endif
Upvotes: 1