2005-09-14 19:00:02 +04:00
# Makefile for udev extra invoked from the udev main Makefile
2003-11-13 17:34:36 +03:00
#
# Copyright (C) 2003 IBM
2005-09-14 19:00:02 +04:00
# Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
2003-11-13 17:34:36 +03:00
#
2005-09-14 19:00:02 +04:00
# Released under the GNU General Public License, version 2.
2003-11-13 17:34:36 +03:00
#
2005-09-14 19:00:02 +04:00
SCSI_ID_VERSION = 0.9
PROG = scsi_id
OBJS = scsi_serial.o
HEADERS = scsi_id.h scsi.h scsi_id_version.h
GEN_HEADERS = scsi_id_version.h
MAN_PAGES = scsi_id.8
2003-11-13 17:34:36 +03:00
prefix =
2005-09-14 19:00:02 +04:00
etcdir = ${ prefix } /etc
2005-11-16 06:35:37 +03:00
sbindir = ${ prefix } /sbin
usrbindir = ${ prefix } /usr/bin
usrsbindir = ${ prefix } /usr/sbin
libudevdir = ${ prefix } /lib/udev
2003-12-07 19:55:40 +03:00
mandir = ${ prefix } /usr/share/man
2005-09-14 19:00:02 +04:00
configdir = ${ etcdir } /udev/
2003-11-13 17:34:36 +03:00
2005-09-14 19:00:02 +04:00
INSTALL = /usr/bin/install -c
2003-11-13 17:34:36 +03:00
INSTALL_PROGRAM = ${ INSTALL }
INSTALL_DATA = ${ INSTALL } -m 644
2005-09-14 19:00:02 +04:00
INSTALL_SCRIPT = ${ INSTALL_PROGRAM }
all : $( PROG ) $( MAN_PAGES )
.PHONY : all
.DEFAULT : all
%.o : %.c $( GEN_HEADERS )
2006-01-28 06:44:51 +03:00
$( E) " CC " $@
$( Q) $( CC) -c $( CFLAGS) $< -o $@
2005-09-14 19:00:02 +04:00
$(PROG) : %: $( HEADERS ) %.o $( OBJS )
2006-01-28 06:44:51 +03:00
$( E) " LD " $@
$( Q) $( LD) $( LDFLAGS) $@ .o $( OBJS) -o $@ $( LIBUDEV) $( LIB_OBJS)
2003-11-13 17:34:36 +03:00
2005-09-14 19:00:02 +04:00
scsi_id_version.h :
2006-01-28 06:44:51 +03:00
$( E) " GENHDR " $@
$( Q) echo "/* Generated by make. */" > $@
$( Q) echo \# define SCSI_ID_VERSION \" $( SCSI_ID_VERSION) \" >> $@
$( Q) echo \# define SCSI_ID_CONFIG_FILE \" $( etcdir) /scsi_id.config\" >> $@
2003-11-13 17:34:36 +03:00
2005-09-14 19:00:02 +04:00
# man pages
%.8 : %.xml
2006-01-28 06:44:51 +03:00
$( E) " XMLTO " $@
$( Q) xmlto man $?
2005-09-14 19:00:02 +04:00
.PRECIOUS : %.8
2003-11-13 17:34:36 +03:00
2005-09-14 19:00:02 +04:00
clean :
2006-01-28 06:44:51 +03:00
$( E) " CLEAN "
$( Q) rm -f $( PROG) $( OBJS) $( GEN_HEADERS)
2005-09-14 19:00:02 +04:00
.PHONY : clean
2003-12-07 19:55:40 +03:00
2005-09-14 16:27:28 +04:00
install-bin : all
2006-03-29 16:44:41 +04:00
$( INSTALL_PROGRAM) -D $( PROG) $( DESTDIR) $( libudevdir) /$( PROG)
ln -sf $( DESTDIR) $( libudevdir) /$( PROG) $( DESTDIR) $( sbindir) /$( PROG)
2005-09-14 19:00:02 +04:00
.PHONY : install -bin
uninstall-bin :
2006-03-29 16:44:41 +04:00
- rm $( DESTDIR) $( libudevdir) /$( PROG)
- rm -f $( DESTDIR) $( sbindir) /$( PROG)
2005-09-14 19:00:02 +04:00
.PHONY : uninstall -bin
2005-09-14 16:27:28 +04:00
install-man :
2003-12-07 19:55:40 +03:00
$( INSTALL_DATA) -D scsi_id.8 $( DESTDIR) $( mandir) /man8/scsi_id.8
2005-09-14 19:00:02 +04:00
.PHONY : uninstall -man
uninstall-man :
2005-10-27 20:42:52 +04:00
-rm -f $( DESTDIR) $( mandir) /man8/scsi_id.8
2005-09-14 19:00:02 +04:00
.PHONY : uninstall -man
2005-09-14 16:27:28 +04:00
install-config :
2006-01-28 06:44:51 +03:00
@ if [ ! -r $( DESTDIR) $( etcdir) /scsi_id.config ] ; then \
2004-01-17 09:03:50 +03:00
echo $( INSTALL_DATA) -D ./scsi_id.config $( DESTDIR) $( etcdir) ; \
$( INSTALL_DATA) -D ./scsi_id.config $( DESTDIR) $( etcdir) /scsi_id.config; \
fi
2005-09-14 19:00:02 +04:00
.PHONY : install -config
2004-10-16 05:49:27 +04:00
2005-09-14 19:29:27 +04:00
install : all install -bin install -config install -man
.PHONY : install
2005-08-01 03:33:36 +04:00
2005-09-14 19:29:27 +04:00
uninstall : uninstall -bin uninstall -man
.PHONY : uninstall