fix(build): make install now properly builds, signs, and installs to ~/.local/bin
Previously `make install` used `go install` which put the binary in ~/go/bin without codesigning, while PATH used ~/.local/bin - causing chronic stale binary issues. Now install depends on build (which codesigns on macOS) and copies to the correct location. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
8
Makefile
8
Makefile
@@ -2,6 +2,7 @@
|
||||
|
||||
BINARY := gt
|
||||
BUILD_DIR := .
|
||||
INSTALL_DIR := $(HOME)/.local/bin
|
||||
|
||||
# Get version info for ldflags
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
@@ -23,8 +24,11 @@ ifeq ($(shell uname),Darwin)
|
||||
@echo "Signed $(BINARY) for macOS"
|
||||
endif
|
||||
|
||||
install: generate
|
||||
go install -ldflags "$(LDFLAGS)" ./cmd/gt
|
||||
install: build
|
||||
@mkdir -p $(INSTALL_DIR)
|
||||
@rm -f $(INSTALL_DIR)/$(BINARY)
|
||||
@cp $(BUILD_DIR)/$(BINARY) $(INSTALL_DIR)/$(BINARY)
|
||||
@echo "Installed $(BINARY) to $(INSTALL_DIR)/$(BINARY)"
|
||||
|
||||
clean:
|
||||
rm -f $(BUILD_DIR)/$(BINARY)
|
||||
|
||||
Reference in New Issue
Block a user