Commits

camlspotter committed 4542ce7

install

Comments (0)

Files changed (2)

ocamlspot/Makefile

 
 .PHONY: clean install installopt beforedepend depend test
 
+# elisp
+
+EMACS=emacs
+
+ELISPS=ocamlspot.el
+
+COMPILECMD=(progn \
+		(setq load-path (cons "." load-path)) \
+		(byte-compile-file "ocamlspot.el"))
+
+install-elisp:
+	@if test "$(EMACSDIR)" = ""; then \
+          set xxx `($(EMACS) --batch --eval "(mapcar 'print load-path)") \
+                   2>/dev/null | \
+                   sed -n -e '/\/site-lisp/s/"//gp'`; \
+          if test "$$2" = ""; then \
+            echo "Cannot determine Emacs site-lisp directory"; \
+            exit 2; \
+          else \
+            $(MAKE) EMACSDIR="$$2" simple-install; \
+	  fi; \
+        else \
+          $(MAKE) simple-install; \
+        fi
+
+# install the .el files, but do not compile them.
+install-el:
+	$(MAKE) NOCOMPILE=true install
+
+simple-install:
+	@echo "Installing in $(EMACSDIR)..."
+	if test -d $(EMACSDIR); then : ; else mkdir -p $(EMACSDIR); fi
+	cp $(ELISPS) $(EMACSDIR)
+	if [ -z "$(NOCOMPILE)" ]; then \
+	  cd $(EMACSDIR); $(EMACS) --batch --eval '$(COMPILECMD)'; \
+	fi
+
 install installopt::
 	cp ocamlspot $(BINDIR)/ocamlspot$(EXE)
 	if test -f ocamlspot.opt; \
 	  then cp ocamlspot.opt $(BINDIR)/ocamlspot.opt$(EXE); else :; fi
+	# The following is optional
+	# $(MAKE) install-emacs-lisp
 
 test: ocamlspot ocamlspot.cmo
 	tests/auto-test.pl ocamlspot.ml treeset.ml xset.ml 

ocamlspot/ocamlspot.el

 ; Write the following to your .emacs
 ;
 ; ; load-path
-; (setq load-path (cons "YOUR-OCAML-SOURCE/ocamlspot/") load-path))
+; (setq load-path (cons "WHERE-YOU-HAVE-INSTALLED-THE-ELISP" load-path))
 ;
 ; ; set the path of the ocamlspot binary
-; (setq ocamlspot-path "YOUR-OCAML-SOURCE/ocamlspot/ocamlspot")
+; (setq ocamlspot-path "WHERE-YOU-HAVE-INSTALLED-THE-BINARIES/ocamlspot")
 ;
 ; ; autoload
 ; (autoload 'ocamlspot-query "ocamlspot" "OCamlSpot")