branch: externals/phps-mode
commit 236f05ea1fabff2f805f25f9dd7972c73a9852dd
Author: Christian Johansson <christ...@cvj.se>
Commit: Christian Johansson <christ...@cvj.se>
Updated makefile to not use hard-coded path to emacs
---
Makefile | 16 +++++++++++-----
README.md | 8 +++-----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 64b18c6..89a64ee 100644
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,35 @@
-EMACS = "/Users/christianjohansson/Documents/emacs/src/emacs"
+EMACS = emacs
+ifdef emacs
+ EMACS = $(emacs)
+endif
EMACS_CMD := $(EMACS) -Q -batch -L .
EL := phps-mode.el phps-wy.el
ELC := $(EL:.el=.elc)
+.PHONY: clean
clean:
rm -f $(ELC)
+.PHONE: compile
compile:
$(ELC)
%.elc: %.el
$(EMACS_CMD) -f batch-byte-compile $<
-test:
+.PHONY: tests
+tests:
clean test-functions test-lexer test-parser
+.PHONY: test-functions
test-functions:
$(EMACS_CMD) -l phps-test-functions.el
+.PHONY: test-lexer
test-lexer:
$(EMACS_CMD) -l phps-test-lexer.el
-
+.PHONY: test-parser
test-parser:
$(EMACS_CMD) -l phps-test-parser.el
-
-.PHONY: clean compile test test-functions test-lexer test-parser
diff --git a/README.md b/README.md
index a15bc0e..2cfd7c6 100644
--- a/README.md
+++ b/README.md
@@ -20,11 +20,11 @@ With current progress estimates:
## Unit tests
-Not fully ready yet.
+If you have emacs at a customized location prefix the commands with your path,
i.e.
-### Lexer
+`export emacs="~~/Documents/emacs/src/emacs" && make test-lexer`
-Emacs24+ path need to be updated in Makefile first.
+### Lexer
``` bash
make test-lexer
@@ -40,8 +40,6 @@ make test-parser
### Functions
-Emacs24+ path need to be updated in Makefile first.
-
``` bash
make test-functions
```