Hello,
Found some typo in Makefile which was producing some "strange behaviours" while compiling pciutils rule.
Patch is below and in attachment.
Make good use of it ;-)
Stephan.
Signed-off-by: Stephan Guilloux stephan.guilloux@free.fr Index: flashrom-patch-Makefile/Makefile =================================================================== --- flashrom-patch-Makefile/Makefile (révision 4171) +++ flashrom-patch-Makefile/Makefile (copie de travail) @@ -65,7 +65,7 @@ echo "struct pci_access *pacc;"; \ echo "int main(int argc, char **argv)"; \ echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c ) - @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) &>/dev/null && \ + @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >&/dev/null && \ echo "found." || ( echo "not found."; echo; \ echo "Please install pciutils-devel and zlib-devel."; \ echo "See README for more information."; echo; \
Hello,
Found some typo in Makefile which was producing some "strange behaviours" while compiling pciutils rule.
Can you enlighten us about the strangeness of that behavior? ;-)
Stefan
Patch is below and in attachment.
Make good use of it ;-)
Stephan.
Signed-off-by: Stephan Guilloux stephan.guilloux@free.fr Index: flashrom-patch-Makefile/Makefile =================================================================== --- flashrom-patch-Makefile/Makefile (révision 4171) +++ flashrom-patch-Makefile/Makefile (copie de travail) @@ -65,7 +65,7 @@ echo "struct pci_access *pacc;"; \ echo "int main(int argc, char **argv)"; \ echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c )
- @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) &>/dev/null && \
- @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >&/dev/null && \ echo "found." || ( echo "not found."; echo; \ echo "Please install pciutils-devel and zlib-devel."; \ echo "See README for more information."; echo; \
Selon Stefan Reinauer stepan@coresystems.de:
Hello,
Found some typo in Makefile which was producing some "strange behaviours"
while
compiling pciutils rule.
Can you enlighten us about the strangeness of that behavior? ;-)
Stefan
steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> cc1: erreur: .test.c : Aucun fichier ou dossier de ce type steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> gcc: .test.c : Aucun fichier ou dossier de ce type
The compiler is called like : @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) &>/dev/null && "&>" is not recognized as a valid token, by any shell, but more like 2 separate ones, like "&" and ">". The same line should also be written like @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) & >/dev/null && or else @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >/dev/null & &&
Regarding the fix, as discussed on #coreboot, ">&" is used to redirect both CC's stdin and stdout to /dev/null. @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >& /dev/null &&
Patch is below and in attachment.
Make good use of it ;-)
Stephan.
Signed-off-by: Stephan Guilloux stephan.guilloux@free.fr Index: flashrom-patch-Makefile/Makefile =================================================================== --- flashrom-patch-Makefile/Makefile (révision 4171) +++ flashrom-patch-Makefile/Makefile (copie de travail) @@ -65,7 +65,7 @@ echo "struct pci_access *pacc;"; \ echo "int main(int argc, char **argv)"; \ echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c )
- @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) &>/dev/null && \
- @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >&/dev/null && \ echo "found." || ( echo "not found."; echo; \ echo "Please install pciutils-devel and zlib-devel."; \ echo "See README for more information."; echo; \
-- coresystems GmbH ⢠Brahmsstr. 16 ⢠D-79104 Freiburg i. Br. Tel.: +49 761 7668825 ⢠Fax: +49 761 7664613 Email: info@coresystems.de ⢠http://www.coresystems.de/ Registergericht: Amtsgericht Freiburg ⢠HRB 7656 Geschäftsführer: Stefan Reinauer ⢠Ust-IdNr.: DE245674866
On Fri, Apr 24, 2009 at 11:15:07AM +0200, stephan.guilloux@free.fr wrote:
Found some typo in Makefile which was producing some "strange behaviours"
while
compiling pciutils rule.
Can you enlighten us about the strangeness of that behavior? ;-)
Stefan
steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> cc1: erreur: .test.c : Aucun fichier ou dossier de ce type steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> gcc: .test.c : Aucun fichier ou dossier de ce type
Yes, I've seen that happen too, but never investigated.
Regarding the fix, as discussed on #coreboot, ">&" is used to redirect both CC's stdin and stdout to /dev/null. @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >& /dev/null &&
Yes, you're right.
Signed-off-by: Stephan Guilloux stephan.guilloux@free.fr
Acked-by: Ward Vandewege ward@gnu.org
On 24.04.2009 14:16, Ward Vandewege wrote:
On Fri, Apr 24, 2009 at 11:15:07AM +0200, stephan.guilloux@free.fr wrote:
Found some typo in Makefile which was producing some "strange behaviours"
while
compiling pciutils rule.
Can you enlighten us about the strangeness of that behavior? ;-)
Stefan
steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> cc1: erreur: .test.c : Aucun fichier ou dossier de ce type steph-laptop:~/Work/Flashrom/flashrom> make pciutils
Checking for pciutils and zlib... found. steph-laptop:~/Work/Flashrom/flashrom> gcc: .test.c : Aucun fichier ou dossier de ce type
Yes, I've seen that happen too, but never investigated.
Regarding the fix, as discussed on #coreboot, ">&" is used to redirect both CC's stdin and stdout to /dev/null. @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) >& /dev/null &&
Yes, you're right.
I originally insisted on >& because it worked on tcsh, but since make uses /bin/sh and /bin/sh has to be POSIX compliant, we can use the POSIX variant. >& is not POSIX compliant, but
/dev/null 2>&1
is POSIX compliant. This is specified in SuSv3, Shell command language, sections 2.7.2 and 2.7.6.
Signed-off-by: Stephan Guilloux stephan.guilloux@free.fr
Acked-by: Ward Vandewege ward@gnu.org
Stephan, would you mind resubmitting the 2>&1 variant? Thanks.
Regards, Carl-Daniel