Skip to content

Commit c96447d

Browse files
committed
🎨 simplify Makefile
1 parent 90fd79c commit c96447d

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

Makefile

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Compatible with GNU make and BSD make.
1+
NAME=gister
22

3-
include config.mk
3+
PREFIX?=/usr/local
4+
BINDIR=${PREFIX}/bin
45

5-
install:
6-
@echo Installing to ${PREFIX}/bin ...
7-
@mkdir -p ${PREFIX}/bin
8-
@cp -f bin/gister ${PREFIX}/bin/gister
9-
@chmod 755 ${PREFIX}/bin/gister
6+
install: ${NAME}
7+
@mkdir -p ${BINDIR}
8+
@install -c -m 755 bin/${NAME} ${BINDIR}/${NAME}
109

1110
uninstall:
12-
@echo Uninstalling from ${PREFIX}/bin ...
13-
@rm -f ${PREFIX}/bin/gister
11+
@rm -f ${BINDIR}/${NAME}

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,15 @@ You need to install its dependencies mentioned before yourself.
7474
cd gister
7575
make install
7676

77-
- Edit `config.mk` if you do not want to install it to `/usr/local`.
78-
- Compatible with both GNU and BSD make.
77+
By default gister will be installed into `/usr/local/bin/gister`.
78+
Change `PREFIX` to install r3c to another directory.
79+
For example:
80+
81+
```sh
82+
make PREFIX=~/.local install
83+
```
84+
85+
The Makefile is compatible with both GNU and BSD make.
7986

8087
To uninstall:
8188

@@ -84,6 +91,13 @@ To uninstall:
8491
; make uninstall
8592
```
8693

94+
If you have changed the `PREFIX` variable when installing, you need to use the same value when uninstalling.
95+
For example:
96+
97+
```sh
98+
make PREFIX=~/.local uninstall
99+
```
100+
87101
You can also install/uninstall gister via [basher].
88102

89103
[basher]: https://github.com/basherpm/basher

config.mk

-5
This file was deleted.

0 commit comments

Comments
 (0)