branch: elpa/vm
commit 86cea5526c7dee8d185a6f64bad1dadc14816efa
Author: Mark Diekhans <[email protected]>
Commit: Mark Diekhans <[email protected]>

    added uninstall target
---
 Makefile.in         | 20 +++++++++++---
 configure.ac        |  7 +----
 info/Makefile.in    | 36 ++++++++----------------
 lisp/Makefile.in    | 79 +++++++++++++++--------------------------------------
 pixmaps/Makefile.in | 44 +++++++++++++++++++++--------
 5 files changed, 83 insertions(+), 103 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index f85d73dc8b5..452cbb4baac 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,6 +3,7 @@
 # location of required programms
 GIT = git
 MKDIR = @MKDIR@
+RMDIR = @RMDIR@
 TAR = @TAR@
 RM   = @RM@
 XARGS = @XARGS@
@@ -14,6 +15,7 @@ EMACS_PROG = @EMACS_PROG@
 prefix = @prefix@
 srcdir = @srcdir@
 datarootdir = @datarootdir@
+etcdir = @etcdir@
 docdir = @docdir@
 
 SUBDIRS = lisp info pixmaps
@@ -43,7 +45,7 @@ Makefile:  @srcdir@/Makefile.in config.status
        ./config.status $@
 
 @srcdir@/configure: @srcdir@/configure.ac
-       cd @srcdir@ ; autoconf
+       cd @srcdir@ && autoconf
        ./config.status --recheck
 
 config.status: @srcdir@/configure
@@ -53,12 +55,22 @@ install: install-pkg
        @for i in $(SUBDIRS) ; do ($(MAKE) -C $$i install) || exit 1; done
 
 install-pkg:
-       $(MKDIR) -p "$(DESTDIR)$(docdir)"
+       @$(MKDIR) -p "$(DESTDIR)$(docdir)"
        for i in $(SOURCES) ; do                                  \
            echo "Installing $$i in '$(DESTDIR)$(docdir)'" ;      \
            $(INSTALL_DATA) $$i "$(DESTDIR)$(docdir)" ;           \
        done ;
 
+uninstall: uninstall-pkg
+       @for i in $(SUBDIRS) ; do ($(MAKE) -C $$i uninstall) || exit 1; done
+       -$(RMDIR) $(DESTDIR)$(docdir)/ 2> /dev/null
+
+uninstall-pkg:
+       @for i in $(SOURCES) ; do                                  \
+           echo "Uninstalling $$i from '$(DESTDIR)$(docdir)'" ;  \
+           $(RM) -f "$(DESTDIR)$(docdir)/$$i" ;                     \
+       done ;
+
 clean:
        @for i in $(SUBDIRS) ; do ($(MAKE) -C $$i clean) || exit 1; done
 
@@ -138,8 +150,8 @@ xemacs-package:
        echo "         :type 'regular)" >> $(PKGINFO)
        mkdir $(PKGDIR)/pkginfo;
        touch $(PKGDIR)/pkginfo/MANIFEST.vm;
-       cd $(PKGDIR); find -type f | cut -c3- > pkginfo/MANIFEST.vm
-       cd ,,package; $(TAR) -cvzf ../vm-pkg.tar.gz *
+       cd $(PKGDIR) && find -type f | cut -c3- > pkginfo/MANIFEST.vm
+       cd ,,package && $(TAR) -cvzf ../vm-pkg.tar.gz *
 
 ##############################################################################
 tags::
diff --git a/configure.ac b/configure.ac
index 06a0179bb32..f266a1b34f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,6 +254,7 @@ AC_PROG_LN_S
 AC_PATH_PROG(RM, rm, /bin/rm)
 AC_PATH_PROG(LS, ls, /bin/ls)
 AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir)
+AC_PATH_PROG(RMDIR, rmdir, /bin/rmdir)
 AC_PATH_PROG(GREP, grep, /bin/grep)
 
 # External programs checking:
@@ -271,12 +272,6 @@ VM_OTHERDIRS
 VM_ARG_SUBST([PACKAGEDIR], [package-dir], [DIR],
   [set the Emacs package directory to DIR],)
 
