-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
30 lines (21 loc) · 887 Bytes
/
Makefile
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
DIST_NAME := popuko
GIT_REVISION := $(shell git rev-parse --verify HEAD)
BUILD_DATE := $(shell date '+%Y/%m/%d %H:%M:%S %z')
all: help
help:
@echo "Specify the task"
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@exit 1
clean: ## Remove the exec binary.
rm -rf $(CURDIR)/$(DIST_NAME)
build: $(DIST_NAME) ## Build the exec binary for youe machine.
build_linux_x64: ## Just an alias to build for some cloud instance.
env GOOS=linux GOARCH=amd64 make build -C $(CURDIR)
run: $(DIST_NAME) ## Execute the binary for youe machine.
$(CURDIR)/$(DIST_NAME)
$(DIST_NAME): clean
go build -o $(DIST_NAME) -ldflags "-X main.revision=$(GIT_REVISION) -X \"main.builddate=$(BUILD_DATE)\""
test: test_epic test_input test_operation test_queue test_setting
go test
test_%:
make test -C $(CURDIR)/$*