2018-10-15 06:56:56 +02:00
|
|
|
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
|
|
# Copyright (C) 2018 Donovan Glover
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# make Defaults to `make install`
|
|
|
|
# make install Installs dotfiles
|
|
|
|
# make uninstall Uninstalls dotfiles
|
2018-10-16 02:26:44 +02:00
|
|
|
# make prune Removes stale links
|
2018-10-15 06:56:56 +02:00
|
|
|
|
2018-10-23 00:06:27 +02:00
|
|
|
verbose ?= 2
|
2018-11-17 21:10:51 +01:00
|
|
|
NS_CODE_EXTENSIONS := dbaeumer.vscode-eslint EditorConfig.EditorConfig faustinoaq.crystal-lang \
|
|
|
|
naumovs.color-highlight PKief.material-icon-theme vscodevim.vim
|
2018-10-23 00:06:27 +02:00
|
|
|
NS_REPO_PATH := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
NS_STOW_OPTIONS := --dir="${NS_REPO_PATH}" --target="${HOME}" --no-folding --verbose=${verbose}
|
|
|
|
NS_STOW_PACKAGES := $(wildcard */)
|
|
|
|
NS_SUCCESS := "SUCCESS: Stow command executed succesfully!"
|
2018-10-24 04:46:49 +02:00
|
|
|
NS_STOW_COMMAND := $(if ${package},ns_stow_package,ns_stow_all)
|
2018-10-23 00:06:27 +02:00
|
|
|
|
|
|
|
ns_stow_package = \
|
|
|
|
echo "STATUS: Found package variable. Stow operation will be performed if it is a valid directory..."; \
|
|
|
|
test -d ${package} && \
|
|
|
|
(stow -${1} ${package} ${NS_STOW_OPTIONS} && \
|
|
|
|
echo ${NS_SUCCESS}) || \
|
|
|
|
echo "FAILURE: Not a valid target directory."
|
|
|
|
|
|
|
|
ns_stow_all = \
|
|
|
|
echo "STATUS: No package variable given. Performing stow operation on all directories..."; \
|
|
|
|
$(foreach package,$(NS_STOW_PACKAGES),stow -${1} $(package) ${NS_STOW_OPTIONS} &&) \
|
|
|
|
echo ${NS_SUCCESS}
|
2018-10-15 06:56:56 +02:00
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install:
|
2018-10-24 04:46:49 +02:00
|
|
|
@$(call ${NS_STOW_COMMAND},S)
|
2018-10-15 06:56:56 +02:00
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
2018-10-24 04:46:49 +02:00
|
|
|
@$(call ${NS_STOW_COMMAND},D)
|
2018-10-16 02:26:44 +02:00
|
|
|
|
|
|
|
.PHONY: prune
|
|
|
|
prune:
|
2018-10-24 04:46:49 +02:00
|
|
|
@$(call ${NS_STOW_COMMAND},R)
|
2018-10-28 00:37:47 +02:00
|
|
|
|
2018-11-17 21:10:51 +01:00
|
|
|
.PHONY: code-extensions
|
|
|
|
code-extensions:
|
|
|
|
@$(foreach extension,${NS_CODE_EXTENSIONS},code --install-extension ${extension} --force;)
|
|
|
|
|
2018-11-16 02:51:16 +01:00
|
|
|
.PHONY: enable-mpd
|
|
|
|
enable-mpd:
|
|
|
|
@systemctl --user enable --now mpd.service
|
2018-10-28 00:37:47 +02:00
|
|
|
|
2018-11-16 02:51:16 +01:00
|
|
|
.PHONY: enable-ssh-agent
|
|
|
|
enable-ssh-agent:
|
|
|
|
@systemctl --user enable --now ssh-agent.service
|