diff --git a/makefile b/makefile new file mode 100644 index 0000000..d57dd9e --- /dev/null +++ b/makefile @@ -0,0 +1,28 @@ +# Makefile for magnet-to-torrent + +BINARY_NAME := magnet-to-torrent + +.PHONY: all build run clean fmt test install uninstall + +all: build + +build: + go build -o $(BINARY_NAME) main.go + +run: build + ./$(BINARY_NAME) + +fmt: + gofmt -w main.go + +test: + go test ./... + +install: build + install -Dm755 $(BINARY_NAME) $(DESTDIR)/usr/local/bin/$(BINARY_NAME) + +uninstall: + rm -f $(DESTDIR)/usr/local/bin/$(BINARY_NAME) + +clean: + rm -f $(BINARY_NAME)