-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 820 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
31
32
33
34
35
36
37
SOURCES := main.go logger.go
BINARY:= bin/app
PLATFORMS := darwin/amd64 darwin/arm64 linux/386 linux/amd64 linux/arm linux/arm64
WIN_PLATFORMS := windows/386 windows/amd64 windows/arm windows/arm64
temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))
.PHONY : release $(PLATFORMS) $(WIN_PLATFORMS) clean
release: $(PLATFORMS) $(WIN_PLATFORMS)
$(PLATFORMS):
GOOS=$(os) GOARCH=$(arch) go build -o $(BINARY)-$(os)-$(arch) $(SOURCES)
$(WIN_PLATFORMS):
GOOS=$(os) GOARCH=$(arch) go build -o $(BINARY)-$(os)-$(arch).exe $(SOURCES)
build:
go build -o $(BINARY) $(SOURCES)
clean:
rm -rf $(BINARY)-*
ci:
go build -v -o ./app $(SOURCES)
dev:
go build -o $(BINARY)-dev $(SOURCES)
docker:
go build -v -o /usr/local/bin/igdb-app $(SOURCES)
run:
go build -o $(BINARY) $(SOURCES)
./$(BINARY)-dev