# Makefile for p4seedreplica
BINARY=p4seedreplica
VERSION=0.8
LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}"
all: build
build:
go build ${LDFLAGS} -o ${BINARY} .
dist:
mkdir -p bin
GOOS=darwin GOARCH=arm64 go build ${LDFLAGS} -o bin/${BINARY}.darwin-arm64 .
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.darwin-amd64 .
GOOS=linux GOARCH=arm64 go build ${LDFLAGS} -o bin/${BINARY}.linux-arm64 .
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.linux-amd64 .
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.windows-amd64.exe .
rm -f bin/${BINARY}*arm64*.gz bin/${BINARY}*amd64*.gz
-chmod +x bin/${BINARY}*arm64* bin/${BINARY}*amd64*
gzip bin/${BINARY}*arm64* bin/${BINARY}.darwin-amd64* bin/${BINARY}.linux-amd64*
README.html: README.md README.style.html
-p4 edit $@
pandoc --standalone --toc --metadata title="p4seedreplica" --include-in-header=README.style.html -o $@ README.md
html: README.html
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
.PHONY: all build clean dist html