2019-01-02 20:30:11 -08:00
|
|
|
PREFIX=
|
2019-01-07 16:59:57 -08:00
|
|
|
CC=cc
|
2019-02-04 16:32:52 -08:00
|
|
|
CFLAGS=-O3 -std=gnu99
|
|
|
|
LIBS=-lncurses -lm
|
2019-01-02 20:30:11 -08:00
|
|
|
|
|
|
|
all: nuke
|
|
|
|
|
2019-01-03 01:51:33 -08:00
|
|
|
nuke: *.h *.c
|
2019-01-07 16:59:57 -08:00
|
|
|
$(CC) nuke.c $(LIBS) $(CFLAGS) -o nuke
|
2019-01-02 20:30:11 -08:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f nuke
|
|
|
|
|
|
|
|
install: nuke
|
|
|
|
@prefix="$(PREFIX)"; \
|
|
|
|
if [[ ! $$prefix ]]; then \
|
|
|
|
read -p $$'\033[1mWhere do you want to install? (default: /usr/local) \033[0m' prefix; \
|
|
|
|
fi; \
|
|
|
|
if [[ ! $$prefix ]]; then \
|
|
|
|
prefix="/usr/local"; \
|
|
|
|
fi; \
|
2019-01-03 04:38:27 -08:00
|
|
|
mkdir -pv $$prefix/bin $$prefix/share/man/man1 \
|
|
|
|
&& cp -v nuke $$prefix/bin/ \
|
|
|
|
&& cp -v doc/nuke.1 $$prefix/share/man/man1/
|
2019-01-03 21:35:09 -08:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
@prefix="$(PREFIX)"; \
|
|
|
|
if [[ ! $$prefix ]]; then \
|
|
|
|
read -p $$'\033[1mWhere do you want to uninstall from? (default: /usr/local) \033[0m' prefix; \
|
|
|
|
fi; \
|
|
|
|
if [[ ! $$prefix ]]; then \
|
|
|
|
prefix="/usr/local"; \
|
|
|
|
fi; \
|
|
|
|
echo "Deleting..."; \
|
2019-01-05 16:47:52 -08:00
|
|
|
rm -rvf $$prefix/bin/nuke $$prefix/share/man/man1/nuke.1
|
2019-01-07 16:59:57 -08:00
|
|
|
|