29 lines
705 B
Makefile
29 lines
705 B
Makefile
BIN = browser-ruler
|
|
SCRIPT_INSTALL_PATH ?= $(HOME)/.local/bin
|
|
DESKTOP_INSTALL_PATH ?= $(HOME)/.local/share/applications
|
|
|
|
.PHONY: default all clean
|
|
default: test
|
|
|
|
.PHONY: test
|
|
test: $(BIN)
|
|
./$(BIN) -config ./sample-config.hcl https://duck.com/
|
|
|
|
$(BIN): *.go
|
|
go build .
|
|
|
|
.PHONY: install
|
|
install: $(BIN)
|
|
mkdir -p "$(SCRIPT_INSTALL_PATH)"
|
|
mkdir -p "$(DESKTOP_INSTALL_PATH)"
|
|
cp $(BIN) "$(SCRIPT_INSTALL_PATH)/$(BIN)"
|
|
sed "s|{SCRIPT}|$(SCRIPT_INSTALL_PATH)/$(BIN)|" ./browserRuler.desktop > "$(DESKTOP_INSTALL_PATH)/browserRuler.desktop"
|
|
|
|
.PHONY: set-default
|
|
set-default:
|
|
xdg-settings set default-web-browser browserRuler.desktop
|
|
|
|
.PHONY: install-hooks
|
|
install-hooks:
|
|
pre-commit install --install-hooks
|