# Makefile for xapi-cli VERSION := 0.1.0 BINARY := xapi INSTALL_PATH := /usr/local/bin .PHONY: build install uninstall clean build: go build -o $(BINARY) . install: build @echo "Installing $(BINARY) to $(INSTALL_PATH)..." @sudo cp $(BINARY) $(INSTALL_PATH)/ @sudo chmod 755 $(INSTALL_PATH)/$(BINARY) @echo "Installed! Run 'xapi --help' to get started." install-user: build @echo "Installing $(BINARY) to ~/.local/bin..." @mkdir -p ~/.local/bin @cp $(BINARY) ~/.local/bin/ @chmod 755 ~/.local/bin/$(BINARY) @echo "Installed for current user!" @echo "Make sure ~/.local/bin is in your PATH" uninstall: @echo "Removing $(BINARY) from $(INSTALL_PATH)..." @sudo rm -f $(INSTALL_PATH)/$(BINARY) @echo "Uninstalled!" clean: rm -f $(BINARY) # Development helpers run: build ./$(BINARY) test: go test ./...