Add libmpathcmd library and use it internally
[multipath-tools/.git] / libmpathcmd / Makefile
1 # Makefile
2 #
3 include ../Makefile.inc
4
5 SONAME=0
6 DEVLIB = libmpathcmd.so
7 LIBS = $(DEVLIB).$(SONAME)
8
9 OBJS = mpath_cmd.o
10
11 all: $(LIBS)
12
13 $(LIBS): $(OBJS)
14         $(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS) $(LIBDEPS)
15         ln -sf $@ $(DEVLIB)
16
17 install: $(LIBS)
18         $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
19         $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS)
20         ln -sf $(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
21         $(INSTALL_PROGRAM) -d $(DESTDIR)$(incdir)
22         $(INSTALL_PROGRAM) -m 755 mpath_cmd.h $(DESTDIR)$(incdir)
23
24 uninstall:
25         rm -f $(DESTDIR)$(syslibdir)/$(LIBS)
26         rm -f $(DESTDIR)$(syslibdir)/$(DEVLIB)
27         rm -f $(DESTDIR)$(incdir)/mpath_cmd.h
28
29 clean:
30         rm -f core *.a *.o *.gz *.so *.so.*