Merge pull request #2455 from ismaell/install-target
Add make (un)install targets for POSIX systems Fixes #293
This commit is contained in:
commit
faa1e44f52
2 changed files with 27 additions and 10 deletions
17
Makefile
17
Makefile
|
|
@ -58,7 +58,22 @@ endif
|
|||
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
|
||||
.PHONY: site-bump
|
||||
|
||||
|
||||
.PHONY: manpages
|
||||
manpages:
|
||||
go run ./cmd/gen-docs --man-page --doc-path ./share/man/man1/
|
||||
|
||||
DESTDIR :=
|
||||
prefix := /usr/local
|
||||
bindir := ${prefix}/bin
|
||||
mandir := ${prefix}/share/man
|
||||
|
||||
.PHONY: install
|
||||
install: bin/gh manpages
|
||||
install -d ${DESTDIR}${bindir}
|
||||
install -m755 bin/gh ${DESTDIR}${bindir}/
|
||||
install -d ${DESTDIR}${mandir}/man1
|
||||
install -m644 ./share/man/man1/* ${DESTDIR}${mandir}/man1/
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${bindir}/gh ${DESTDIR}${mandir}/man1/gh.1 ${DESTDIR}${mandir}/man1/gh-*.1
|
||||
|
|
|
|||
|
|
@ -15,16 +15,18 @@
|
|||
$ cd gh-cli
|
||||
```
|
||||
|
||||
2. Build the project
|
||||
|
||||
```
|
||||
$ make
|
||||
```
|
||||
|
||||
3. Move the resulting `bin/gh` executable to somewhere in your PATH
|
||||
2. Build and install
|
||||
|
||||
```sh
|
||||
$ sudo mv ./bin/gh /usr/local/bin/
|
||||
# installs to '/usr/local' by default; sudo may be required
|
||||
$ make install
|
||||
```
|
||||
|
||||
4. Run `gh version` to check if it worked.
|
||||
To install to a different location:
|
||||
```sh
|
||||
$ make install prefix=/path/to/gh
|
||||
```
|
||||
|
||||
Make sure that the `${prefix}/bin` directory is in your PATH.
|
||||
|
||||
3. Run `gh version` to check if it worked.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue