Skip to content

Commit

Permalink
🎨 simplify Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
weakish committed Jan 23, 2024
1 parent 90fd79c commit c96447d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Compatible with GNU make and BSD make.
NAME=gister

include config.mk
PREFIX?=/usr/local
BINDIR=${PREFIX}/bin

install:
@echo Installing to ${PREFIX}/bin ...
@mkdir -p ${PREFIX}/bin
@cp -f bin/gister ${PREFIX}/bin/gister
@chmod 755 ${PREFIX}/bin/gister
install: ${NAME}
@mkdir -p ${BINDIR}
@install -c -m 755 bin/${NAME} ${BINDIR}/${NAME}

uninstall:
@echo Uninstalling from ${PREFIX}/bin ...
@rm -f ${PREFIX}/bin/gister
@rm -f ${BINDIR}/${NAME}
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,15 @@ You need to install its dependencies mentioned before yourself.
cd gister
make install

- Edit `config.mk` if you do not want to install it to `/usr/local`.
- Compatible with both GNU and BSD make.
By default gister will be installed into `/usr/local/bin/gister`.
Change `PREFIX` to install r3c to another directory.
For example:

```sh
make PREFIX=~/.local install
```

The Makefile is compatible with both GNU and BSD make.

To uninstall:

Expand All @@ -84,6 +91,13 @@ To uninstall:
; make uninstall
```

If you have changed the `PREFIX` variable when installing, you need to use the same value when uninstalling.
For example:

```sh
make PREFIX=~/.local uninstall
```

You can also install/uninstall gister via [basher].

[basher]: https://github.com/basherpm/basher
Expand Down
5 changes: 0 additions & 5 deletions config.mk

This file was deleted.

0 comments on commit c96447d

Please sign in to comment.