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
37 # Built static and stripped when built with udev.
43 OBJS= scsi_id.o scsi_serial.o
47 # XXX use a compressed man page?
50 $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
51 $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8
52 @if [ ! -r $(DESTDIR)$(etcdir)/scsi_id.config ]; then \
53 echo $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir); \
54 $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir)/scsi_id.config; \
58 -rm $(DESTDIR)$(sbindir)/$(PROG)
59 -rm $(DESTDIR)$(mandir)/man8/scsi_id.8
60 -rm $(DESTDIR)$(etcdir)/scsi_id.config
62 GEN_HEADER=scsi_id_version.h
65 @echo "/* This file is auto-generated by the Makefile */" > $@
66 @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@
67 @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@
68 $(OBJS): scsi_id.h scsi.h scsi_id_version.h
71 rm -f $(PROG) $(OBJS) $(GEN_HEADER)
76 $(QUIET) $(CC) $(CFLAGS) -c -o $@ $<
79 $(QUIET) $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)