forked from verless/verless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (25 loc) · 737 Bytes
/
Makefile
File metadata and controls
31 lines (25 loc) · 737 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
TAG := $(shell git describe --tags --abbrev=0)
COMMIT := $(shell git rev-parse --short HEAD)
PROJECTNAME := verless
TARGET := target
GOFILES := ./cmd/verless
# Use linker flags to provide version/build settings
LDFLAGS=-ldflags "-X github.com/verless/verless/config.GitTag=$(TAG) -X github.com/verless/verless/config.GitCommit=$(COMMIT)"
## build: Compile the binary.
build:
@mkdir -p $(TARGET)
@GOPATH=$(GOPATH) \
GOBIN=$(GOBIN) \
GOARM=$(GOARM) \
CGO_CPPFLAGS=$(CGO_CPPFLAGS) \
CGO_CFLAGS=$(CGO_CFLAGS) \
CGO_CXXFLAGS=$(CGO_CXXFLAGS) \
CGO_LDFLAGS=$(CGO_LDFLAGS) \
go build $(LDFLAGS) -o $(TARGET) $(GOFILES)
## clean the build folder
clean:
@rm -Rf .target
test:
@go test ./...
all: build
.PHONY: all build test clean