multipath-tools: DESTDIR makefiles cleanup
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 11 Jun 2008 18:46:16 +0000 (13:46 -0500)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Mon, 30 Jun 2008 21:30:21 +0000 (23:30 +0200)
This patch makes the $(DESTDIR) makefile option for multipath-tools more
useful. First, it makes sure that everything that's installed uses it.
Second, it removes the forced root installs, so that you can can install
to any $(DESTDIR) that you have permissions for, even if you aren't
root.

Signed-off-by: Benjamin Marzinski <bmarzins redhat com>
libmultipath/Makefile
libmultipath/checkers/Makefile
libmultipath/prioritizers/Makefile

index 05bcc37..21fcd74 100644 (file)
@@ -26,11 +26,11 @@ $(LIBS): $(OBJS)
        $(CC) $(SHARED_FLAGS) $(CFLAGS) -o $@ $(OBJS)
 
 install:
-       $(INSTALL_PROGRAM) -o root -g root -m 755 -d $(libdir)
-       $(INSTALL_PROGRAM) -o root -g root -m 755 $(LIBS) $(libdir)/$(LIBS)
+       $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir)
+       $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(libdir)/$(LIBS)
 
 uninstall:
-       rm -f $(libdir)/$(LIBS)
+       rm -f $(DESTDIR)$(libdir)/$(LIBS)
 
 clean:
        rm -f core *.a *.o *.gz *.so
index 9b517f2..a20dfac 100644 (file)
@@ -21,10 +21,10 @@ libcheck%.so: libsg.o %.o
        $(CC) $(SHARED_FLAGS) -o $@ $^
 
 install:
-       $(INSTALL_PROGRAM) -o root -g root -m 755 $(LIBS) $(libdir)
+       $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(libdir)
 
 uninstall:
-       rm -f $(libdir)/$(LIBS)
+       rm -f $(DESTDIR)$(libdir)/$(LIBS)
 
 clean:
        rm -f core *.a *.o *.gz *.so
index c05d457..1f70ef1 100644 (file)
@@ -25,10 +25,10 @@ libprio%.so: %.o
        $(CC) $(SHARED_FLAGS) -o $@ $^
 
 install: $(LIBS)
-       install -m 755 libprio*.so $(libdir)
+       $(INSTALL_PROGRAM) -m 755 libprio*.so $(DESTDIR)$(libdir)
 
 uninstall:
-       rm -f $(libdir)/libprio*.so
+       rm -f $(DESTDIR)$(libdir)/libprio*.so
 
 clean:
        rm -f core *.a *.o *.gz *.so