GO=go

.PHONY: build install uninstall vet fmt test clean

build:
	$(GO) build -o ollama-proxy .

install: build
	install -m 755 ollama-proxy /usr/local/bin/ollama-proxy
	install -m 644 systemd/ollama-proxy.service /etc/systemd/system/ollama-proxy.service
	systemctl daemon-reload

uninstall:
	-systemctl disable --now ollama-proxy
	rm -f /usr/local/bin/ollama-proxy /etc/systemd/system/ollama-proxy.service
	systemctl daemon-reload

vet:
	$(GO) vet ./...

fmt:
	$(GO)fmt -l .

test:
	$(GO) test ./...

clean:
	rm -f ollama-proxy