diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2021-03-29 19:02:00 +0200 |
|---|---|---|
| committer | brotzeit <brotzeitmacher@gmail.com> | 2021-04-23 13:57:07 +0200 |
| commit | 4e394ac993c23b459f658639c4835378adf5da97 (patch) | |
| tree | 7d08738efd3f2f4d68ef3b7e2422f94ff46269be /Makefile | |
| parent | e006788afb581b34288406002c0bc28404b5d9f9 (diff) | |
| download | rust-mode-4e394ac993c23b459f658639c4835378adf5da97.tar.gz | |
Add Makefile
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4460970 --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +-include config.mk + +.PHONY: test + +all: lisp + +PKG = rust-mode + +EMACS ?= emacs +EMACS_ARGS ?= + +ELS = rust-mode.el +ELCS = $(ELS:.el=.elc) + +DEPS = + +LOAD_PATH ?= $(addprefix -L ../,$(DEPS)) +LOAD_PATH += -L . + +lisp: $(ELCS) loaddefs + +%.elc: %.el + @printf "Compiling $<\n" + @$(EMACS) -Q --batch $(EMACS_ARGS) \ + $(LOAD_PATH) --funcall batch-byte-compile $< + +test: + @$(EMACS) -Q --batch -L . -l rust-mode.el \ + -l rust-mode-tests.el -f ert-run-tests-batch-and-exit + +CLEAN = $(ELCS) $(PKG)-autoloads.el + +clean: + @printf "Cleaning...\n" + @rm -rf $(CLEAN) + +loaddefs: $(PKG)-autoloads.el + +define LOADDEFS_TMPL +;;; $(PKG)-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name \ +(or (file-name-directory #$$) (car load-path)))) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; $(PKG)-autoloads.el ends here +endef +export LOADDEFS_TMPL +#' + +$(PKG)-autoloads.el: $(ELS) + @printf "Generating $@\n" + @printf "%s" "$$LOADDEFS_TMPL" > $@ + @$(EMACS) -Q --batch --eval "(progn\ + (setq make-backup-files nil)\ + (setq vc-handled-backends nil)\ + (setq default-directory (file-truename default-directory))\ + (setq generated-autoload-file (expand-file-name \"$@\"))\ + (setq find-file-visit-truename t)\ + (update-directory-autoloads default-directory))" + |
