]> git.ipfire.org Git - thirdparty/pciutils.git/blame - Makefile
Typos...
[thirdparty/pciutils.git] / Makefile
CommitLineData
0138a2a7 1# $Id: Makefile,v 1.48 2003/01/04 11:33:25 mj Exp $
98e39e09 2# Makefile for Linux PCI Utilities
e26a5728 3# (c) 1998--2003 Martin Mares <mj@ucw.cz>
98e39e09 4
f17b962b 5OPT=-O2 -fomit-frame-pointer
727ce158 6#OPT=-O2 -g
3db325b7 7CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes
727ce158 8
848b4347 9VERSION=2.1.11
0138a2a7
MM
10#SUFFIX=-pre2
11DATE=2003-01-04
168b4f46 12
14d6c0a3
MM
13INSTALL=install
14DIRINSTALL=install -d
848b4347 15PCILIB=libpci.a
168b4f46
MM
16ifeq ($(shell uname),FreeBSD)
17ROOT=/usr/local
18PREFIX=/usr/local
19else
848b4347
MM
20ifeq ($(shell uname),NetBSD)
21ROOT=$(PREFIX)
22PCILIB=libpciutils.a
23LDFLAGS+=-lpci
24else
14d6c0a3
MM
25ifeq ($(shell uname),AIX)
26ROOT=/usr/local
27PREFIX=/usr/local
28CFLAGS=-g
29INSTALL=installbsd
30DIRINSTALL=mkdir -p
31else
168b4f46
MM
32ROOT=/
33PREFIX=/usr
34endif
14d6c0a3 35endif
848b4347 36endif
f8141ae2 37MANDIR=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi)
a2ea548f 38DISTTMP=/tmp/pciutils-dist
f6c86928 39
727ce158
MM
40export
41
a33d0eb7 42all: lib lspci setpci lspci.8 setpci.8 pci.ids
727ce158
MM
43
44lib: lib/config.h
45 $(MAKE) -C lib all
e4842ff3 46
727ce158
MM
47lib/config.h:
48 cd lib && ./configure $(PREFIX) $(VERSION)
98e39e09 49
7e165fa6
MM
50lspci: lspci.o common.o lib/$(PCILIB)
51setpci: setpci.o common.o lib/$(PCILIB)
727ce158 52
7e165fa6
MM
53lspci.o: lspci.c pciutils.h
54setpci.o: setpci.c pciutils.h
55common.o: common.c pciutils.h
727ce158
MM
56
57%.8: %.man
168b4f46 58 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)$(SUFFIX)/"
98e39e09
MM
59
60clean:
14d6c0a3 61 rm -f `find . -name "*~" -o -name "*.[oa]" -o -name "\#*\#" -o -name TAGS -o -name core`
d6b297d0 62 rm -f lspci setpci lib/config.* *.8
f6c86928 63 rm -rf dist
f17b962b
MM
64
65install: all
ee551b73 66# -c is ignored on Linux, but required on FreeBSD
14d6c0a3
MM
67 $(DIRINSTALL) -m 755 $(ROOT)/sbin $(PREFIX)/share $(MANDIR)/man8
68 $(INSTALL) -c -m 755 -s lspci setpci $(ROOT)/sbin
ee551b73
MM
69 if [ ! -f $(PREFIX)/share/pci.ids -o pci.ids -nt $(PREFIX)/share/pci.ids ] ; then \
70 $(INSTALL) -c -m 644 pci.ids $(PREFIX)/share ; \
71 elif [ -f $(PREFIX)/share/pci.ids ] ; then \
72 echo "$(PREFIX)/share/pci.ids is same or newer than the version to be installed, skipping." ; \
73 fi
14d6c0a3 74 $(INSTALL) -c -m 644 lspci.8 setpci.8 $(MANDIR)/man8
ee551b73 75# Remove relics from old versions
d38471fd 76 rm -f $(ROOT)/etc/pci.ids
f17b962b 77
82ce97c9
MM
78uninstall: all
79 rm -f $(ROOT)/sbin/lspci $(ROOT)/sbin/setpci
65b4327e 80 rm -f $(PREFIX)/share/pci.ids
82ce97c9
MM
81 rm -f $(PREFIX)/man/man8/lspci.8 $(PREFIX)/man/man8/setpci.8
82
a33d0eb7 83update-ids:
e26a5728 84 if [ -f pci.ids.orig ] ; then mv pci.ids pci.ids.orig ; fi
a33d0eb7
MM
85 wget http://pciids.sf.net/pci.ids.bz2
86 bzip2 -d pci.ids.bz2
87
88get-ids:
89 cp ~/tree/pciids/pci.ids pci.ids
90
91pci.ids:
92 @ [ -f pci.ids ] || echo >&2 "The pci.ids file is no longer part of the CVS. Please do make update-ids to download them." && false
93
f6c86928
MM
94release:
95 sed "s/^\\(Version:[ ]*\\)[0-9.]*/\\1$(VERSION)/;s/^\\(Entered-date:[ ]*\\)[0-9]*/\\1`date -d$(DATE) '+%y%m%d'`/;s/\\(pciutils-\\)[0-9.]*/\\1$(VERSION)\\./" <pciutils.lsm >pciutils.lsm.new
96 sed "s/^\\(Version:[ ]*\\)[0-9.]*/\\1$(VERSION)/" <pciutils.spec >pciutils.spec.new
97 sed "s/\\(, version \\).*\./\\1$(VERSION)$(SUFFIX)./" <README >README.new
98 mv pciutils.lsm.new pciutils.lsm
99 mv pciutils.spec.new pciutils.spec
100 mv README.new README
101
4a219d5f 102REL=pciutils-$(VERSION)$(SUFFIX)
f6c86928 103
a33d0eb7 104dist: clean pci.ids
a2ea548f
MM
105 rm -rf $(DISTTMP)
106 mkdir $(DISTTMP)
107 cp -a . $(DISTTMP)/$(REL)
a33d0eb7 108 rm -rf `find $(DISTTMP)/$(REL) -name CVS -o -name tmp -o -name maint`
a2ea548f
MM
109 cd $(DISTTMP) ; tar czvvf /tmp/$(REL).tar.gz $(REL)
110 rm -rf $(DISTTMP)
727ce158 111
41e6513d 112upload: dist
a33d0eb7 113 maint/upload $(REL)
41e6513d 114
a33d0eb7 115.PHONY: all lib clean install uninstall dist man release upload update-ids get-ids