init commit
This commit is contained in:
36
Makefile
Normal file
36
Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
.PHONY: build release run test install uninstall clean
|
||||
|
||||
BINARY_NAME := playback
|
||||
BUILD_DIR := build
|
||||
INSTALL_DIR := /usr/local/bin
|
||||
|
||||
VERSION := $(shell cat VERSION)
|
||||
LDFLAGS := -X 'playback/pkg/version.Version=$(VERSION)'
|
||||
|
||||
build:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/playback
|
||||
|
||||
release:
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
go build -ldflags="-s -w $(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/playback
|
||||
|
||||
run: build
|
||||
./$(BUILD_DIR)/$(BINARY_NAME) $(ARGS)
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
install: release
|
||||
sudo cp $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_DIR)/$(BINARY_NAME)
|
||||
chmod +x $(INSTALL_DIR)/$(BINARY_NAME)
|
||||
./install.sh
|
||||
|
||||
uninstall:
|
||||
sudo rm -f $(INSTALL_DIR)/$(BINARY_NAME)
|
||||
rm -f ~/.local/share/applications/playback.desktop
|
||||
update-desktop-database ~/.local/share/applications 2>/dev/null || true
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
go clean
|
||||
Reference in New Issue
Block a user