Add make install
This commit is contained in:
parent
ab578c9502
commit
2eb8a9e362
1 changed files with 20 additions and 0 deletions
20
Makefile
20
Makefile
|
@ -65,6 +65,11 @@ usage:
|
||||||
@echo ' make contrib'
|
@echo ' make contrib'
|
||||||
@echo ' - Generate the CONTRIBUTORS file, from the repo history.'
|
@echo ' - Generate the CONTRIBUTORS file, from the repo history.'
|
||||||
@echo
|
@echo
|
||||||
|
@echo 'INSTALLATION'
|
||||||
|
@echo
|
||||||
|
@echo ' make install PREFIX=<prefix>'
|
||||||
|
@echo ' - Install yadm, manpage, etc. to <prefix>'
|
||||||
|
@echo
|
||||||
@echo 'UTILITIES'
|
@echo 'UTILITIES'
|
||||||
@echo
|
@echo
|
||||||
@echo ' make sync-clock'
|
@echo ' make sync-clock'
|
||||||
|
@ -166,6 +171,21 @@ contrib:
|
||||||
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
|
@echo "CONTRIBUTORS\n" > CONTRIBUTORS
|
||||||
@git shortlog -ns master gh-pages develop dev-pages | cut -f2 >> 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
|
.PHONY: sync-clock
|
||||||
sync-clock:
|
sync-clock:
|
||||||
docker run --rm --privileged alpine hwclock -s
|
docker run --rm --privileged alpine hwclock -s
|
||||||
|
|
Loading…
Reference in a new issue