2 # Copyright (C) 2003 IBM
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; version 2 of the License.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 etcdir = ${prefix}/etc
21 sbindir = ${prefix}/sbin
22 mandir = ${prefix}/usr/share/man
24 INSTALL = /usr/bin/install -c
25 INSTALL_PROGRAM = ${INSTALL}
26 INSTALL_DATA = ${INSTALL} -m 644
28 # Note some of the variables used here are set when built under udev, and
29 # otherwise might not be set.
31 override CFLAGS+=-Wall -fno-builtin
35 SYSFS = ../../libsysfs/sysfs_bus.o \
36 ../../libsysfs/sysfs_class.o \
37 ../../libsysfs/sysfs_device.o \
38 ../../libsysfs/sysfs_dir.o \
39 ../../libsysfs/sysfs_driver.o \
40 ../../libsysfs/sysfs_utils.o \
41 ../../libsysfs/dlist.o
43 # Built static and stripped when built with udev.
49 OBJS= scsi_id.o scsi_serial.o
53 # XXX use a compressed man page?
56 $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
57 $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8
58 @if [ ! -r $(DESTDIR)$(etcdir)/scsi_id.config ]; then \
59 echo $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir); \
60 $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir)/scsi_id.config; \
64 -rm $(DESTDIR)$(sbindir)/$(PROG)
65 -rm $(DESTDIR)$(mandir)/man8/scsi_id.8
66 -rm $(DESTDIR)$(etcdir)/scsi_id.config
68 GEN_HEADER=scsi_id_version.h
71 @echo "/* This file is auto-generated by the Makefile */" > $@
72 @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@
73 @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@
74 $(OBJS): scsi_id.h scsi.h scsi_id_version.h
77 rm -f $(PROG) $(OBJS) $(GEN_HEADER)
82 $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)