Greetings Makefile Experts

Here's my problem (hopefully it makes sense):

Code:
include filenames.lst
includes a file that says
Code:
SCRIPTS = one.c two.c three.c four.c
.

So SCRIPTS is now defined. I used to have

Code:
DIRS = $(addsuffix _sub, $(basename $(SCRIPTS)))
to store subdirectories in DIRS. The code lists a subdirectory for every source listed within SCRIPTS, whether it exists or not.

But now, I need DIRS to only hold a subdirectory if it actually exists.

In other words, before DIRS would hold one_sub, two_sub, three_sub, and four_sub. But lets say three_sub doesn't exist. I need help with a script I can put in my Makefile that will verify an existing subdirectory before the name is added to DIRS.

I have this:
Code:
DIRS = 
for i in $(basename $(SCRIPTS))
do
if [-d $(addsuffix _sub, $i) ]
then
DIRS += $(addsuffix _spu, $i)
fi
done
but it's not working.

I also tried putting all that within $(shell ... ) but it still didn't work.

Help.