3 # Copyright (C) 2003 Christophe Varoqui, <christophe.varoqui@free.fr>
6 include ../Makefile.inc
8 OBJS = main.o $(MULTIPATHLIB)-$(BUILD).a $(CHECKERSLIB)-$(BUILD).a
10 CFLAGS += -I$(multipathdir) -I$(checkersdir)
12 ifeq ($(strip $(BUILD)),klibc)
13 OBJS += $(libdm) $(libsysfs)
15 LDFLAGS += -ldevmapper -lsysfs
23 make -C $(multipathdir) prepare
26 glibc: prepare $(OBJS)
27 $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
28 $(GZIP) $(EXEC).8 > $(EXEC).8.gz
30 klibc: prepare $(OBJS)
31 $(CC) -static -o $(EXEC) $(CRT0) $(OBJS) $(KLIBC) $(LIBGCC)
32 $(GZIP) $(EXEC).8 > $(EXEC).8.gz
34 $(CHECKERSLIB)-$(BUILD).a:
35 make -C $(checkersdir) BUILD=$(BUILD) $(BUILD)
37 $(MULTIPATHLIB)-$(BUILD).a:
38 make -C $(multipathdir) BUILD=$(BUILD) $(BUILD)
41 install -d $(DESTDIR)$(bindir)
42 install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
43 install -d $(DESTDIR)/etc/udev/rules.d
44 install -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
45 install -d $(DESTDIR)$(mandir)
46 install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
49 rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
50 rm $(DESTDIR)$(bindir)/$(EXEC)
51 rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
54 rm -f core *.o $(EXEC) *.gz