2 ## Makefile for k8resdump utility
4 ## (C) 2005 coresystems GmbH
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; version 2 of the License.
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
19 INSTALL
= /usr
/bin
/install
21 #CFLAGS = -O2 -g -Wall -Werror
22 CFLAGS
= -Os
-Wall
-Werror
23 OS_ARCH
= $(shell uname
)
24 ifeq ($(OS_ARCH
), SunOS
)
27 LDFLAGS
= -lpci
-lz
-static
32 all: pciutils dep
$(PROGRAM
)
35 $(CC
) -o
$(PROGRAM
) $(OBJS
) $(LDFLAGS
)
41 rm -f
$(PROGRAM
) .dependencies
44 @
$(CC
) -MM
*.c
> .dependencies
47 @echo
; echo
-n
"Checking for pciutils and zlib... "
48 @
$(shell ( echo
"#include <pci/pci.h>"; \
49 echo
"struct pci_access *pacc;"; \
50 echo
"int main(int argc, char **argv)"; \
51 echo
"{ pacc = pci_alloc(); return 0; }"; ) > .
test.c
)
52 @
$(CC
) $(CFLAGS
) .
test.c
-o .
test $(LDFLAGS
) &>/dev
/null
&& \
53 echo
"found." ||
( echo
"not found."; echo
; \
54 echo
"Please install pciutils-devel and zlib-devel."; \
55 echo
"See README for more information."; echo
; \
56 rm -f .
test.c .
test; exit
1)
59 .PHONY
: all clean distclean dep pciutils
61 -include .dependencies