aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c4f90b6fd1f1df3cad0b5625ce995d6d271262ac (plain)
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
PREFIX=

all:
	@echo "Nothing to build."

install:
	@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; \
	echo $$'\033[1mInstalling...\033[0m'; \
	mkdir -pv $$prefix/bin $$prefix/share/man/man1 \
	&& cp -v nowopen $$prefix/bin/ \
	&& cp -v doc/nowopen.1 $$prefix/share/man/man1/; \
	xdg_data_home=$$XDG_DATA_HOME; \
	if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \
	echo $$'\033[1mInstallation complete.\033[0m'; \
	echo "Put your business hours file in either $$xdg_data_home/nowopen/businesshours or ~/.businesshours";

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 $$'\033[1mDeleting...\033[0m'; \
	rm -rvf $$prefix/bin/nowopen $$prefix/share/man/man1/nowopen.1; \
	xdg_data_home=$$XDG_DATA_HOME; \
	if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \
	echo $$'\033[1mUninstallation complete.\033[0m'; \
	echo "You may want to delete your data from $$xdg_data_home/nowopen/businesshours or ~/.businesshours";