]> git.ipfire.org Git - thirdparty/pciutils.git/blame - Makefile
Cleaned up usage of `char' and `byte'.
[thirdparty/pciutils.git] / Makefile
CommitLineData
4284af58 1# Makefile for The PCI Utilities
1d5cf727 2# (c) 1998--2006 Martin Mares <mj@ucw.cz>
98e39e09 3
54e13765 4OPT=-O2
35620695 5CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline
727ce158 6
f54d99b3 7VERSION=2.2.4-pre4
1e73529b 8DATE=2006-07-30
168b4f46 9
c83293eb
MM
10PREFIX=/usr/local
11SBINDIR=$(PREFIX)/sbin
12SHAREDIR=$(PREFIX)/share
54e13765 13IDSDIR=$(SHAREDIR)
b0f1a03b 14MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi)
14d6c0a3
MM
15INSTALL=install
16DIRINSTALL=install -d
4afd29d3 17PCILIB=lib/libpci.a
489233b4 18PCIINC=lib/config.h lib/header.h lib/pci.h lib/types.h lib/sysdep.h
c83293eb 19
848b4347 20ifeq ($(shell uname),NetBSD)
e6859953 21PCILIB=lib/libpciutils.a
848b4347
MM
22LDFLAGS+=-lpci
23else
14d6c0a3 24ifeq ($(shell uname),AIX)
14d6c0a3
MM
25CFLAGS=-g
26INSTALL=installbsd
27DIRINSTALL=mkdir -p
14d6c0a3 28endif
848b4347 29endif
f6c86928 30
0d656226
MM
31HOST=
32RELEASE=
33
727ce158
MM
34export
35
4afd29d3 36all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids
727ce158 37
11f7b31b 38$(PCILIB): $(PCIINC) force
727ce158 39 $(MAKE) -C lib all
e4842ff3 40
11f7b31b
MM
41force:
42
727ce158 43lib/config.h:
54e13765 44 cd lib && ./configure $(IDSDIR) $(VERSION) $(HOST) $(RELEASE)
98e39e09 45
4afd29d3
MM
46lspci: lspci.o common.o $(PCILIB)
47setpci: setpci.o common.o $(PCILIB)
727ce158 48
4afd29d3
MM
49lspci.o: lspci.c pciutils.h $(PCIINC)
50setpci.o: setpci.c pciutils.h $(PCIINC)
51common.o: common.c pciutils.h $(PCIINC)
727ce158 52
1b95f396 53update-pciids: update-pciids.sh
54e13765 54 sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/pci.ids@"
1b95f396 55
727ce158 56%.8: %.man
54e13765 57 M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#"
98e39e09
MM
58
59clean:
14d6c0a3 60 rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core`
14d4f989 61 rm -f update-pciids lspci setpci lib/config.* lib/example *.8 pci.ids.*
ab12277e
MM
62 rm -rf maint/dist
63
64distclean: clean
f17b962b
MM
65
66install: all
ee551b73 67# -c is ignored on Linux, but required on FreeBSD
54e13765 68 $(DIRINSTALL) -m 755 $(SBINDIR) $(IDSDIR) $(MANDIR)/man8
25050db6
MM
69 $(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR)
70 $(INSTALL) -c -m 755 update-pciids $(SBINDIR)
54e13765 71 $(INSTALL) -c -m 644 pci.ids $(IDSDIR)
1b95f396 72 $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8
f17b962b 73
82ce97c9 74uninstall: all
c83293eb 75 rm -f $(SBINDIR)/lspci $(SBINDIR)/setpci $(SBINDIR)/update-pciids
54e13765 76 rm -f $(IDSDIR)/pci.ids
c83293eb 77 rm -f $(MANDIR)/man8/lspci.8 $(MANDIR)/man8/setpci.8 $(MANDIR)/man8/update-pciids.8
82ce97c9 78
a33d0eb7
MM
79get-ids:
80 cp ~/tree/pciids/pci.ids pci.ids
81
11f7b31b 82.PHONY: all clean distclean install uninstall get-ids force