-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (41 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SHELL = /bin/sh
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif
MANPREFIX := $(PREFIX)/share/man
help:
@echo "Use one of the following options:"
@echo " - install"
@echo " - uninstall"
@echo " - reinstall"
@echo " - update"
primary-deps:
@echo "Making sure 'curl' is installed..."
ifneq ($(shell command -v curl),)
@echo "'curl' found."
else
@echo "'curl' not found! Please install it manually and try again."
exit 1
endif
@echo "All required dependencies found."
place:
@echo "Installing script..."
sudo install ./crater $(PREFIX)/bin/crater
sudo install ./scripts/* $(PREFIX)/bin/
@echo "Script installed."
manpage:
@echo "Creating manpage..."
mkdir -p $(MANPREFIX)/man1
sudo cp ./man/crater.1 $(MANPREFIX)/man1/
@echo "Manpage created."
install: primary-deps place manpage
@echo "crater is now installed."
uninstall:
@echo "Uninstalling crater..."
sudo rm $(PREFIX)/bin/crater*
sudo rm $(MANPREFIX)/man1/crater.1
@echo "crater has been uninstalled."
reinstall: uninstall install
get-latest:
git pull origin main
update: get-latest reinstall