Fix compilation on Windows, add install target
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.
This commit is contained in:
parent
701601ca86
commit
736cf0f37f
2 changed files with 36 additions and 17 deletions
|
@ -3,20 +3,18 @@ EMACS := emacs
|
|||
|
||||
.SECONDARY:
|
||||
|
||||
AUTOLOADS_FILE = site-lisp/site-autoloads.el
|
||||
UNWANTED = $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-%
|
||||
SITE_LISPS = $(addsuffix c,$(filter-out $(UNWANTED),$(wildcard site-lisp/*.el)))
|
||||
INIT_LISPS = init/oni-org-init.elc init/oni-js2-init.elc init/oni-gnus-init.elc \
|
||||
init/oni-cmake-init.elc init/oni-cpp-init.elc \
|
||||
$(addsuffix .elc,$(basename $(wildcard init/*.org)))
|
||||
VENDOR_DIRS = $(wildcard vendor-lisp/*)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
include windows.mk
|
||||
endif
|
||||
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: $(SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
|
||||
all: $(COMPILED_SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
|
||||
|
||||
%.elc: %.el
|
||||
@echo -e "\e[31mELC\e[0m $<"
|
||||
|
@ -30,11 +28,11 @@ all: $(SITE_LISPS) init.elc $(INIT_LISPS) $(AUTOLOADS_FILE) snippets
|
|||
|
||||
### Site Lisp
|
||||
|
||||
$(AUTOLOADS_FILE): $(SITE_LISPS)
|
||||
$(AUTOLOADS_FILE): $(COMPILED_SITE_LISPS)
|
||||
@echo -e "\e[32mGEN\e[0m $@"
|
||||
@$(EMACS) -batch \
|
||||
-eval "(setq generated-autoload-file \"$(CURDIR)/$@\")" \
|
||||
-eval "(update-directory-autoloads \"$(CURDIR)/site-lisp/\")"
|
||||
-eval "(setq generated-autoload-file \"$(BASE_DIR)/$@\")" \
|
||||
-eval "(update-directory-autoloads \"$(BASE_DIR)/site-lisp/\")"
|
||||
|
||||
### Snippets
|
||||
|
||||
|
@ -42,10 +40,14 @@ SNIPPET_DIRS = $(wildcard snippets/*)
|
|||
COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS))
|
||||
|
||||
%/.yas-compiled-snippets.el: %/*
|
||||
@echo -e "\e[36mYAS\e[0m $(CURDIR)/snippets"
|
||||
@echo -e "\e[36mYAS\e[0m $(BASE_DIR)/snippets"
|
||||
@$(EMACS) -batch \
|
||||
-eval "(package-initialize)" \
|
||||
-l yasnippet \
|
||||
-eval "(yas-compile-directory \"$(CURDIR)/snippets\")"
|
||||
-eval "(yas-compile-directory \"$(BASE_DIR)/snippets\")"
|
||||
|
||||
snippets: $(COMPILED_SNIPPETS)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
include windows.mk
|
||||
endif
|
||||
|
|
17
emacs/.emacs.d/windows.mk
Executable file → Normal file
17
emacs/.emacs.d/windows.mk
Executable file → Normal file
|
@ -1,2 +1,19 @@
|
|||
EMACS := C:/msys64/mingw64/bin/emacs.exe
|
||||
HOME := $(APPDATA)
|
||||
INSTALLDIR := $(APPDATA)/.emacs.d
|
||||
BASE_DIR := $(subst \,/,$(shell cygpath -w $(CURDIR)))
|
||||
|
||||
.PHONY: install
|
||||
|
||||
ALL_LISPS := init.el init.elc $(SITE_LISPS) $(COMPILED_SITE_LISPS) \
|
||||
$(INIT_LISPS) $(COMPILED_INIT_LISPS)
|
||||
|
||||
install:
|
||||
for file in $(ALL_LISPS); do \
|
||||
[[ -e $$file ]] && install -Dm 644 $$file "$(INSTALLDIR)/$$file"; \
|
||||
done
|
||||
|
||||
mkdir -p "$(INSTALLDIR)/vendor-lisp/"
|
||||
for dir in $(VENDOR_DIRS); do \
|
||||
cp --recursive $$dir "$(INSTALLDIR)/$$dir"; \
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue