From 4cb7a96153c471c8f35a4803198c2059227a4263 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 16 Jun 2009 09:31:51 +0000 Subject: Check for a working C compiler Corresponding to flashrom svn r597. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Joseph Smith --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2ff241d..00a3d93 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,16 @@ dep: 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 "; \ echo "struct pci_access *pacc;"; \ @@ -110,6 +119,6 @@ tarball: export @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 -- cgit v1.1