-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
94 lines (76 loc) · 2.07 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
83
84
85
86
87
88
89
90
91
92
93
94
.DEFAULT_GOAL := help
DESTDIR ?= $$HOME
PKGS ?= $(sort $(dir $(wildcard */)))
TS := .ts
XMONAD_FILES := \
xmonad/.xmonad/xmonad.hs \
$(shell find xmonad/.xmonad/lib -type f -name '*.hs')
REAL_DIRS := $(addprefix $(DESTDIR)/,\
.config/env\
.config/fish/conf.d .config/fish/completions .config/fish/functions\
.config/qutebrowser\
.config/termite\
.git-templates\
.gnupg .ssh\
.mutt .mutt/temp .offlineimap\
.ncmpcpp .config/mopidy\
.sbt/0.13/plugins\
.stack .xmonad\
.terminfo)
comma:= ,
empty:=
space:= $(empty) $(empty)
$(TS)/.xmonad: $(XMONAD_FILES)
xmonad --recompile
xmonad --restart
@mkdir -p $(@D)
@touch $@
$(REAL_DIRS):
@mkdir -p $@
.PHONY: install
install: ## Install PKGS (all or use PKGS=package)
install: dirs
$(info ===> Install files)
stow -t $(DESTDIR) $(subst $(comma),$(space),$(PKGS))
.PHONY: uninstall
uninstall: ## Uninstall PKGS (all or use PKGS=package)
$(info ===> Uninstall files)
stow -Dt $(DESTDIR) $(subst $(comma),$(space),$(PKGS))
.PHONY: update
update: ## Update and install
update: pull update-submodules install
.PHONY: pull
pull: ## Pull latest changes
$(info ===> Fetch changes)
git pull
.PHONY: config
config: ## Interactive configuration
$(info ==> Start interactive configuration)
@./interactive-config
.PHONY: dconf
dconf:
./apply-dconf $(DESTDIR)/.local/share/dconf
.PHONY: dirs
dirs: ## Make directories to prevent symlinking them
dirs: $(REAL_DIRS)
$(info ===> Make directories)
.PHONY: update-submodules
update-submodules: ## Update all submodules
$(info ===> Update submodules)
git submodule sync
git submodule update --init --recursive --remote
.PHONY: xmonad
xmonad: ## Compile and restart xmonad
xmonad: $(TS)/.xmonad
.PHONY: systemd-reload
systemd-reload: ## Reload systemd
systemctl --user daemon-reload
.PHONY: gems
gems: ## Install system ruby gems
$(info ===> Install gems)
gem install bundler
bundle install --system --gemfile ruby/.Gemfile
.PHONY: help
help: ## Describe tasks
$(info Tasks:)
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)