3 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
8 exec_prefix = ${prefix}
9 bindir = ${exec_prefix}/sbin
11 klibcdir = $(udevdir)/klibc
12 sysfsdir = $(udevdir)/libsysfs
15 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
16 KERNEL_DIR = /lib/modules/${shell uname -r}/build
17 CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
18 -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
19 -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
22 CRT0 = ../../klibc/klibc/crt0.o
23 LIB = ../../klibc/klibc/libc.a
24 LIBGCC := $(shell $(CC) -print-libgcc-file-name )
26 DMOBJS = libdevmapper/libdm-common.o libdevmapper/ioctl/libdevmapper.o
27 SYSFSOBJS = ../../libsysfs/dlist.o ../../libsysfs/sysfs_bus.o \
28 ../../libsysfs/sysfs_class.o ../../libsysfs/sysfs_device.o \
29 ../../libsysfs/sysfs_dir.o ../../libsysfs/sysfs_driver.o \
30 ../../libsysfs/sysfs_utils.o
32 SUBDIRS = libdevmapper
35 @for dir in $(SUBDIRS); do\
36 $(MAKE) KERNEL_DIR=$(KERNEL_DIR) -C $$dir ; \
46 $(LD) -o $(EXEC) $(CRT0) $(OBJS) $(SYSFSOBJS) $(DMOBJS) $(LIB) $(LIBGCC)
50 rm -f core *.o $(EXEC)
51 $(MAKE) -C libdevmapper clean
55 install -m 755 $(EXEC) $(bindir)/
56 install -d /etc/hotplug.d/scsi/
57 install -m 755 multipath.hotplug /etc/hotplug.d/scsi/
60 rm /etc/hotplug.d/scsi/multipath.hotplug
64 main.o: main.c main.h sg_include.h