aboutsummaryrefslogtreecommitdiffstats
path: root/bash/Makefile
blob: e1e62ae651fd77ef0e4c30cc3665e841a35e4e65 (plain) (blame)
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
.POSIX:

install:
	mkdir -p -- ~/.var/cache
	mkdir -p -- ~/.config/bash
	touch -- ~/.var/cache/bash_history
	test ! -d ~/.bash_history
	test ! -d ~/.bash_logout
	test ! -d ~/.bash_profile
	test ! -d ~/.bashrc
	test ! -d ~/.config/bash/logout
	test ! -d ~/.config/bash/profile
	test ! -d ~/.config/bash/bashrc
	test ! -d ~/.config/bash/bashrc_palette
	test ! -d ~/.config/bash/bashrc_prompt
	test ! -d ~/.config/bash/aliases
	test ! -d ~/.config/bash/aliases-Zenith
	ln -sf -- .var/cache/bash_history ~/.bash_history
	ln -sf -- .config/bash/logout ~/.bash_logout
	ln -sf -- .config/bash/profile ~/.bash_profile
	ln -sf -- .config/bash/bashrc ~/.bashrc
	ln -sf -- ~/.dotfiles/bash/logout ~/.config/bash/logout
	ln -sf -- ~/.dotfiles/bash/profile ~/.config/bash/profile
	ln -sf -- ~/.dotfiles/bash/bashrc ~/.config/bash/bashrc
	ln -sf -- ~/.dotfiles/bash/bashrc_palette ~/.config/bash/bashrc_palette
	ln -sf -- ~/.dotfiles/bash/bashrc_prompt ~/.config/bash/bashrc_prompt
	ln -sf -- ~/.dotfiles/bash/aliases ~/.config/bash/aliases
	if test "$$(hostname | tr '[[:upper:]]' '[[:lower:]]')" = zenith; then \
		test "$$(hostname)" = Zenith && \
		pacman -Qq -- asroot </dev/null >/dev/null && \
		pacman -Qq -- gnupg </dev/null >/dev/null && \
		pacman -Qq -- cryptsetup </dev/null >/dev/null && \
		ln -sf -- ~/.dotfiles/bash/aliases-Zenith ~/.config/bash/aliases-Zenith; \
	fi

uninstall:
	-unlink -- ~/.bash_history
	-unlink -- ~/.bash_logout
	-unlink -- ~/.bash_profile
	-unlink -- ~/.bashrc
	-rm -f -- ~/.var/cache/bash_history
	-unlink -- ~/.config/bash/logout
	-unlink -- ~/.config/bash/profile
	-unlink -- ~/.config/bash/bashrc
	-unlink -- ~/.config/bash/bashrc_palette
	-unlink -- ~/.config/bash/bashrc_prompt
	-unlink -- ~/.config/bash/aliases
	-unlink -- ~/.config/bash/aliases-Zenith
	-rmdir -- ~/.config/bash/aliases.d
	-rmdir -- ~/.config/bash/bashrc.d
	-rmdir -- ~/.config/bash

.PHONY: install uninstall