-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (29 loc) · 753 Bytes
/
Makefile
File metadata and controls
30 lines (29 loc) · 753 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
# Go params
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFMT=$(GOCMD) fmt
LDFLAGS='-s -w -extldflags "-static"' # Build as static binary & remove symbol info.
BINARY_NAME=twitter
BINARY_WIN_SUFFIX=.exe
all: build
build:
CGO_ENABLED=0 $(GOBUILD) -o $(BINARY_NAME) --ldflags $(LDFLAGS) -i -v
upx -9v twitter
build-windows:
GOOS=windows CGO_ENABLED=0 $(GOBUILD) -o $(BINARY_NAME)$(BINARY_WIN_SUFFIX) --ldflags $(LDFLAGS) -i -v
upx -9v $(BINARY_NAME)$(BINARY_WIN_SUFFIX)
test:
$(GOTEST) -v ./...
fmt:
$(GOFMT) ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)
deps:
$(GOGET) github.com/ChimeraCoder/anaconda