dotfiles/emacs/makefile

48 lines
1.1 KiB
Makefile
Raw Normal View History

SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
EMACSD := ~/.emacs.d
# Doom Config
DOOMD := ~/.doom.d
DOOM_URL := https://github.com/hlissner/doom-emacs
include ../lib/shared.mk
install: | init update
init:
$(report) header "emacs init"
ifneq "$(call cmd_exist,emacs)" "true"
$(report) quite "emacs not installed. Skipping install."
else ifeq "$(IS_SSH)" "true"
$(report) quite "This is a ssh connection. Skipping install."
else
$(mk_link) $(SRC_DIR)/doom.d $(DOOMD)
2019-12-13 16:48:21 +00:00
$(MAKE) -C $(SRC_DIR) doom_init
endif
doom_init:
if [ ! -e $(EMACSD) ] ; then \
git clone $(DOOM_URL) $(EMACSD) ;\
~/.emacs.d/bin/doom --yes install ;\
$(report) "doom install" ;\
~/.emacs.d/bin/doom --yes compile ':core' ;\
$(report) "doom core compile" ;\
else ;\
$(report) debug "emacsd already exists" ;\
fi
update:
if [ -e $(EMACSD)/bin/doom ] ; then \
~/.emacs.d/bin/doom --yes purge ;\
$(report) info "doom purge" ;\
~/.emacs.d/bin/doom --yes refresh ;\
$(report) info "doom refresh" ;\
else \
$(report) debug "doom not setup, so not updating." ;\
fi
remove:
$(info => Removing Emacs config)
$(rm_link) $(EMACSD)