PROGS	= ibm_vpd_render pci_vpd_cap_grab pci_vpd_rom_grab pci_lookup

DATAS	= pci.ids

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = $(INSTALL) -m 755
INSTALL_DATA = $(INSTALL) -m 644

all:	$(PROGS)

ibm_vpd_render:		ibm_vpd_render.o \
			pci_vpd_to_txt.o \
			../lib/libvpd.a

pci_vpd_cap_grab:	pci_vpd_cap_grab.o \
			pci_vpd_gen_grab.o \
			../lib/libvpd.a

pci_vpd_rom_grab:	pci_vpd_rom_grab.o \
			pci_vpd_gen_grab.o \
			../lib/libvpd.a

pci_lookup:		pci_lookup.o \
			../lib/libvpd.a

ibm_vpd_render.o:	ibm_vpd_render.c \
			pci_vpd_to_txt.h \
			../lib/util.h

pci_vpd_cap_grab.o:	pci_vpd_cap_grab.c \
			pci_vpd_gen_grab.h \
			../lib/util.h

pci_vpd_rom_grab.o:	pci_vpd_rom_grab.c \
			pci_vpd_gen_grab.h \
			../lib/util.h

pci_vpd_gen_grab.o:	pci_vpd_gen_grab.c \
			../lib/util.h

ibm_vpd_to_txt.o:	ibm_vpd_to_txt.c \
			ibm_vpd_to_txt.h \
			pci_vpd_to_txt.h

pci_vpd_to_txt.o:	pci_vpd_to_txt.c \
			pci_vpd_to_txt.h

pci_lookup.o:		pci_lookup.c \
			../lib/util.h

install:	all
	@ for f in $(PROGS) ; do \
		$(INSTALL_PROGRAM) $$f $(DESTDIR)$(libdir) ;\
	done
	@ for f in $(DATAS) ; do \
		$(INSTALL_DATA) $$f $(DESTDIR)$(libdir) ;\
	done

clean:
	rm -f $(PROGS) *.o *~
