Add make install

pull/177/head
Tim Byrne 3 years ago
parent ab578c9502
commit 2eb8a9e362
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
  1. 20
      Makefile

@ -65,6 +65,11 @@ usage:
@echo ' make contrib'
@echo ' - Generate the CONTRIBUTORS file, from the repo history.'
@echo
@echo 'INSTALLATION'
@echo
@echo ' make install PREFIX=<prefix>'
@echo ' - Install yadm, manpage, etc. to <prefix>'
@echo
@echo 'UTILITIES'
@echo
@echo ' make sync-clock'
@ -166,6 +171,21 @@ contrib:
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
@git shortlog -ns master gh-pages develop dev-pages | cut -f2 >> CONTRIBUTORS
.PHONY: install
install:
@[ -n "$(PREFIX)" ] || { echo "PREFIX is not set"; exit 1; }
@{\
set -e ;\
bin="$(PREFIX)/bin" ;\
doc="$(PREFIX)/share/doc/yadm" ;\
man="$(PREFIX)/share/man/man1" ;\
install -d "$$bin" "$$doc" "$$man" ;\
install -m 0755 yadm "$$bin" ;\
install -m 0644 yadm.1 "$$man" ;\
install -m 0644 CHANGES CONTRIBUTORS LICENSE "$$doc" ;\
cp -r contrib "$$doc" ;\
}
.PHONY: sync-clock
sync-clock:
docker run --rm --privileged alpine hwclock -s

Loading…
Cancel
Save