-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (35 loc) · 917 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Makefile for managing my dot-emacs repository
#
# Author: Dylan.Wen <[email protected]>
# Created: Sep 15, 2012
# Time-stamp: <2021-10-17 03:13>
#
QUIET ?= @
#QUIET ?= $(empty) $(empty)
RM := rm -rf
all:
# $(call link-file source dest)
define link-file
if [ -f "$2" ] || [ -L "$2" ] ; then \
echo "$2 already exists!" > /dev/stderr && \
exit 1; \
else \
ln -sf "$1" "$2" && \
echo "link $1 to $2 done."; \
fi
endef
.PHONY : all
all: notice
.PHONY : notice
notice:
$(QUIET) echo "Dylan.Wen's dot-emacs repository."
.PHONY : site-init
site-init: link-early-init link-init
link-init:
$(QUIET) $(call link-file,$(PWD)/dot_emacs,${HOME}/.emacs)
link-early-init:
$(QUIET) $(call link-file,$(PWD)/early-init.el,${HOME}/.emacs.d/early-init.el)
# only for test
.PHONY : remove-links
remove-links:
$(QUIET) $(RM) "${HOME}/.emacs" "${HOME}/.emacs.d/early-init.el"