If what you want to is determine whether FDEP_FILES
is defined then the test should be:
ifdef FDEP_FILES
The reason it fails when you have more than one file is that $(FDEP_FILES)
will be expanded to its value and then ifdef
will test whether the variable named with this value is defined. Since the value is not a valid variable name, you get an error.
But note that ifdef
will consider a variable with an empty string as a value as being defined. With the code you've shown us, I'm not convinced that you won't end up with an empty string under some circumstances. You should consider testing with ifneq ($(strip $(FDEP_FILES)),)
. With this test, the branch will be taken only if FDEP_FILES
has a non-empty string as value.