dotties/GNUmakefile

76 lines
1.7 KiB
Text
Raw Normal View History

DEFAULT_TARGETS += $(HOME)/.profile \
2024-01-06 05:38:53 -06:00
$(HOME)/.vim/bundle/Vundle.vim $(HOME)/.vimrc \
aliases \
$(HOME)/.profile.d profileds
2024-01-30 06:48:26 -06:00
ALIASES = $(foreach a,$(wildcard .aliases/*),$(subst .aliases/,$(HOME)/.aliases/,$(a)))
PROFILEDS = $(foreach p,$(wildcard .profile.d/*),$(subst .profile.d/,$(HOME)/.profile.d/,$(p)))
2024-01-06 05:38:53 -06:00
UNAME = $(shell uname -s)
2024-01-06 05:38:53 -06:00
ifeq ($(UNAME),Darwin)
DEFAULT_TARGETS += /opt/local/etc/bashrc.mac \
2024-01-06 05:38:53 -06:00
/opt/local/etc/bashrc
PROFILE = .profile.mac
INSTALL = ginstall
OPEN = open
2024-04-14 23:50:10 -05:00
else ifeq ($(UNAME),FreeBSD)
DEFAULT_TARGETS += $(HOME)/.bashrc
PROFILE = .profile
INSTALL = ginstall
OPEN = xdg-open
2024-01-06 05:38:53 -06:00
else
DEFAULT_TARGETS += $(HOME)/.bashrc
2024-01-06 05:38:53 -06:00
PROFILE = .profile
INSTALL = install
OPEN = xdg-open
2024-01-06 05:38:53 -06:00
endif
install: $(DEFAULT_TARGETS)
2024-01-06 05:38:53 -06:00
$(HOME)/.aliases/%: .aliases/%
$(INSTALL) -D -m 644 $< $@
2024-01-06 05:38:53 -06:00
aliases: $(ALIASES)
$(HOME)/.profile.d:
mkdir $@
$(HOME)/.profile.d/%: .profile.d/% $(HOME)/.profile.d
cp $< $@
profileds: $(PROFILEDS)
2024-01-06 05:38:53 -06:00
$(HOME)/.profile: $(PROFILE)
cp $< $@
$(HOME)/.bashrc: .bashrc
cp $< $@
2024-01-06 05:38:53 -06:00
/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
2024-02-16 07:13:15 -06:00
git clone https://github.com/VundleVim/Vundle.vim.git $@ || cd $@; git pull; exit 0
2024-01-06 05:38:53 -06:00
.PHONY: aliases profileds README
### README #####################################################################
pub.css:
wget https://github.com/manuelp/pandoc-stylesheet/raw/acac36b976966f76544176161ba826d519b6f40c/pub.css
# Requires Pandoc to be installed
README.html: README.md pub.css
pandoc $< -s -c pub.css -o README.html
$(OPEN) README.html
README: README.html