Tristan wrote:

    Jimmy DeWitt wrote:

    > 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

I'd amend that a little, like so:

        target:
                -$(MAKE) -C my_dir

Here's what I changed:

* I didn't make `target' depend on a file named Makefile, since I'm
  not certain that such a file actually exists (perhaps you named it
  `foo.mk').

* I put a dash in front of the command, so that if it fails (because
  the directory doesn't exist, for example) your top-level make will
  *not* fail -- I suspect this is what you want.

-- 
If you can't change your underwear, can you be sure you have any?



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to