PROGS	= scsi_vpd_render

DATAS	= scsihost.conf scsivpd.conf

GEN_SRC	= scsi_vpd_render.c.in

GEN	= $(GEN_SRC:.in=)

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

all:	$(GEN) $(PROGS)

scsi_vpd_render: 	scsi_vpd_render.o ../lib/libvpd.a

scsi_vpd_render.o: 	scsi_vpd_render.c ../lib/util.h

scsi_vpd_render.c:	scsi_vpd_render.c.in
	sed -e "s%@libdir@%$(libdir)%g" $< > $@

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 $(GEN) $(PROGS) *.o *~
