Add makefile

master
Paul Walko 2017-02-18 01:34:59 +00:00
parent bafd732e4f
commit 0321881c82
1 changed files with 33 additions and 0 deletions

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
LN_FLAGS = -sfnv
MKDIR_FLAGS = -pv
home_symlinks = aliases
config_copy =
config_symlinks =
all: install
install: aliases
.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)
test -e $(CURDIR)/$@ && cp --remove-destination -p $(CURDIR)/$@ ~/.config/$@
.PHONY: $(config_symlinks)
$(config_symlinks):
$(eval DESTDIR := $(shell dirname ~/.config/$@))
mkdir $(MKDIR_FLAGS) $(DESTDIR)
test -e $(CURDIR)/$@ && ln $(LN_FLAGS) $(CURDIR)/$@ ~/.config/$@
zprofile:
test -e $(CURDIR)/profile && ln $(LN_FLAGS) $(CURDIR)/profile ~/.zprofile