-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (65 loc) · 2.06 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
### @Manage user Emacs packages lifecyle@
# Copyright (C) 2023 Tommaso Rossi
## Author: Tommaso Rossi <[email protected]>
## This file is NOT part of GNU Emacs.
### Commentary:
# Manage lifecycle of user Emacs packages by providing some bindings
# for the Emacs Package Lifecycle Manager.
# make install
# Install all Emacs packages in the user init file.
# Use it when this repo is cloned, before starting
# Emacs for the first time.
#
# make upgrade
# Upgrade all packages to latest versions in the package archives.
# It will modify the lockfile accordingly.
# Use it when full package upgrade is needed.
# Test it a little before committing the lockfile.
# Optionally add "rebuild" command to avoid latency in the
# successive Emacs startup.
#
# make sync-from-lockfile
# Sync current installation with versions specified in lockfile.
# Do it after pulling commits with modifications to lockfile.
# Optionally add "rebuild" command to avoid latency in the
# successive Emacs startup.
#
# make build
# make rebuild
# (they are the same)
# Build all packages after modifications in the packages versions.
# Optionally use it after upgrade or sync for avoiding latency
# in the successive (to version modifications) Emacs startup.
#
# make backup
# Backup the current state (recentf, history, ...)
#
# make uninstall
# Uninstall all packages
#
# make clean
# Clean the user Emacs folder from every package and state file.
EMACS := emacs
EPLM := bin/eplm.el
ROOT_DIR := $(shell pwd)
CACHE_DIR := .cache
PACKAGES_DIR := .cache/straight
BACKUP_DIR := .backups
BACKUP_FILENAME := $(BACKUP_DIR)/emacs-cache-backup-$(shell date +'%s').tgz
ELISP_FUNCALL = $(EMACS) --init-directory=$(ROOT_DIR) --batch --load $(EPLM) --funcall
install:
$(ELISP_FUNCALL) eplm-install
upgrade:
$(ELISP_FUNCALL) eplm-upgrade
sync-from-lockfile:
$(ELISP_FUNCALL) eplm-sync-from-lockfile
build: rebuild
rebuild:
$(ELISP_FUNCALL) eplm-rebuild
uninstall:
rm -rvf $(PACKAGES_DIR)
backup:
mkdir -p $(BACKUP_DIR)
tar -czvf $(BACKUP_FILENAME) $(CACHE_DIR)
clean:
rm -rvf $(CACHE_DIR)