[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA: Issues with makefiles. . . . .
On Sat, Sep 04, 2004 at 04:43:39PM -0400, Stuart Brorson wrote:
> Hi gEDA developers --
>
> I have been working on incorporating gattrib into the top level gEDA
> Makefile system. While testing gEDA's top level Makefile, I have
> encountered the following questions:
>
> 1. In docs/<subdirectories>, the Makefile.am contains the following
> construct:
>
> uninstall-hook:
> ( cd $(docname) ; $(INSTALL) -d $(DESTDIR)$(docsdir); \
> for i in *; do \
> -rm -f $(DESTDIR)$(docsdir)/$$i; \
> done; \
> rmdir $(DESTDIR)$(docsdir) )
>
> Where "-rm" is called out instead of "rm" to remove the files. "-rm"
> also occurs in other places in other docs dirs. This construct can
> cause "make uninstall" to barf, since it doesn't remove any files from
> the target dir, and then rmdir fails because the target dir is not
> empty.
>
> Question: Is this intended, or is "-rm" a bug. It appears in lots of
> places in the docs dir.
This is a bug. Putting either an "@" or a "-" as the _first_ character
in one of the commands in the shell command section of a makefile has
special meaning (don't echo the command, and ignore a non-zero exit
code respectively). Putting the "-" elsewhere like it is here doesn't
do anything from make's point of view, its just passed to the shell.
Besides that, "-f" will keep an exit code of 0 for rm even if the file
does not exist.
-Dan
--