[coreboot] [flashrom] r597 - trunk

svn at coreboot.org svn at coreboot.org
Tue Jun 16 11:31:52 CEST 2009


Author: hailfinger
Date: 2009-06-16 11:31:51 +0200 (Tue, 16 Jun 2009)
New Revision: 597

Modified:
   trunk/Makefile
Log:
Check for a working C compiler.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Joseph Smith <joe at settoplinux.org>


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-06-16 08:55:44 UTC (rev 596)
+++ trunk/Makefile	2009-06-16 09:31:51 UTC (rev 597)
@@ -80,7 +80,16 @@
 strip: $(PROGRAM)
 	$(STRIP) $(STRIP_ARGS) $(PROGRAM)
 
-pciutils:
+compiler:
+	@echo; printf "Checking for a C compiler... "
+	@$(shell ( echo "int main(int argc, char **argv)"; \
+		   echo "{ return 0; }"; ) > .test.c )
+	@$(CC) $(CFLAGS) $(LDFLAGS) .test.c -o .test >/dev/null &&	\
+		echo "found." || ( echo "not found."; \
+		rm -f .test.c .test; exit 1)
+	@rm -f .test.c .test
+
+pciutils: compiler
 	@echo; printf "Checking for pciutils and zlib... "
 	@$(shell ( echo "#include <pci/pci.h>";		   \
 		   echo "struct pci_access *pacc;";	   \
@@ -110,6 +119,6 @@
 	@rm -rf $(EXPORTDIR)/flashrom-$(VERSION)
 	@echo Created $(EXPORTDIR)/flashrom-$(VERSION).tar.gz
 
-.PHONY: all clean distclean dep pciutils export tarball
+.PHONY: all clean distclean dep compiler pciutils export tarball
 
 -include .dependencies





More information about the coreboot mailing list