diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-05-20 19:28:47 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-05-20 19:28:47 -0700 |
| commit | eb57aa4c696fee5049ea3731f97513fc405e159b (patch) | |
| tree | 67c6588633b94af5c660a176438b81c43cfa1057 /Makefile | |
Initial commit
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a3005d6 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +PREFIX= +CC=cc +CFLAGS=-O0 -std=gnu99 -g +LIBS=-ltermbox +NAME=bb + +all: $(NAME) + +clean: + rm $(NAME) + +$(NAME): $(NAME).c + $(CC) $(NAME).c $(LIBS) $(CFLAGS) -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 doc/$(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 + |
