summaryrefslogtreecommitdiff
path: root/extras/scsi_id/Makefile
diff options
context:
space:
mode:
authorpatmans@us.ibm.com <patmans@us.ibm.com>2004-01-16 22:03:50 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:17 -0700
commite996d97835c8d0728a9d4880e9e1f8f285cadf4b (patch)
tree24d013eae9c4a84ee5cbaf3bb28d6270a0bd6cc7 /extras/scsi_id/Makefile
parenteb7a964a7c66e5aff8147026a60c99258454b612 (diff)
[PATCH] update udev scsi_id to scsi_id 0.3
Diffstat (limited to 'extras/scsi_id/Makefile')
-rw-r--r--extras/scsi_id/Makefile29
1 files changed, 20 insertions, 9 deletions
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)