26 lines
628 B
Makefile
26 lines
628 B
Makefile
# BIN = browser_ruler.py
|
|
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) 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
|