arg/Makefile

36 lines
763 B
Makefile
Raw Permalink Normal View History

2019-02-14 19:17:02 -08:00
PREFIX=
CC=cc
CFLAGS=-O3 -std=gnu99
all: arg
clean:
rm arg
arg: arg.c
$(CC) arg.c $(CFLAGS) -o arg
install: arg
@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; \
mkdir -pv $$prefix/bin $$prefix/share/man/man1 \
&& cp -v arg $$prefix/bin/ \
&& cp -v arg.1 $$prefix/share/man/man1/
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..."; \
rm -rvf $$prefix/bin/arg $$prefix/share/man/man1/arg.1