# Makefile for p4survey BINARY=p4survey VERSION=0.8 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