43 lines
815 B
Makefile
43 lines
815 B
Makefile
EXECUTABLE=project-ely
|
|
GO=go
|
|
GO_BUILD=build -x -v
|
|
GO_BUILD_DEBUG=${GO_BUILD} -gcflags=all="-N -l"
|
|
GO_BUILD_RELEASE=${GO_BUILD} -trimpath -tags static -ldflags "-s -w"
|
|
GO_BUILD_RELEASE_WINDOWS=${GO_BUILD} -trimpath -tags static -ldflags "-s -w -H windowsgui"
|
|
|
|
all: release
|
|
|
|
dependencies:
|
|
${GO} mod tidy
|
|
|
|
debug: linter dependencies
|
|
${GO} ${GO_BUILD_DEBUG}
|
|
|
|
release: linter dependencies
|
|
${GO} ${GO_BUILD_RELEASE}
|
|
|
|
linter:
|
|
golangci-lint run
|
|
|
|
clean:
|
|
rm -f ${EXECUTABLE}
|
|
rm -f output.log
|
|
rm -f cpu.prof
|
|
|
|
cross_windows:
|
|
CGO_ENABLED=1 \
|
|
CC=x86_64-w64-mingw32-gcc \
|
|
GOOS=windows \
|
|
GOARCH=amd64 \
|
|
${GO} ${GO_BUILD_RELEASE}
|
|
|
|
cross_windows_x86:
|
|
CGO_ENABLED=1 \
|
|
CC=i686-w64-mingw32-gcc \
|
|
GOOS=windows \
|
|
GOARCH=386 \
|
|
${GO} ${GO_BUILD_RELEASE}
|
|
|
|
goimports_everything:
|
|
find . -name "*.go" -exec goimports -w {} \;
|