-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 833 Bytes
/
Makefile
File metadata and controls
32 lines (22 loc) · 833 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
.PHONY: build clean install test all
BINARY=osticket
VERSION=1.0.0
all: build
build:
go build -ldflags="-s -w" -o $(BINARY) ./cmd/osticket
install: build
sudo cp $(BINARY) /usr/local/bin/
clean:
rm -f $(BINARY) $(BINARY)-*
test:
go test -v ./...
# Cross-compilation targets
build-all: build-linux build-darwin build-windows
build-linux:
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o $(BINARY)-linux-amd64 ./cmd/osticket
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o $(BINARY)-linux-arm64 ./cmd/osticket
build-darwin:
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o $(BINARY)-darwin-amd64 ./cmd/osticket
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o $(BINARY)-darwin-arm64 ./cmd/osticket
build-windows:
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o $(BINARY).exe ./cmd/osticket