multipath-tools: add dependency tracking to Makefiles
[multipath-tools/.git] / libmultipath / prioritizers / Makefile
1 #
2 # Copyright (C) 2007 Christophe Varoqui, <christophe.varoqui@opensvc.com>
3 #
4 include ../../Makefile.inc
5
6 CFLAGS += $(LIB_CFLAGS) -I..
7
8 # If you add or remove a prioritizer also update multipath/multipath.conf.5
9 LIBS = \
10         libprioalua.so \
11         libprioconst.so \
12         libpriodatacore.so \
13         libprioemc.so \
14         libpriohds.so \
15         libpriohp_sw.so \
16         libprioiet.so \
17         libprioontap.so \
18         libpriorandom.so \
19         libpriordac.so \
20         libprioweightedpath.so \
21         libpriopath_latency.so \
22         libpriosysfs.so
23
24 all: $(LIBS)
25
26 libprioalua.so: alua.o alua_rtpg.o
27         $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^
28
29 libpriopath_latency.so: path_latency.o  ../checkers/libsg.o
30         $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^ -lm
31
32 libprio%.so: %.o
33         $(CC) $(LDFLAGS) $(SHARED_FLAGS) -o $@ $^
34
35 install: $(LIBS)
36         $(INSTALL_PROGRAM) -m 755 libprio*.so $(DESTDIR)$(libdir)
37
38 uninstall:
39         for file in $(LIBS); do $(RM) $(DESTDIR)$(libdir)/$$file; done
40
41 clean: dep_clean
42         $(RM) core *.a *.o *.gz *.so
43
44 OBJS = $(LIBS:libprio%.so=%.o) alua_rtpg.o
45 include $(wildcard $(OBJS:.o=.d))
46
47 dep_clean:
48         $(RM) $(OBJS:.o=.d)