Makefile #5

  • //
  • guest/
  • perforce_software/
  • p4survey/
  • Makefile
  • View
  • Commits
  • Open Download .zip Download (1 KB)
# Makefile for p4survey

BINARY=p4survey
VERSION=0.3

LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION}"
SRC_FILES=${BINARY}.go

all: build README.html

# Builds the project
build:
	go build ${LDFLAGS}

# Builds distribution
dist:
	GOOS=darwin GOARCH=arm64 go build ${LDFLAGS} -o bin/${BINARY}.darwin-arm64 ${SRC_FILES}
	GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.darwin-amd64 ${SRC_FILES}
	GOOS=linux GOARCH=arm64 go build ${LDFLAGS} -o bin/${BINARY}.linux-arm64 ${SRC_FILES}
	GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.linux-amd64 ${SRC_FILES}
	GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o bin/${BINARY}.windows-amd64.exe ${SRC_FILES}
	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*

# Renders the README as a standalone HTML page
README.html: README.md README.style.html
	-p4 edit $@
	pandoc --standalone --toc --metadata title="p4survey" --include-in-header=README.style.html -o $@ README.md

html: README.html

# Cleans our project: deletes binaries
clean:
	if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi

.PHONY: all clean install html
# Change User Description Committed
#5 33854 Robert Cowham Fix version
#4 33850 Robert Cowham Improve HTML formatting
#3 33249 Robert Cowham Option to specify SVG file to save
#2 33206 Robert Cowham Don't gzip Windows binaries.
Handle partitioned tables.
#1 32951 Robert Cowham New p4survey tool