[libmultipath] extend the scope of the "rr_min_io" keyword to hwe and mpe
[platform/upstream/multipath-tools.git] / multipath / Makefile
1 # Makefile
2 #
3 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
4 BUILD = glibc
5
6 include ../Makefile.inc
7
8 OBJS = main.o $(MULTIPATHLIB)-$(BUILD).a $(CHECKERSLIB)-$(BUILD).a
9
10 CFLAGS = -pipe -g -Wall -Wunused -Wstrict-prototypes \
11          -I$(multipathdir) -I$(checkersdir)
12
13 ifeq ($(strip $(BUILD)),klibc)
14         OBJS += $(libdm) $(libsysfs)
15 else
16         LDFLAGS += -ldevmapper -lsysfs -lm
17 endif
18
19 EXEC = multipath
20
21 all: $(BUILD)
22
23 prepare:
24         make -C $(multipathdir) prepare
25         rm -f core *.o *.gz
26
27 glibc: prepare $(OBJS)
28         $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
29         $(GZIP) $(EXEC).8 > $(EXEC).8.gz
30         
31 klibc: prepare $(OBJS)
32         $(CC) -static -o $(EXEC) $(CRT0) $(OBJS) $(KLIBC) $(LIBGCC)
33         $(GZIP) $(EXEC).8 > $(EXEC).8.gz
34
35 $(CHECKERSLIB)-$(BUILD).a:
36         make -C $(checkersdir) BUILD=$(BUILD) $(BUILD)
37
38 $(MULTIPATHLIB)-$(BUILD).a:
39         make -C $(multipathdir) BUILD=$(BUILD) $(BUILD)
40
41 install:
42         install -d $(DESTDIR)$(bindir)
43         install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
44         install -d $(DESTDIR)/etc/udev/rules.d
45         install -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
46         install -d $(DESTDIR)$(mandir)
47         install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
48
49 uninstall:
50         rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
51         rm $(DESTDIR)$(bindir)/$(EXEC)
52         rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
53
54 clean:
55         rm -f core *.o $(EXEC) *.gz