2 # Makefile for k8redump utility
4 # Original from Stefan Reinauer <stepan@openbios.org>
11 INSTALL = /usr/bin/install
13 #CFLAGS = -O2 -g -Wall -Werror
14 CFLAGS = -Os -Wall -Werror
15 OS_ARCH = $(shell uname)
16 ifeq ($(OS_ARCH), SunOS)
19 LDFLAGS = -lpci -lz -static
25 all: pciutils dep $(PROGRAM)
28 $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS)
29 $(STRIP) $(STRIP_ARGS) $(PROGRAM)
35 rm -f $(PROGRAM) .dependencies
38 @$(CC) -MM *.c > .dependencies
41 @echo; echo -n "Checking for pciutils and zlib... "
42 @$(shell ( echo "#include <pci/pci.h>"; \
43 echo "struct pci_access *pacc;"; \
44 echo "int main(int argc, char **argv)"; \
45 echo "{ pacc = pci_alloc(); return 0; }"; ) > .test.c )
46 @$(CC) $(CFLAGS) .test.c -o .test $(LDFLAGS) &>/dev/null && \
47 echo "found." || ( echo "not found."; echo; \
48 echo "Please install pciutils-devel and zlib-devel."; \
49 echo "See README for more information."; echo; \
50 rm -f .test.c .test; exit 1)
53 .PHONY: all clean distclean dep pciutils
55 -include .dependencies