From 0321881c828fe6968bd79ea8b503919e42ecf7da Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Sat, 18 Feb 2017 01:34:59 +0000 Subject: [PATCH] Add makefile --- Makefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fa553f9 --- /dev/null +++ b/Makefile @@ -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