-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathMakefile
32 lines (25 loc) · 834 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
PROJ_NAME=hades
PROJ_MOD_PREFIX=github.com/f1zm0/hades
BUILD_PATH=${CURDIR}/dist
ENTRYPOINT=${CURDIR}/cmd/hades/main.go
GCFLAGS=-gcflags=all=-trimpath=$(GOPATH)
ASMFLAGS=-asmflags=all=-trimpath=$(GOPATH)
# LDFLAGS="-s -w -H=windowsgui"
LDFLAGS="-s -w"
.PHONY: default
default: build
.PHONY: help
## help: prints an help message with all the available targets
help:
@echo -e "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
.PHONY: clean
## clean: delete all binaries
clean:
@if [ -d "${BUILD_PATH}" ]; then ${RM} ${BUILD_PATH}/* ; fi
.PHONY: build
## build: builds binary for Windows
build:
@echo "Building binaries for Windows x64 ..."; \
GOOS=windows GOARCH=amd64 go build -ldflags=${LDFLAGS} ${GCFLAGS} ${ASMFLAGS} \
-o ${BUILD_PATH}/${PROJ_NAME}.exe ${ENTRYPOINT} || exit 1; \