Browse Source

Makefile: cp -> install

master
Maxim Likhachev 5 years ago
parent
commit
b29f422b5b
  1. 13
      Makefile

13
Makefile

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
MAKEFLAGS += --warn-undefined-variables
install_path = /usr/local/bin
links_path = ~/.shellrc/bin/scripts
local_man_path = ~/.shellrc/var/man/man1
@ -14,10 +16,11 @@ MAN_FILES := $(addsuffix ".1", $(MAN_PAGES)) @@ -14,10 +16,11 @@ MAN_FILES := $(addsuffix ".1", $(MAN_PAGES))
# --------------------------------------------------------------------------------------------------
# copy_files [FILES] TO/
define copy_files
# install_files [FILES] TO/
define install_files
@for file in $(1); do \
cp -v $$(realpath -- $$file) $(2)/$$(basename $$file); \
echo install -m $(3) $$(realpath -- $$file) $(2)/$$(basename $$file); \
install -m $(3) $$(realpath -- $$file) $(2)/$$(basename $$file); \
done
endef
@ -69,13 +72,13 @@ make_man_directory: @@ -69,13 +72,13 @@ make_man_directory:
@mkdir -p $(system_man_path)
copy_bin:
$(call copy_files, $(SCRIPTS), $(install_path))
$(call install_files, $(SCRIPTS), $(install_path), 755)
rm_bin:
$(call delete_files, $(SCRIPTS), $(install_path))
copy_man_pages: make_man_directory
$(call copy_files, $(MAN_FILES), $(system_man_path))
$(call install_files, $(MAN_FILES), $(system_man_path), 644)
rm_man_pages: make_man_directory
$(call delete_files, $(MAN_FILES), $(system_man_path))

Loading…
Cancel
Save