2019-03-18 21:15:33 -07:00
|
|
|
PREFIX=
|
|
|
|
CC=cc
|
|
|
|
CFLAGS=-O3 -std=gnu99
|
2019-09-22 19:35:23 -07:00
|
|
|
LIBS=-lm
|
2019-03-18 21:15:33 -07:00
|
|
|
NAME=2pend
|
|
|
|
|
|
|
|
all: $(NAME)
|
|
|
|
|
|
|
|
clean:
|
2019-06-11 16:03:49 -07:00
|
|
|
rm -f $(NAME)
|
2019-03-18 21:15:33 -07:00
|
|
|
|
|
|
|
run: $(NAME)
|
|
|
|
./$(NAME)
|
|
|
|
|
2019-06-13 13:59:11 -07:00
|
|
|
$(NAME): $(NAME).c
|
2019-03-18 21:15:33 -07:00
|
|
|
$(CC) $(NAME).c $(LIBS) $(CFLAGS) -o $(NAME)
|
|
|
|
|
|
|
|
install: $(NAME)
|
|
|
|
@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 \
|
2019-03-19 20:16:46 -07:00
|
|
|
&& cp -v $(NAME) $$prefix/bin/
|
2019-03-18 21:15:33 -07: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-03-19 20:16:46 -07:00
|
|
|
rm -rvf $$prefix/bin/$(NAME)
|
2019-03-18 21:15:33 -07:00
|
|
|
|