Tom Willemse
736cf0f37f
Paths on Windows get confused since I use a strange combination of some 4 different GNU/Linux-like systems on Windows (cygwin, msys2, msys git, WSL). Since Windows doesn't support symlinks properly, I can't use GNU Stow to install my files. So for Windows I copy over all the necessary files.
53 lines
1.7 KiB
Makefile
53 lines
1.7 KiB
Makefile
SHELL = bash
|
|
EMACS := emacs
|
|
|
|
.SECONDARY:
|
|
|
|
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)
|
|
|
|
.PHONY: all snippets
|
|
all: $(COMPILED_SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
|
|
|
|
%.elc: %.el
|
|
@echo -e "\e[31mELC\e[0m $<"
|
|
@$(EMACS) -batch \
|
|
-directory "$(HOME)/.emacs.d/site-lisp" \
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/emacs-slack" \
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/circe" \
|
|
-directory "$(HOME)/.emacs.d/vendor-lisp/circe-serenity" \
|
|
-eval "(package-initialize)" \
|
|
-eval "(byte-compile-file \"$<\")"
|
|
|
|
### Site Lisp
|
|
|
|
$(AUTOLOADS_FILE): $(COMPILED_SITE_LISPS)
|
|
@echo -e "\e[32mGEN\e[0m $@"
|
|
@$(EMACS) -batch \
|
|
-eval "(setq generated-autoload-file \"$(BASE_DIR)/$@\")" \
|
|
-eval "(update-directory-autoloads \"$(BASE_DIR)/site-lisp/\")"
|
|
|
|
### Snippets
|
|
|
|
SNIPPET_DIRS = $(wildcard snippets/*)
|
|
COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS))
|
|
|
|
%/.yas-compiled-snippets.el: %/*
|
|
@echo -e "\e[36mYAS\e[0m $(BASE_DIR)/snippets"
|
|
@$(EMACS) -batch \
|
|
-eval "(package-initialize)" \
|
|
-l yasnippet \
|
|
-eval "(yas-compile-directory \"$(BASE_DIR)/snippets\")"
|
|
|
|
snippets: $(COMPILED_SNIPPETS)
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
include windows.mk
|
|
endif
|