dotfiles/Makefile

49 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2017-02-17 20:34:59 -05:00
LN_FLAGS = -sfnv
MKDIR_FLAGS = -pv
2021-01-25 14:54:01 -05:00
home_symlinks = Xresources xbindkeysrc xinitrc vimrc vim tmux.conf gitconfig bashrc
2017-02-17 20:34:59 -05:00
2021-07-21 14:00:12 -04:00
# apparmor doesn't work with symlinks (redshift)
config_copy = redshift
2017-02-17 20:34:59 -05:00
2021-01-25 14:54:01 -05:00
config_symlinks = i3 alacritty
2017-02-17 20:34:59 -05:00
gnupg_symlinks = gpg-agent.conf
2017-11-18 02:10:59 -05:00
2021-07-21 14:00:12 -04:00
local_install: Xresources xbindkeysrc xinitrc vimrc vim i3 gitconfig gpg-agent.conf bashrc alacritty redshift
2017-11-18 02:10:59 -05:00
2021-01-25 14:54:01 -05:00
mac_local_install: vimrc vim gpg-agent.conf tmux.conf bashrc
2019-11-26 14:18:41 -05:00
2021-01-25 14:54:01 -05:00
remote_install: vim vimrc tmux.conf
2017-02-17 20:34:59 -05:00
.PHONY: $(home_symlinks)
$(home_symlinks):
$(eval DESTDIR := $(shell dirname ~/.$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
test -e $(CURDIR)/$@ && ln $(LN_FLAGS) $(CURDIR)/$@ ~/.$@
.PHONY: $(config_copy)
$(config_copy):
$(eval DESTDIR := $(shell dirname ~/.config/$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
2021-07-21 14:00:12 -04:00
test -e $(CURDIR)/$@ && cp -r --remove-destination -p $(CURDIR)/$@ ~/.config/$@
2017-02-17 20:34:59 -05:00
.PHONY: $(config_symlinks)
$(config_symlinks):
$(eval DESTDIR := $(shell dirname ~/.config/$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
test -e $(CURDIR)/$@ && ln $(LN_FLAGS) $(CURDIR)/$@ ~/.config/$@
.PHONY: $(ssh_symlinks)
$(ssh_symlinks):
$(eval DESTDIR := $(shell dirname ~/.ssh/$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
test -e $(CURDIR)/$@ && ln $(LN_FLAGS) $(CURDIR)/$@ ~/.ssh/$@
.PHONY: $(gnupg_symlinks)
$(gnupg_symlinks):
$(eval DESTDIR := $(shell dirname ~/.gnupg/$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
test -e $(CURDIR)/$@ && ln $(LN_FLAGS) $(CURDIR)/$@ ~/.gnupg/$@