bb/Makefile
Bruce Hill 8b48d29afa Cleanup and refactoring. More robust handling of command files, and
guaranteed tmpfile deletion on exit (even with SIGTERM, ctrl-c, etc.).
Also fixed some bugs with suspend hiding cursor, not handling multiple
commands, duplicating commands, etc.
2019-05-24 16:55:36 -07:00

45 lines
931 B
Makefile

PREFIX=
CC=cc
CFLAGS=-O0 -std=gnu99 -Wall
LIBS=
NAME=bb
G=
all: $(NAME)
clean:
rm $(NAME)
config.h:
cp config.def.h config.h
$(NAME): $(NAME).c keys.h config.h
$(CC) $(NAME).c $(LIBS) $(CFLAGS) $(G) -o $(NAME)
test: $(NAME)
./$(NAME) test.xml
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 \
&& cp -v $(NAME) $$prefix/bin/ \
&& cp -v $(NAME).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/$(NAME) $$prefix/share/man/man1/$(NAME).1