-VM_ARG_SUBST([SYMLINKS], [symlinks], [],
-  [install VM by linking instead of copying], [no])
-
-VM_ARG_SUBST([LINKPATH], [linkpath], [PATH],
-  [path to symlink from if `pwd' does not work])
-
 AC_OUTPUT
 
 # configure.ac ends here
diff --git a/info/Makefile.in b/info/Makefile.in
index 9f7d0d41142..a6fb8b96bcc 100644
--- a/info/Makefile.in
+++ b/info/Makefile.in
@@ -10,6 +10,7 @@ GIT_DIR = "@top_srcdir@/.git"
 ##############################################################################
 # location of required programms
 MKDIR = @MKDIR@
+RMDIR = @RMDIR@
 RM   = @RM@
 LS   = @LS@
 XARGS = @XARGS@
@@ -28,9 +29,6 @@ EMACS_FLAVOR = @EMACS_FLAVOR@
 
 FLAGS = @FLAGS@
 
-SYMLINKS = @SYMLINKS@
-LINKPATH = @LINKPATH@
-
 ##############################################################################
 
 all: info
@@ -52,34 +50,22 @@ vm-pcrisis.info:: version.texinfo
 info: vm.info vm-pcrisis.info
 
 Makefile: @srcdir@/Makefile.in
-       cd @srcdir@/..; ./config.status
+       cd @srcdir@/.. && ./config.status
 
 install: install-pkg
+uninstall: uninstall-pkg
 
 install-pkg: uninstall-pkg info
-       @mkdir -p -m 0755 "$(DESTDIR)$(infodir)";                      \
-       if test "x$(SYMLINKS)" = "xno" ; then                          \
-          for i in `${LS} *.info* ` ; do                               \
-           echo "Installing $$i in $(DESTDIR)$(infodir)" ;            \
-            $(INSTALL_DATA) $$i "$(DESTDIR)$(infodir)" ;               \
-          done ;                                                       \
-        else                                                           \
-          if test "x$(LINKPATH)" = "x" ; then                          \
-            for i in `${LS} *.info* ` ; do                             \
-              echo "Linking $$i in $(DESTDIR)$(infodir)" ;             \
-              $(LN_S) "`pwd`/$$i" "$(DESTDIR)$(infodir)/$$i" ;         \
-            done ;                                                     \
-          else                                                         \
-            for i in `${LS} *.info* ` ; do                             \
-              echo "Linking $(LINKPATH)/texinfo/$$i in $(DESTDIR)$(infodir)" ; 
\
-              $(LN_S) "$(LINKPATH)/texinfo/$$i" "$(DESTDIR)$(infodir)/$$i" ; \
-            done ;                                                     \
-          fi ;                                                         \
-        fi
-       @echo VM INFO files successfully installed\!
+       @$(MKDIR) -p -m 0755 "$(DESTDIR)$(infodir)";                     \
+       for i in `${LS} *.info* ` ; do                               \
+         echo "Installing $$i in $(DESTDIR)$(infodir)" ;            \
+         $(INSTALL_DATA) $$i "$(DESTDIR)$(infodir)" ;               \
+       done
+       @echo VM INFO files successfully installed
 
 uninstall-pkg:
-       -$(RM) "$(DESTDIR)$(infodir)"/vm*.info*
+       -$(RM) -f "$(DESTDIR)$(infodir)"/vm*.info*
+       -$(RMDIR) $(DESTDIR)$(infodir)/ 2> /dev/null
 
 ##############################################################################
 clean:
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index bfb92a7f478..6eebed70d59 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -87,6 +87,8 @@ AUTOLOAD_FILE = (setq generated-autoload-file 
\"./auto-autoloads.el\")
 # location of required programms
 RM   = @RM@
 LS   = @LS@
+MKDIR = @MKDIR@
+RMDIR = @RMDIR@
 XARGS = @XARGS@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -109,9 +111,6 @@ FLAGS = @FLAGS@
 
 EMACS_COMP = OTHERDIRS=@OTHERDIRS@ "$(EMACS_PROG)" $(FLAGS)
 
-SYMLINKS = @SYMLINKS@
-LINKPATH = @LINKPATH@
-
 .el.elc:
        $(EMACS_COMP) -f batch-byte-compile $<
 
@@ -120,7 +119,9 @@ all: $(OBJECTS)
 
 $(OBJECTS): $(AUTOLOADS)
 
-install: install-el install-elc
+install: install-pkg
+
+uninstall: uninstall-pkg
 
 ##############################################################################
 # Create file with version and commit
@@ -146,7 +147,7 @@ vm-version-conf.el: Makefile
 vm-autoloads.el: $(SOURCES:%=@srcdir@/%)
        -$(RM) -f $@
        echo > [email protected]
-       (build_dir="`pwd`"; cd "@srcdir@"; \
+       (build_dir="`pwd`"; cd "@srcdir@" && \
         $(EMACS_COMP) -l autoload \
                -f vm-built-autoloads "@abs_builddir@/[email protected]" "`pwd`")
        echo "(custom-add-load 'vm 'vm-cus-load)" | tr -d '\015' >> [email protected]
@@ -160,10 +161,6 @@ vm-autoloads.el: $(SOURCES:%=@srcdir@/%)
 
 vm-cus-load.el: $(SOURCES:%=@srcdir@/%)
        $(EMACS_COMP) -f vm-custom-make-dependencies .
-       if [ "@EMACS_VERSION" = "21" ] ; then \
-           sed -e "s/provide 'cus-load/provide 'vm-cus-load/" cus-load.el > $@ 
;\
-          $(RM) cus-load.el ;\
-        fi
 
 ##############################################################################
 # XEmacs#s auto-autoloads and custom-load file
@@ -191,57 +188,25 @@ custom-load.el: $(SOURCES:%=@srcdir@/%)
 
 ##############################################################################
 install-pkg: all $(INSTALL_FILES)
-       @if test "x$(SYMLINKS)" = "xno" ; then                 \
-         mkdir -p -m 0755 $(DESTDIR)$(PACKAGEDIR);            \
-         for i in $(SOURCES:%=@srcdir@/%) $(INSTALL_FILES) ; do  \
-           echo "Installing $$i in $(DESTDIR)$(PACKAGEDIR)" ; \
-           $(INSTALL_DATA) $$i $(DESTDIR)$(PACKAGEDIR) ;      \
-         done ;                                               \
-       else                                                   \
-         if test "x$(LINKPATH)" = "x" ; then                  \
-           $(LN_S) "`pwd`" $(DESTDIR)$(PACKAGEDIR) ;          \
-         else                                                 \
-           $(LN_S) $(LINKPATH)/lisp $(DESTDIR)$(PACKAGEDIR) ; \
-         fi ;                                                 \
-       fi
-       @echo VM ELISP files successfully installed\!
-
-# This entry will never install .el files if there are no .elc files.
-install-el: all $(INSTALL_FILES)
-       $(INSTALL) -d -m 0755 "$(DESTDIR)$(lispdir)/"
-       for elc in *.elc; do                                                  \
-           el=`basename $$elc c`;                                            \
-           if test -f "$(srcdir)/$$el"; then                                 \
-               echo "Install $$el in $(DESTDIR)$(lispdir)/";                 \
-               $(INSTALL_DATA) "${srcdir}/$$el" "$(DESTDIR)$(lispdir)/";     \
-           fi;                                                               \
-        done;
-       if $(LS) $(contrib)/*.elc > /dev/null 2>&1; then                      \
-           for elc in $(contribdir)/*.elc; do                                \
-               el=`basename $$elc c`;                                        \
-               if test -f "${srcdir}/$(contribdir)/$$el"; then               \
-                   echo "Install $(contribdir)/$$el in $(DESTDIR)$(lispdir)/"; 
\
-                   $(INSTALL_DATA) "${srcdir}/$(contribdir)/$$el" 
"$(DESTDIR)$(lispdir)/"; \
-               fi;                                                           \
-           done;                                                             \
-       fi;
-
-install-elc: all $(INSTALL_FILES)
-       $(INSTALL) -d -m 0755 "$(DESTDIR)$(lispdir)/"
-       for elc in *.elc; do                                 \
-           echo "Install $$elc in $(DESTDIR)$(lispdir)/";   \
-           $(INSTALL_DATA) $$elc "$(DESTDIR)$(lispdir)/";   \
-        done;
-       if $(LS) $(contribdir)/*.elc > /dev/null 2>&1; then  \
-           for elc in $(contribdir)/*.elc; do               \
-               echo "Install $$elc in $(DESTDIR)$(lispdir)"; \
-               $(INSTALL_DATA) $$elc "$(DESTDIR)$(lispdir)"; \
-           done;                                            \
-       fi;
+       @mkdir -p -m 0755 $(DESTDIR)$(lispdir);               \
+       for i in $(SOURCES:%=@srcdir@/%) $(INSTALL_FILES) ; do  \
+         echo "Installing $$i in $(DESTDIR)$(lispdir)" ;    \
+         $(INSTALL_DATA) $$i $(DESTDIR)$(lispdir) ;         \
+       done
+       @echo VM ELISP files successfully installed
+
+uninstall-pkg: $(INSTALL_FILES)
+       @for i in $(SOURCES:%=@srcdir@/%) $(INSTALL_FILES) ; do  \
+         echo "Unnstalling $$i from $(DESTDIR)$(lispdir)" ; \
+         $(RM) -f $(DESTDIR)$(lispdir)/$$i ;                  \
+       done
+       -$(RMDIR) $(DESTDIR)$(lispdir)/ 2> /dev/null
+       @echo VM ELISP files successfully uninstalled
+
 
 ##############################################################################
 Makefile: @srcdir@/Makefile.in
-       cd .. ; ./config.status
+       cd @srcdir@/.. && ./config.status
 
 ##############################################################################
 clean:
diff --git a/pixmaps/Makefile.in b/pixmaps/Makefile.in
index 78a6017fec3..0d16075a41d 100644
--- a/pixmaps/Makefile.in
+++ b/pixmaps/Makefile.in
@@ -6,6 +6,7 @@ SHELL = /bin/sh
 ##############################################################################
 # location of required programms
 MKDIR = @MKDIR@
+RMDIR = @RMDIR@
 RM   = @RM@
 LS   = @LS@
 INSTALL = @INSTALL@
@@ -15,35 +16,56 @@ prefix = @prefix@
 srcdir = @srcdir@
 pixmapdir = @pixmapdir@
 
-SYMLINKS = @SYMLINKS@
-LINKPATH = @LINKPATH@
-
 ##############################################################################
 
 all:
 
 Makefile: @srcdir@/Makefile.in
-       cd @srcdir@/..; ./config.status
+       cd @srcdir@/.. && ./config.status
 
 install: install-pkg
 
+uninstall: uninstall-pkg
+
+
+##############################################################################
 install-pkg: 
        $(MKDIR) -p "$(DESTDIR)$(pixmapdir)"
-       for i in `$(LS) *.xpm` ; do                                    \
+       @for i in *.xpm ; do                                    \
            echo "Installing $$i in '$(DESTDIR)$(pixmapdir)'" ;        \
            $(INSTALL_DATA) $$i "$(DESTDIR)$(pixmapdir)" ;             \
-       done ;
+       done
        $(MKDIR) -p "$(DESTDIR)$(pixmapdir)/mime"
-       for i in `ls mime/*.xpm` ; do                                  \
+       @for i in mime/*.xpm ; do                                  \
            echo "Installing $$i in '$(DESTDIR)$(pixmapdir)'" ;        \
            $(INSTALL_DATA) $$i "$(DESTDIR)$(pixmapdir)/mime" ;        \
-       done ;                                                         
+       done
        $(MKDIR) -p "$(DESTDIR)$(pixmapdir)/gtk"
-       for i in `ls gtk/*.xpm` ; do                                   \
+       @for i in gtk/*.xpm ; do                                   \
            echo "Installing $$i in '$(DESTDIR)$(pixmapdir)'" ;        \
            $(INSTALL_DATA) $$i "$(DESTDIR)$(pixmapdir)/gtk" ;         \
-       done ;                                                         
-       @echo VM pixmaps successfully installed\!
+       done
+       @echo VM pixmaps successfully installed
+
+##############################################################################
+uninstall-pkg: 
+       @for i in mime/*.xpm ; do                                  \
+           echo "Uninstalling $$i from '$(DESTDIR)$(pixmapdir)'" ;        \
+           rm -f "$(DESTDIR)$(pixmapdir)/$$i" ;        \
+       done
+       -$(RMDIR) "$(DESTDIR)$(pixmapdir)/mime" 2> /dev/null
+       @for i in gtk/*.xpm ; do                                   \
+           echo "Uninstalling $$i from '$(DESTDIR)$(pixmapdir)'" ;        \
+           rm -f "$(DESTDIR)$(pixmapdir)/$$i" ;         \
+       done
+       -$(RMDIR) "$(DESTDIR)$(pixmapdir)/gtk" 2> /dev/null
+       @for i in *.xpm ; do                                    \
+           echo "Uninstalling $$i from '$(DESTDIR)$(pixmapdir)'" ;        \
+           rm -f "$(DESTDIR)$(pixmapdir)/$$i" ;             \
+       done
+       -$(RMDIR) "$(DESTDIR)$(pixmapdir)/" 2> /dev/null
+       @echo VM pixmaps successfully uninstalled
+
 
 ##############################################################################
 clean:

Reply via email to