mirror of https://github.com/Chizi123/Dotfiles.git

Joel Grunbaum
2020-06-01 1c5cae36bd6847dc97ad2e9fed0e0dca4d0331ad
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
# Targets for install, can be useful to differentiate between user and headless systems
TARGETS = home
 
ifeq ($(VERBOSE),1)
    Q =
else
    Q = @
endif
 
# Commands for operation
MKDIR = $(Q)mkdir -p
STOW  = $(Q)stow
SSTOW = $(Q)sudo stow
ECHO  = @echo
 
INSTALL_TARGETS   = $(TARGETS)
UNINSTALL_TARGETS = $(TARGETS:=-uninstall)
 
# List of all applications with stored dotfiles
CONFIGS = aspell emacs git libinput-gestures mailcap mpd ncmpcpp rtv shells wallpaper-reddit zsh
 
all: help
 
.PHONY: $(CONFIGS)
$(CONFIGS):
    $(STOW) -t $(HOME) $@
 
.PHONY: $(CONFIGS:=-del)
$(CONFIGS:=-del):
    $(STOW) --delete -t $(HOME) $(@:-del=)
 
.PHONY: $(INSTALL_TARGETS)
$(INSTALL_TARGETS): $(CONFIGS)
 
.PHONY: $(UNINSTALL_TARGETS)
$(UNINSTALL_TARGETS): $(CONFIGS:=-del)
 
.PHONY: help
help:
    $(ECHO) 'use make "target"'
    $(ECHO) 'targets:'
    $(ECHO)    '    home(-uninstall)'