2018-02-07 20:08:53 +01:00
|
|
|
SHELL = bash
|
2018-06-07 19:40:18 +02:00
|
|
|
EMACS := emacs
|
2018-02-07 20:08:53 +01:00
|
|
|
|
2017-03-06 07:10:40 +01:00
|
|
|
.SECONDARY:
|
|
|
|
|
2018-06-13 20:15:49 +02:00
|
|
|
AUTOLOADS_FILE := site-lisp/site-autoloads.el
|
|
|
|
UNWANTED := $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-%
|
|
|
|
SITE_LISPS := $(filter-out $(UNWANTED),$(wildcard site-lisp/*.el))
|
|
|
|
COMPILED_SITE_LISPS := $(addsuffix c,$(SITE_LISPS))
|
|
|
|
INIT_LISPS := init/oni-org-init.el init/oni-js2-init.el init/oni-gnus-init.el \
|
|
|
|
init/oni-cmake-init.el init/oni-cpp-init.el $(wildcard init/*.el)
|
|
|
|
COMPILED_INIT_LISPS := $(addsuffix c,$(INIT_LISPS))
|
|
|
|
VENDOR_DIRS := $(wildcard vendor-lisp/*)
|
|
|
|
BASE_DIR := $(CURDIR)
|
2018-06-07 19:40:18 +02:00
|
|
|
|
2018-06-07 05:48:37 +02:00
|
|
|
.PHONY: all snippets
|
2018-06-13 20:15:49 +02:00
|
|
|
all: $(COMPILED_SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
|
2016-08-05 01:42:39 +02:00
|
|
|
|
|
|
|
%.elc: %.el
|
2016-09-18 00:04:54 +02:00
|
|
|
@echo -e "\e[31mELC\e[0m $<"
|
|
|
|
@$(EMACS) -batch \
|
2016-10-19 21:02:33 +02:00
|
|
|
-directory "$(HOME)/.emacs.d/site-lisp" \
|
2016-11-03 15:25:10 +01:00
|
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/emacs-slack" \
|
|
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/circe" \
|
2016-11-04 14:31:09 +01:00
|
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/circe-serenity" \
|
2016-09-07 14:31:14 +02:00
|
|
|
-eval "(package-initialize)" \
|
|
|
|
-eval "(byte-compile-file \"$<\")"
|
|
|
|
|
|
|
|
### Site Lisp
|
|
|
|
|
2018-06-13 20:15:49 +02:00
|
|
|
$(AUTOLOADS_FILE): $(COMPILED_SITE_LISPS)
|
2016-09-18 00:04:54 +02:00
|
|
|
@echo -e "\e[32mGEN\e[0m $@"
|
|
|
|
@$(EMACS) -batch \
|
2018-06-13 20:15:49 +02:00
|
|
|
-eval "(setq generated-autoload-file \"$(BASE_DIR)/$@\")" \
|
|
|
|
-eval "(update-directory-autoloads \"$(BASE_DIR)/site-lisp/\")"
|
2016-11-24 21:41:10 +01:00
|
|
|
|
|
|
|
### Snippets
|
|
|
|
|
|
|
|
SNIPPET_DIRS = $(wildcard snippets/*)
|
|
|
|
COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS))
|
|
|
|
|
|
|
|
%/.yas-compiled-snippets.el: %/*
|
2018-06-13 20:15:49 +02:00
|
|
|
@echo -e "\e[36mYAS\e[0m $(BASE_DIR)/snippets"
|
2016-11-24 21:41:10 +01:00
|
|
|
@$(EMACS) -batch \
|
|
|
|
-eval "(package-initialize)" \
|
|
|
|
-l yasnippet \
|
2018-06-13 20:15:49 +02:00
|
|
|
-eval "(yas-compile-directory \"$(BASE_DIR)/snippets\")"
|
2016-11-24 21:41:10 +01:00
|
|
|
|
|
|
|
snippets: $(COMPILED_SNIPPETS)
|
2018-06-13 20:15:49 +02:00
|
|
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
include windows.mk
|
|
|
|
endif
|