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