Re: Error in make file



Dan Espen wrote:

Baho Utot <baho-utot@xxxxxxxxxxxx> writes:

The following is a fragment of my Makefile (GNU Make 3.81).

I believe the error stems from the grep (line) but I don't know why it
errors.

PKGLIST is a list of sub directories to "grep the Build.Log" looking for
compile and installation errors.

This is the error:

make: *** [errors] Error 1

Makefile fragment

PKGLIST = Linux-API-Headers Man-pages Glibc

errors:
for dir in $(PKGLIST); do \
echo "Checking: "$$dir; \
grep Error $$dir/Build.Log; \
done

Anyone know the fix?

I copied your fragment into a Makefile,
changed all the spaces to tabs and ran it.
Here is the output:

for dir in Linux-API-Headers Man-pages Glibc; do \
echo "Checking: "$dir; \
grep Error $dir/Build.Log; \
done
Checking: Linux-API-Headers
grep: Linux-API-Headers/Build.Log: No such file or directory
Checking: Man-pages
grep: Man-pages/Build.Log: No such file or directory
Checking: Glibc
grep: Glibc/Build.Log: No such file or directory
make: *** [errors] Error 2


everything looks fine to me.

Thanks....

After a little bit more research, I believe to problem is grep returning a
non zero return value when grep finds a match. Make then thinks something
has failed hence the make: *** [errors] Error 1

I need to think now of a work around or just ignore the error :(

--
Dancin in the ruins tonight
Tayo'y Mga Pinoy
.



Relevant Pages

  • Re: How can I search through directories with spaces?
    ... in a directory where there are sub directories with spaces in the ... When I execute ... grep: 7/Skills: No such file or directory ... Alternatively you can add quoting to the xargs input, ...
    (comp.unix.shell)
  • Re: Error in make file
    ... I believe the error stems from the grep but I don't know why it ... PKGLIST is a list of sub directories to "grep the Build.Log" looking for ... Makefile fragment ...
    (comp.os.linux.misc)
  • Re: Error in make file
    ... I believe the error stems from the grep but I don't know why it ... PKGLIST is a list of sub directories to "grep the Build.Log" looking for ... Makefile fragment ...
    (comp.os.linux.misc)
  • Re: find strings in sub directories
    ... > How do I find a specific string with grep in all files including files in ... Mirko ... SDF - Super Dimensional Fortress ...
    (comp.unix.shell)
  • Re: find strings in sub directories
    ... [This followup was posted to comp.unix.shell] ... > How do I find a specific string with grep in all files including files in ...
    (comp.unix.shell)