1 # Makefile for udev extra invoked from the udev main Makefile
3 # Copyright (C) 2003 IBM
4 # Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
6 # Released under the GNU General Public License, version 2.
13 HEADERS = scsi_id.h scsi.h scsi_id_version.h
14 GEN_HEADERS = scsi_id_version.h
18 exec_prefix = ${prefix}
19 etcdir = ${prefix}/etc
20 sbindir = ${exec_prefix}/sbin
21 usrbindir = ${exec_prefix}/usr/bin
22 usrsbindir = ${exec_prefix}/usr/sbin
23 mandir = ${prefix}/usr/share/man
24 configdir = ${etcdir}/udev/
27 INSTALL = /usr/bin/install -c
28 INSTALL_PROGRAM = ${INSTALL}
29 INSTALL_DATA = ${INSTALL} -m 644
30 INSTALL_SCRIPT = ${INSTALL_PROGRAM}
32 # be able to run without udev
39 STRIPCMD = $(CROSS)strip
40 CFLAGS += -Wall -pipe -fno-builtin -Wstrict-prototypes -Wsign-compare -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
43 all: $(PROG) $(MAN_PAGES)
47 %.o: %.c $(GEN_HEADERS)
48 $(QUIET) $(CC) -c $(CFLAGS) $< -o $@
50 $(PROG): %: $(HEADERS) %.o $(OBJS)
51 $(QUIET) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIBSYSFS) $(LIB_OBJS)
52 $(QUIET) $(STRIPCMD) $@
55 @echo "/* This file is auto-generated by the Makefile */" > $@
56 @echo \#define SCSI_ID_VERSION \"$(SCSI_ID_VERSION)\" >> $@
57 @echo \#define SCSI_ID_CONFIG_FILE \"$(etcdir)/scsi_id.config\" >> $@
65 rm -f $(PROG) $(OBJS) $(GEN_HEADERS)
69 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
73 - rm $(DESTDIR)$(sbindir)/$(PROG)
77 $(INSTALL_DATA) -D scsi_id.8 $(DESTDIR)$(mandir)/man8/scsi_id.8
81 -rm -f $(mandir)/man8/scsi_id.8
85 @if [ ! -r $(DESTDIR)$(etcdir)/scsi_id.config ]; then \
86 echo $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir); \
87 $(INSTALL_DATA) -D ./scsi_id.config $(DESTDIR)$(etcdir)/scsi_id.config; \
89 .PHONY: install-config
91 install: all install-bin install-config install-man
94 uninstall: uninstall-bin uninstall-man