-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
38 lines (31 loc) · 1.13 KB
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
30
31
32
33
34
35
36
37
# --- Configuration ---
INSTALL_DIR ?= $(HOME)/.local/bin
SCRIPT_NAME = track
SCRIPT_PATH = $(CURDIR)/$(SCRIPT_NAME)
VERSION := $(shell cat VERSION)
GIT_TAG = v$(VERSION)
# --- Rules ---
.PHONY: install uninstall help tag version
install:
@echo "Installing $(SCRIPT_NAME) v$(VERSION) to $(INSTALL_DIR)..."
@mkdir -p "$(INSTALL_DIR)"
@sed "s/__VERSION__/$(VERSION)/" "$(SCRIPT_PATH)" > "$(INSTALL_DIR)/$(SCRIPT_NAME)"
@chmod +x "$(INSTALL_DIR)/$(SCRIPT_NAME)"
@echo "✅ Installed. Make sure $(INSTALL_DIR) is in your PATH."
uninstall:
@echo "Uninstalling $(SCRIPT_NAME) from $(INSTALL_DIR)..."
@rm -f "$(INSTALL_DIR)/$(SCRIPT_NAME)"
@echo "✅ Uninstalled."
version:
@echo "Current version: $(VERSION)"
tag:
@git tag $(GIT_TAG)
@git push origin $(GIT_TAG)
@echo "✅ Git tag $(GIT_TAG) created and pushed."
help:
@echo "Available targets:"
@echo " make install Install script to $(INSTALL_DIR)"
@echo " make uninstall Remove script from $(INSTALL_DIR)"
@echo " make version Show current version"
@echo " make tag Create and push Git tag 'v$(VERSION)'"
@echo " make help Show this message"