Skip to content

Commit

Permalink
Add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Mar 18, 2018
1 parent 6ba8791 commit 8ea5392
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.elc
/*-autoloads.el
/.config.mk
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-include .config.mk

PKG = keychain-environment

ELS = $(PKG).el
ELCS = $(ELS:.el=.elc)

DEPS =

EMACS ?= emacs
EMACS_ARGS ?=

LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
LOAD_PATH += -L .

all: lisp

help:
$(info make all - generate byte-code and autoloads)
$(info make lisp - generate byte-code and autoloads)
$(info make clean - remove generated files)
@printf "\n"

lisp: $(ELCS) loaddefs

loaddefs: $(PKG)-autoloads.el

%.elc: %.el
@printf "Compiling $<\n"
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<

CLEAN = $(ELCS) $(PKG)-autoloads.el

clean:
@printf "Cleaning...\n"
@rm -rf $(CLEAN)

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))"

0 comments on commit 8ea5392

Please sign in to comment.