[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I check if a directory exists?
From: |
Jimmy DeWitt |
Subject: |
Re: How do I check if a directory exists? |
Date: |
Mon, 8 Dec 2003 15:14:39 -0600 |
Tristan,
Thanks.
This accomplishes some of what we need. If "my_dir" exists, make
treats the
"my_dir"/Makfile dependency as an actual file within a subdirectory, and a
"touch" of
/my_dir/Makfile will force a recompile.
If my_dir doesn't exist "my_dir/Makefile" is treated as a target.
Since there
no rule exists for that target, make crashes.
We would like make to stop if there are no other targets to build, or
go to the next target
if running "make.all"
Tristan Van
Berkom To: Jimmy
DeWitt/Austin/address@hidden
<address@hidden cc: address@hidden
.com> Subject: Re: How do I check if
a directory exists?
12/08/2003 11:35
AM
Jimmy DeWitt wrote:
> Hi,
> I have a make question:
>
> How do I test if a directory exists with make?
>
>
> I would like to have a Makefile that checks if a specific directory is
> there, if it
> is I would like to cd to it and build .
>
> if foo
> cd foo
> make -f my_makefile
>
>
> Is there a way to do this without scripts?
Would this suite your purpose ?
target: my_dir/Makefile
$(MAKE) -C my_dir
Cheers,
-Tristan