dotfiles/emacs/makefile

48 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

# -*- mode: makefile-gmake; -*-
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
EMACSD := ~/.emacs.d
# Doom Config
DOOMD := ~/.doom.d
2022-09-20 23:13:40 +00:00
DOOM_URL := https://github.com/doomemacs/doomemacs
include ../lib/shared.mk
2021-11-28 21:33:24 +00:00
up: setup
if [ -e $(EMACSD)/bin/doom ] ; then
2022-09-20 23:13:40 +00:00
~/.emacs.d/bin/doom sync \
2021-11-28 21:33:24 +00:00
; $(report) "doom sync"
2022-09-20 23:13:40 +00:00
~/.emacs.d/bin/doom purge \
2021-11-28 21:33:24 +00:00
; $(report) "doom purge"
else
$(report) debug "doom not setup, so not updating."
fi
down:
$(report) header "Removing Emacs configuration"
rm -rf $(EMACSD) ; $(report) "deleted $(EMACSD)"
$(rm_link) $(DOOMD)
2021-11-28 21:33:24 +00:00
setup:
if (( ! $$+commands[emacs] )) ; then
$(report) debug "Emacs not installed. Skipping install."
elif [[ -v $$SSH_TTY ]] ; then
$(report) debug "This is a SSH connection. Skipping."
else
$(report) header "emacs init"
2020-05-29 00:03:04 +00:00
$(mk_link) $(SRC_DIR) $(DOOMD)
$(MAKE) -C $(SRC_DIR) doom_init
fi
doom_init:
if [ ! -e $(EMACSD) ] ; then
git clone $(DOOM_URL) $(EMACSD)
2022-09-20 23:13:40 +00:00
~/.emacs.d/bin/doom install \
; $(report) "doom install"
2022-09-20 23:13:40 +00:00
~/.emacs.d/bin/doom compile \
; $(report) "doom core compile"
else
$(report) debug "emacsd already exists. Skipping"
fi