emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/caml ad39af1 09/14: Simplify the “install” make target


From: ELPA Syncer
Subject: [nongnu] elpa/caml ad39af1 09/14: Simplify the “install” make target
Date: Tue, 24 Aug 2021 05:57:23 -0400 (EDT)

branch: elpa/caml
commit ad39af127e92d3ee4417ce2f12c9327d1ed9211f
Author: Christophe Troestler <Christophe.Troestler@umons.ac.be>
Commit: Christophe Troestler <Christophe.Troestler@umons.ac.be>

    Simplify the “install” make target
---
 Makefile | 36 +++++++++++-------------------------
 1 file changed, 11 insertions(+), 25 deletions(-)

diff --git a/Makefile b/Makefile
index ec2d2c7..b7ab95c 100644
--- a/Makefile
+++ b/Makefile
@@ -25,10 +25,11 @@ FILES=      caml-font.el caml.el camldebug.el      \
        inf-caml.el caml-help.el caml-types.el \
        caml-xemacs.el caml-emacs.el
 
-DIST_FILES = $(FILES) Makefile README* COPYING* CHANGES.md ocamltags.in
+INSTALL_FILES =
+INSTALL_DIR ?= $(shell opam var share)/emacs/site-lisp
+INSTALL_BIN ?= $(shell opam var bin)
 
-# Where to install. If empty, automatically determined.
-#EMACSDIR=
+DIST_FILES = $(FILES) Makefile README* COPYING* CHANGES.md ocamltags.in
 
 # Name of Emacs executable
 EMACSFORMACOSX = /Applications/Emacs.app/Contents/MacOS/Emacs
@@ -66,22 +67,6 @@ COMPILECMD=(progn \
              (byte-compile-file "caml-font.el") \
              (byte-compile-file "camldebug.el"))
 
-install:
-       @if test "$(EMACSDIR)" = ""; then \
-         $(EMACS) --batch --eval 't; see PR#5403'; \
-         set xxx `($(EMACS) --batch --eval "(mapcar 'print load-path)") \
-                               2>/dev/null | \
-                  sed -n -e 's/^"\(.*\/site-lisp\).*/\1/gp' | \
-                  sort -u`; \
-         if test "$$2" = "" -o "$$3" != ""; then \
-           echo "Cannot determine Emacs site-lisp directory:"; \
-            shift; while test "$$1" != ""; do echo "\t$$1"; shift; done; \
-         else \
-         $(MAKE) EMACSDIR="$$2" simple-install; \
-         fi; \
-       else \
-         $(MAKE) simple-install; \
-       fi
 # This is for testing purposes
 compile-only:
        $(EMACS) --batch --eval '$(COMPILECMD)'
@@ -90,12 +75,13 @@ compile-only:
 install-el:
        $(MAKE) NOCOMPILE=true install
 
-simple-install:
-       @echo "Installing in $(EMACSDIR)..."
-       if test -d $(EMACSDIR); then : ; else mkdir -p $(EMACSDIR); fi
-       $(INSTALL_DATA) $(FILES) $(EMACSDIR)
+install:
+       @echo "Installing in $(INSTALL_DIR)..."
+       if test -d $(INSTALL_DIR); then : ; \
+         else $(INSTALL_MKDIR) $(INSTALL_DIR); fi
+       $(INSTALL_DATA) $(FILES) $(INSTALL_DIR)
        if [ -z "$(NOCOMPILE)" ]; then \
-         cd $(EMACSDIR); $(EMACS) --batch --eval '$(COMPILECMD)'; \
+         cd $(INSTALL_DIR); $(EMACS) --batch --eval '$(COMPILECMD)'; \
        fi
 
 ocamltags:     ocamltags.in
@@ -103,7 +89,7 @@ ocamltags:   ocamltags.in
        chmod a+x ocamltags
 
 install-ocamltags: ocamltags
-       $(INSTALL_DATA) ocamltags $(SCRIPTDIR)/ocamltags
+       $(INSTALL_DATA) ocamltags $(INSTALL_BIN)/ocamltags
 
 $(TARBALL): $(DIST_FILES)
        $(INSTALL_MKDIR) $(DIST_NAME)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]