From e996d97835c8d0728a9d4880e9e1f8f285cadf4b Mon Sep 17 00:00:00 2001 From: "patmans@us.ibm.com" Date: Fri, 16 Jan 2004 22:03:50 -0800 Subject: [PATCH] update udev scsi_id to scsi_id 0.3 --- extras/scsi_id/Makefile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'extras/scsi_id/Makefile') diff --git a/extras/scsi_id/Makefile b/extras/scsi_id/Makefile index ead205682a..abf48895ad 100644 --- a/extras/scsi_id/Makefile +++ b/extras/scsi_id/Makefile @@ -14,9 +14,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -SCSI_ID_VERSION=0.2 +SCSI_ID_VERSION=0.3 prefix = +etcdir = ${prefix}/etc sbindir = ${prefix}/sbin mandir = ${prefix}/usr/share/man @@ -27,7 +28,7 @@ INSTALL_DATA = ${INSTALL} -m 644 # Note some of the variables used here are set when built under udev, and # otherwise might not be set. -override CFLAGS+=-DSCSI_ID_VERSION=\"$(SCSI_ID_VERSION)\" $(DEBUG) -Wall +override CFLAGS+=-Wall -fno-builtin PROG=scsi_id SYSFS=-lsysfs @@ -39,25 +40,35 @@ SYSFS=-lsysfs # LDFLAGS=$(STRIP) LD=$(CC) -OBJS= scsi_id.o \ - scsi_serial.o \ +OBJS= scsi_id.o scsi_serial.o all: $(PROG) # XXX use a compressed man page? install: all - $(INSTALL_PROGRAM) -D $(PROG) $(sbindir)/$(PROG) + $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(sbindir)/$(PROG) $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8 + @if [ ! -r $(DESTDIR)$(etcdir)/scsi_id.config ]; then \ + echo $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir); \ + $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir)/scsi_id.config; \ + fi uninstall: - -rm $(sbindir)/$(PROG) - -rm $(mandir)/man8/scsi_id.8 + -rm $(DESTDIR)$(sbindir)/$(PROG) + -rm $(DESTDIR)$(mandir)/man8/scsi_id.8 + -rm $(DESTDIR)$(etcdir)/scsi_id.config -$(OBJS): scsi_id.h scsi.h +GEN_HEADER=scsi_id_version.h + +scsi_id_version.h: + @echo "/* This file is auto-generated by the Makefile */" > $@ + @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@ + @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@ +$(OBJS): scsi_id.h scsi.h scsi_id_version.h clean: - rm -f $(PROG) $(OBJS) + rm -f $(PROG) $(OBJS) $(GEN_HEADER) $(PROG): $(OBJS) $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS) -- cgit v1.2.3-54-g00ecf