chiark / gitweb /
ead205682ac0502111657dfc8ca87edc95291b60
[elogind.git] / extras / scsi_id / Makefile
1 #
2 # Copyright (C) 2003 IBM
3 #
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.
7 #
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.
12 #
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
16
17 SCSI_ID_VERSION=0.2
18
19 prefix =
20 sbindir =       ${prefix}/sbin
21 mandir =        ${prefix}/usr/share/man
22
23 INSTALL  = /usr/bin/install -c
24 INSTALL_PROGRAM = ${INSTALL}
25 INSTALL_DATA  = ${INSTALL} -m 644
26
27 # Note some of the variables used here are set when built under udev, and
28 # otherwise might not be set.
29
30 override CFLAGS+=-DSCSI_ID_VERSION=\"$(SCSI_ID_VERSION)\" $(DEBUG) -Wall
31
32 PROG=scsi_id
33 SYSFS=-lsysfs
34
35 #
36 # Built static and stripped when built with udev.
37 #
38 # STRIP=-s
39 # LDFLAGS=$(STRIP)
40 LD=$(CC)
41
42 OBJS= scsi_id.o \
43         scsi_serial.o \
44
45 all:    $(PROG)
46
47 # XXX use a compressed man page?
48
49 install: all
50         $(INSTALL_PROGRAM) -D $(PROG) $(sbindir)/$(PROG)
51         $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8
52         
53 uninstall:
54         -rm $(sbindir)/$(PROG)
55         -rm $(mandir)/man8/scsi_id.8
56
57 $(OBJS): scsi_id.h scsi.h
58
59 clean:
60         rm -f $(PROG) $(OBJS)
61
62 $(PROG):        $(OBJS)
63         $(LD) $(LDFLAGS) -o $(PROG) $(CRT0) $(OBJS) $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)