Skip to content

Commit

Permalink
Merge pull request #158 from jpdeplaix/master
Browse files Browse the repository at this point in the history
Compile the emacs mode
  • Loading branch information
trefis committed Jan 5, 2014
2 parents 98cdbed + 81a6f05 commit c769f53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ _tags
*.byte
*.pyc
src/ocaml
*.elc
19 changes: 13 additions & 6 deletions Makefile
Expand Up @@ -3,14 +3,17 @@
TARGET = ocamlmerlin.native
#TARGET = src/spine.cmo

TARGET_EMACS = emacs/merlin.elc

OCAMLBUILD=ocamlbuild -Is src,src/config,src/utils,src/ocaml$(TYPER_VERSION),src/ocaml$(TYPER_VERSION)/utils,src/ocaml$(TYPER_VERSION)/typing,src/ocaml$(TYPER_VERSION)/parsing
OCAMLFIND=ocamlfind
EMACS=emacs

DESTDIR ?=
BIN_DIR := $(DESTDIR)$(BIN_DIR)
SHARE_DIR := $(DESTDIR)$(SHARE_DIR)

all: $(TARGET)
all: $(TARGET) $(TARGET_EMACS)

CONFIG_FILES = src/config/my_config.ml src/config/myocamlbuild_config.ml src/ocaml
$(CONFIG_FILES):
Expand All @@ -33,6 +36,9 @@ all_versions:
debug: assert_configured
$(OCAMLBUILD) -cflags -bin-annot -use-ocamlfind $(TARGET) -tag debug

%.elc : %.el
-$(EMACS) --batch --no-init-file -f batch-byte-compile $<

.PHONY: $(TARGET) all dev clean distclean install uninstall assert_configured ocamlmerlin_400 ocamlmerlin_401

clean:
Expand All @@ -53,10 +59,11 @@ install-binary: $(TARGET)
install omake-merlin $(BIN_DIR)/omake-merlin
install jenga-merlin $(BIN_DIR)/jenga-merlin

install-share: $(TARGET)
install-share: $(TARGET) $(TARGET_EMACS)
install -d $(SHARE_DIR)
install -d $(SHARE_DIR)/emacs/site-lisp
install -m 644 emacs/merlin.el $(SHARE_DIR)/emacs/site-lisp/merlin.el
-install -m 644 emacs/merlin.elc $(SHARE_DIR)/emacs/site-lisp/merlin.elc

install-vim: $(TARGET)
install -d $(VIM_DIR)
Expand All @@ -66,21 +73,21 @@ install-vim: $(TARGET)
cp -R vim/merlin/* $(VIM_DIR)

install: install-binary install-share install-vim
@echo
@echo
@echo "Quick setup for VIM"
@echo "-------------------"
@echo "Add $(VIM_DIR) to your runtime path, e.g.:"
@echo " :set rtp+=$(VIM_DIR)"
@echo
@echo
@echo "Quick setup for EMACS"
@echo "-------------------"
@echo "Add $(SHARE_DIR)/emacs/site-lisp to your runtime path, e.g.:"
@echo ' (add-to-list '"'"'load-path "$(SHARE_DIR)/emacs/site-lisp")'
@echo ' (require '"'"'merlin)'
@echo 'Then issue M-x merlin-mode in a ML buffer.'
@echo
@echo
@echo 'Take a look at https://github.com/def-lkb/merlin for more information.'
@echo
@echo

uninstall:
rm -rf $(SHARE_DIR)/ocamlmerlin $(BIN_DIR)/omake-merlin $(BIN_DIR)/ocamlmerlin $(SHARE_DIR)/emacs/site-lisp/merlin.el

0 comments on commit c769f53

Please sign in to comment.