Adding makefile for all current configurations.

This commit is contained in:
James Patrick 2019-04-27 18:21:33 -04:00
parent 7bd836b67c
commit 30b0cc68ae
6 changed files with 127 additions and 0 deletions

18
lib/makefile Normal file
View File

@ -0,0 +1,18 @@
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GIT_HOOK_SRC = $(SRC_DIR)/post-merge
GIT_HOOK_TARGET = $(abspath $(SRC_DIR)/..)/.git/hooks/post-merge
include ../lib/shared.mk
install: | init update
init:
$(info => Setting up githook)
$(report) info "Symlinked `ln -svf $(GIT_HOOK_SRC) $(GIT_HOOK_TARGET)`"
update:
remove:
$(info => Removing Githook)
$(rm_link) $(GIT_HOOK_TARGET)

23
ssh/makefile Normal file
View File

@ -0,0 +1,23 @@
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SOURCE := $(SRC_DIR)/config
TARGET := ~/.ssh/config
include ../lib/shared.mk
install: | init update
init:
$(info => Setting up ssh)
$(mk_link) $(SOURCE) $(TARGET)
[ ! -e ~/.ssh/git.jpatrick.io ] \
&& echo "No key for git.jpatrick.io. Generating" \
&& ( ssh-keygen -t ed25519 -C "`hostname`: `date`" -f ~/.ssh/git.jpatrick.io -N "" \
; $(report) "Key generation" ) \
; true
update:
remove:
$(info => Remvoing ssh)
$(rm_link) $(TARGET)
$(report) warn "NOTE: All prior keys still remain."

22
sway/makefile Normal file
View File

@ -0,0 +1,22 @@
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
TARGET := $(XDG_DIR)/sway
install: | init update
init:
ifeq ($(call cmd_exist,sway), true)
$(info => Setting up sway)
$(mk_link) $(SRC) $(TARGET)
endif
update:
ifeq ($(call cmd_exist,swaymsg), true)
$(info => Reloading sway)
swaymsg reload ; $(report) "sway reload"
endif
remove:
$(info => Remvoing sway)
$(rm_link) $(TARGET)

21
tmux/makefile Normal file
View File

@ -0,0 +1,21 @@
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SOURCE := $(SRC_DIR)/tmux.conf
TARGET := ~/.tmux.conf
include ../lib/shared.mk
install: | init update
init:
ifeq ($(call cmd_exist,tmux), true)
$(info => Setting up tmux)
$(mk_link) $(SOURCE) $(TARGET)
else
$(report) warn "tmux not installed"
endif
update:
remove:
$(info => Remvoing tmux config)
@ $(rm_link) $(TARGET)

19
tridactyl/makefile Normal file
View File

@ -0,0 +1,19 @@
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
TARGET := $(XDG_DIR)/tridactyl
install: | init update
init:
ifeq ($(shell $(call cmd_exist,firefox) || $(IS_MAC) ; echo $$? ), 0)
$(info => Setting up Tridacyl)
$(mk_link) $(SRC) $(TARGET)
endif
update:
remove:
$(info => Remvoing tridactyl )
$(rm_link) $(TARGET)

24
waybar/makefile Normal file
View File

@ -0,0 +1,24 @@
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
include ../lib/shared.mk
TARGET := $(XDG_DIR)/waybar
install: | init update
init:
ifeq ($(call cmd_exist,waybar), true)
$(info => Setting up waybar)
$(mk_link) $(SRC) $(TARGET)
endif
update:
ifeq ($(call cmd_exist,swaymsg), true)
$(info => Reloading sway)
swaymsg reload ; $(report) "sway reload"
endif
remove:
$(info => Removing waybar)
@ $(rm_link) $(TARGET)
.PHONY: install update init remove