You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
path = ~/.shellrc/bin/scripts
|
|
|
|
find := $(shell { command -v gfind || command -v find; } 2>&-)
|
|
|
|
|
|
|
|
all: install
|
|
|
|
|
|
|
|
mkdir:
|
|
|
|
@mkdir -p $(path)
|
|
|
|
|
|
|
|
rmdir:
|
|
|
|
@rmdir $(path) 2>&-; :
|
|
|
|
|
|
|
|
install: mkdir
|
|
|
|
@$(find) . \
|
|
|
|
-maxdepth 1 \
|
|
|
|
-type f \
|
|
|
|
-executable \
|
|
|
|
-exec basename {} \; \
|
|
|
|
| while read -r line; do \
|
|
|
|
ln -s $$(realpath -- $$line) $(path)/$$line 2>&-; \
|
|
|
|
done; \
|
|
|
|
true
|
|
|
|
|
|
|
|
rmlinks:
|
|
|
|
@$(find) . \
|
|
|
|
-maxdepth 1 \
|
|
|
|
-type f \
|
|
|
|
-executable \
|
|
|
|
-exec basename {} \; \
|
|
|
|
| xargs -IF rm -fv $(path)/F
|
|
|
|
|
|
|
|
uninstall: rmlinks rmdir
|
|
|
|
|
|
|
|
clean: uninstall
|
|
|
|
|
|
|
|
.PHONY: all mkdir rmdir install uninstall clean
|
|
|
|
|