dotties/GNUmakefile

54 lines
1.1 KiB
Makefile

INSTALL += $(HOME)/.profile \
$(HOME)/.vim/bundle/Vundle.vim $(HOME)/.vimrc \
$(HOME)/.aliases aliases \
$(HOME)/.profile.d profileds
ALIASES = $(foreach a,$(wildcard .aliases/*),$(subst .aliases/,$(HOME)/.aliases/,$(a)))
PROFILEDS = $(foreach p,$(wildcard .profile.d/*),$(subst .profile.d/,$(HOME)/.profile.d/,$(p)))
UNAME = $(shell uname)
ifeq ($(UNAME),Darwin)
INSTALL += /opt/local/etc/bashrc.mac \
/opt/local/etc/bashrc
PROFILE = .profile.mac
else
INSTALL += $(HOME)/.bashrc
PROFILE = .profile
endif
install: $(INSTALL)
$(HOME)/.aliases/%: .aliases/%
install -D -m 644 $< $@
aliases: $(ALIASES)
$(HOME)/.profile.d:
mkdir $@
$(HOME)/.profile.d/%: .profile.d/% $(HOME)/.profile.d
cp $< $@
profileds: $(PROFILEDS)
$(HOME)/.profile: $(PROFILE)
cp $< $@
$(HOME)/.bashrc: .bashrc
cp $< $@
/opt/local/etc/bashrc: .bashrc
sudo cp $< $@
/opt/local/etc/bashrc.mac: .bashrc.mac
sudo cp $< $@
$(HOME)/.vimrc: .vimrc
cp $< $@
$(HOME)/.vim/bundle:
mkdir -p $@
$(HOME)/.vim/bundle/Vundle.vim: $(HOME)/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git $@ || cd $@; git pull; exit 0
.PHONY: aliases profileds