forked from dlvlabs/panoptes-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 875 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 875 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
30
31
32
33
34
35
36
37
38
39
40
41
BINARY_NAME=panoptes
CONFIG_DIR=$(HOME)/.config/panoptes
.PHONY: clan test install
###########
# Install #
###########
install:
@echo "Building and installing..."
@go build -ldflags "-X dlvlabs.net/panoptes-agent/cmd/cli.configPath=$(CONFIG_DIR)/config.toml" -o $(GOPATH)/bin/$(BINARY_NAME) main.go
@echo "Installing config files..."
@mkdir -p $(CONFIG_DIR)
@if [ ! -f $(CONFIG_DIR)/config.toml ]; then \
cp config/config.toml $(CONFIG_DIR)/config.toml; \
fi
###########
# Clean #
###########
clean:
@echo "Cleaning..."
@rm -f $(GOPATH)/bin/$(BINARY_NAME)
@echo "Config files will remain in $(CONFIG_DIR)"
@echo "To remove config files completely, run: make clean-all"
clean-all: clean
@echo "Removing config files..."
@rm -rf $(CONFIG_DIR)
###########
# Test #
###########
test:
@echo "Running tests..."
@go test ./...
.DEFAULT_GOAL := install