Results 1 to 1 of 1
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 ...
- 01-10-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 1
Makefile Help
Greetings Makefile Experts
Here's my problem (hopefully it makes sense):
includes a file that saysCode:include filenames.lst
.Code:SCRIPTS = one.c two.c three.c four.c
So SCRIPTS is now defined. I used to have
to store subdirectories in DIRS. The code lists a subdirectory for every source listed within SCRIPTS, whether it exists or not.Code:DIRS = $(addsuffix _sub, $(basename $(SCRIPTS)))
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:
but it's not working.Code:DIRS = for i in $(basename $(SCRIPTS)) do if [-d $(addsuffix _sub, $i) ] then DIRS += $(addsuffix _spu, $i) fi done
I also tried putting all that within $(shell ... ) but it still didn't work.
Help.


Reply With Quote