mirror of
https://github.com/axllent/goptimize.git
synced 2024-12-29 21:46:26 -05:00
25 lines
661 B
Makefile
25 lines
661 B
Makefile
|
TAG=`git describe --tags`
|
||
|
VERSION ?= `git describe --tags`
|
||
|
LDFLAGS=-ldflags "-s -extldflags \"--static\" -w -X main.version=${VERSION}"
|
||
|
|
||
|
build = echo "\n\nBuilding $(1)-$(2)" && GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/goptimize_${VERSION}_$(1)_$(2) \
|
||
|
&& bzip2 dist/goptimize_${VERSION}_$(1)_$(2)
|
||
|
|
||
|
goptimize: *.go
|
||
|
go get github.com/disintegration/imaging
|
||
|
go build ${LDFLAGS} -o goptimize
|
||
|
rm -rf /tmp/go-*
|
||
|
|
||
|
clean:
|
||
|
rm -f goptimize
|
||
|
|
||
|
release:
|
||
|
mkdir -p dist
|
||
|
rm -f dist/goptimize_${VERSION}_*
|
||
|
$(call build,linux,amd64)
|
||
|
$(call build,linux,386)
|
||
|
$(call build,linux,arm)
|
||
|
$(call build,linux,arm64)
|
||
|
$(call build,darwin,amd64)
|
||
|
$(call build,darwin,386)
|