chiark / gitweb /
[PATCH] add KERNEL_DIR option so that the distros will be happy
[elogind.git] / extras / multipath / Makefile
index 89e6f35185c7ca164c2b809e1a3591ffb9f84172..0aac146a8789781098c429a0f514f9162a27716e 100644 (file)
@@ -4,9 +4,9 @@
 
 EXEC = multipath
 
-prefix      = /usr/local
+prefix      = 
 exec_prefix = ${prefix}
-bindir      = ${exec_prefix}/bin
+bindir      = ${exec_prefix}/sbin
 udevdir            = ../..
 klibcdir    = $(udevdir)/klibc
 sysfsdir    = $(udevdir)/libsysfs
@@ -15,7 +15,7 @@ CC = gcc
 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
 CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
          -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(klibcdir)/linux/include -I$(sysfsdir) -I.
+         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
 
 OBJS = main.o
 CRT0 = ../../klibc/klibc/crt0.o
@@ -32,7 +32,7 @@ SUBDIRS = libdevmapper
 
 recurse:
        @for dir in $(SUBDIRS); do\
-       $(MAKE) -C $$dir ; \
+       $(MAKE) KERNEL_DIR=$(KERNEL_DIR) -C $$dir ; \
        done
        $(MAKE) $(EXEC)
 
@@ -52,6 +52,12 @@ clean:
 install:
        install -d $(bindir)
        install -m 755 $(EXEC) $(bindir)/
+       install -d /etc/hotplug.d/scsi/
+       install -m 755 multipath.hotplug /etc/hotplug.d/scsi/
+
+uninstall:
+       rm /etc/hotplug.d/scsi/multipath.hotplug
+       rm $(bindir)/$(EXEC)
 
 # Code dependencies
 main.o: main.c main.h sg_include.h