blob: c7f8527f0c0159f5424b40b50618477f5ac3d60a (
plain) (
tree)
|
|
.POSIX:
include ../common.mk
install:
mkdir -p -- ~/.config
if test -L ~/.emacs.d; then \
test "$$(readlink -- ~/.emacs.d)" = .config/emacs; \
else \
set -e; \
if test -d ~/.emacs.d; then \
test ! -e ~/.config/emacs; \
mv -- ~/.emacs.d ~/.config/emacs; \
else \
mkdir -p -- ~/.config/emacs; \
fi; \
ln -sf -- .config/emacs ~/.emacs.d; \
fi
printf '; %s\n\n' 'This file is generated by ~/.dotfiles/emacs/Makefile' > ~/.config/emacs/init.el
cat -- init.el >> ~/.config/emacs/init.el
if $(CHECK_INSTALLED) emacs-go-mode 2>/dev/null; then\
printf '\n' >> ~/.config/emacs/init.el && \
cat -- init-go-mode.el >> ~/.config/emacs/init.el; \
fi
if $(CHECK_INSTALLED) emacs-haskell-mode 2>/dev/null; then\
printf '\n' >> ~/.config/emacs/init.el && \
cat -- init-haskell-mode.el >> ~/.config/emacs/init.el; \
fi
if grep Ubuntu < /etc/lsb-release >/dev/null 2>/dev/null; then \
mkdir -p -- ~/.config/profile.d && \
test ! -d ~/.config/profile.d/emacs && \
ln -sf -- ~/.dotfiles/emacs/user-profile ~/.config/profile.d/emacs; \
fi
mkdir -p -- ~/.local/bin
test ! -d ~/.local/bin/e
ln -sf -- "$$(which emacs)" ~/.local/bin/e
uninstall:
-unlink -- ~/.config/profile.d/emacs
-rmdir -- ~/.config/profile.d
-unlink -- ~/.config/emacs/init.el
-unlink -- ~/.emacs.d
-rmdir -- ~/.config/emacs
-unlink -- ~/.local/bin/e
.PHONY: install uninstall
|