[v0.96] Add PREFIX to Makefile and uninstall target, as requested by many users

This commit is contained in:
Dr-Noob
2021-04-08 09:36:21 +02:00
parent 7916e8cbb4
commit 812ee0acc6

View File

@@ -3,6 +3,8 @@ CC=gcc
CFLAGS=-Wall -Wextra -Werror -pedantic -fstack-protector-all -pedantic -std=c99 CFLAGS=-Wall -Wextra -Werror -pedantic -fstack-protector-all -pedantic -std=c99
SANITY_FLAGS=-Wfloat-equal -Wshadow -Wpointer-arith SANITY_FLAGS=-Wfloat-equal -Wshadow -Wpointer-arith
PREFIX ?= /usr
SRC_COMMON=src/common/ SRC_COMMON=src/common/
COMMON_SRC = $(SRC_COMMON)main.c $(SRC_COMMON)cpu.c $(SRC_COMMON)udev.c $(SRC_COMMON)printer.c $(SRC_COMMON)args.c $(SRC_COMMON)global.c COMMON_SRC = $(SRC_COMMON)main.c $(SRC_COMMON)cpu.c $(SRC_COMMON)udev.c $(SRC_COMMON)printer.c $(SRC_COMMON)args.c $(SRC_COMMON)global.c
@@ -51,6 +53,11 @@ clean:
@rm $(OUTPUT) @rm $(OUTPUT)
install: $(OUTPUT) install: $(OUTPUT)
install -Dm755 "cpufetch" "/usr/bin/cpufetch" install -Dm755 "cpufetch" "$(PREFIX)/bin/cpufetch"
install -Dm644 "LICENSE" "/usr/share/licenses/cpufetch-git/LICENSE" install -Dm644 "LICENSE" "$(PREFIX)/share/licenses/cpufetch-git/LICENSE"
install -Dm644 "cpufetch.8" "/usr/share/man/man8/cpufetch.8.gz" install -Dm644 "cpufetch.8" "$(PREFIX)/share/man/man8/cpufetch.8.gz"
uninstall:
rm -f "$(PREFIX)/bin/cpufetch"
rm -f "$(PREFIX)/share/licenses/cpufetch-git/LICENSE"
rm -f "$(PREFIX)/share/man/man8/cpufetch.8.gz"