-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
29 lines (23 loc) · 710 Bytes
/
makefile
File metadata and controls
29 lines (23 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Configuration
BIN_NAME := kontext # 二进制名称变量化
INSTALL_DIR := /usr/local/bin
LOCAL_BIN := $(HOME)/.local/bin
.PHONY: all build clean sudo-install user-install
all: build
build:
@echo "Building Go binary..."
go build -o $(BIN_NAME)
sudo-install: build
@echo "Installing system-wide (requires sudo)"
sudo mkdir -p $(INSTALL_DIR)
sudo cp $(BIN_NAME) $(INSTALL_DIR)/
@echo "Installed to $(INSTALL_DIR)/$(BIN_NAME)"
user-install: build
@echo "Installing to user directory"
mkdir -p $(LOCAL_BIN)
cp $(BIN_NAME) $(LOCAL_BIN)/
@echo "Installed to $(LOCAL_BIN)/$(BIN_NAME)"
@echo "NOTE: Ensure $(LOCAL_BIN) is in your PATH"
clean:
@echo "Full cleanup..."
rm -f $(BIN_NAME)