2003-11-13 17:34:36 +03:00
#
# Copyright (C) 2003 IBM
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2005-02-26 10:51:17 +03:00
SCSI_ID_VERSION = 0.9
2003-11-13 17:34:36 +03:00
prefix =
2004-01-17 09:03:50 +03:00
etcdir = ${ prefix } /etc
2003-11-13 17:34:36 +03:00
sbindir = ${ prefix } /sbin
2003-12-07 19:55:40 +03:00
mandir = ${ prefix } /usr/share/man
2003-11-13 17:34:36 +03:00
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${ INSTALL }
INSTALL_DATA = ${ INSTALL } -m 644
2003-12-07 19:55:40 +03:00
# Note some of the variables used here are set when built under udev, and
# otherwise might not be set.
2004-01-17 09:03:50 +03:00
o v e r r i d e CFLAGS += -Wall -fno-builtin
2003-11-13 17:34:36 +03:00
PROG = scsi_id
2004-10-16 05:42:53 +04:00
SYSFS = -lsysfs
2003-11-13 17:34:36 +03:00
2003-12-07 19:55:40 +03:00
#
# Built static and stripped when built with udev.
#
# STRIP=-s
# LDFLAGS=$(STRIP)
LD = $( CC)
2003-11-13 17:34:36 +03:00
2004-01-17 09:03:50 +03:00
OBJS = scsi_id.o scsi_serial.o
2003-11-13 17:34:36 +03:00
all : $( PROG )
2003-12-07 19:55:40 +03:00
# XXX use a compressed man page?
2003-11-13 17:34:36 +03:00
install : all
2004-01-17 09:03:50 +03:00
$( INSTALL_PROGRAM) -D $( PROG) $( DESTDIR) $( sbindir) /$( PROG)
2003-12-07 19:55:40 +03:00
$( INSTALL_DATA) -D scsi_id.8 $( DESTDIR) $( mandir) /man8/scsi_id.8
2004-01-17 09:03:50 +03:00
@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
2003-11-13 17:34:36 +03:00
uninstall :
2004-01-17 09:03:50 +03:00
-rm $( DESTDIR) $( sbindir) /$( PROG)
-rm $( DESTDIR) $( mandir) /man8/scsi_id.8
-rm $( DESTDIR) $( etcdir) /scsi_id.config
2003-11-13 17:34:36 +03:00
2004-01-17 09:03:50 +03:00
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
2003-11-13 17:34:36 +03:00
clean :
2004-01-17 09:03:50 +03:00
rm -f $( PROG) $( OBJS) $( GEN_HEADER)
2003-11-13 17:34:36 +03:00
2004-03-13 10:52:21 +03:00
spotless : clean
2004-06-26 12:18:17 +04:00
2004-10-16 05:49:27 +04:00
.c.o :
$( QUIET) $( CC) $( CFLAGS) -c -o $@ $<
2003-11-13 17:34:36 +03:00
$(PROG) : $( OBJS )
2004-10-16 05:49:27 +04:00
$( QUIET) $( LD) $( LDFLAGS) -o $( PROG) $( CRT0) $( OBJS) $( SYSFS) $( LIB_OBJS) $( ARCH_LIB_OBJS)