-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 1.19 KB
/
Makefile
File metadata and controls
38 lines (32 loc) · 1.19 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
38
# Makefile for runtipi CLI
# Build values
VERSION := nightly
COMMIT := $(shell git rev-parse HEAD)
DATE := $(shell date +%Y-%m-%dT%H:%M:%S%z)
# Define the root folder path
ROOT_FOLDER_HOST := ~/temp/runtipi
# Main target that creates the directory and runs the program
.PHONY: run
run:
@mkdir -p $(ROOT_FOLDER_HOST)
@ROOT_FOLDER_HOST=$(ROOT_FOLDER_HOST) go run -ldflags="-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.buildDate=$(DATE)" cmd/runtipi/main.go $(ARGS)
# Build the program
.PHONY: build
build:
@go build -o runtipi-cli cmd/runtipi/main.go
# Clean build artifacts
.PHONY: clean
clean:
@rm -f runtipi-cli
# Help command
.PHONY: help
help:
@echo "Available commands:"
@echo " make run ARGS=\"command arguments\" - Run the program with specified arguments"
@echo " make build - Build the program"
@echo " make clean - Clean build artifacts"
@echo " make help - Show this help message"
@echo ""
@echo "Example usage:"
@echo " make run ARGS=\"start\" - Run the program with 'start' command"
@echo " make run ARGS=\"update nightly\" - Run the program with 'update nightly' command"