Browse Source

Improve Makefile

master
Maxim Likhachev 5 years ago
parent
commit
932cfdecf6
  1. 25
      Makefile

25
Makefile

@ -4,16 +4,29 @@ find := $(shell { command -v gfind || command -v find; } 2>&-) @@ -4,16 +4,29 @@ find := $(shell { command -v gfind || command -v find; } 2>&-)
all: install
mkdir:
mkdir -p $(path)
@mkdir -p $(path)
rmdir:
rmdir $(path) 2>&-; :
@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
@$(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

Loading…
Cancel
Save