36 lines
763 B
Makefile
36 lines
763 B
Makefile
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
|
|
|