1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00
cowyo/Makefile
Zack Scholl accc3b5f62 Version bump
Former-commit-id: ae819a9a760577d7fe156251b19ef671373b9d6b [formerly 8147fb5032726aea60e5c6ea526fa0cd574acd4c] [formerly 24ed3c1b03a257c9340165acc7bbd2f0059d5b25 [formerly d1a85cfb9914f63ce12ab588d3ea1a26b74fdd72 [formerly c0d87c752c]]]
Former-commit-id: 9d45d4e7c0836884455676d485d4edd65903133c [formerly ef1d4c3c2115a88766b7c2f4aeb580126272c1e3]
Former-commit-id: ffc2a7c8c1148e78896d893a7697ea292f7176ac
Former-commit-id: 0ebb3ace3b
2017-03-22 20:41:38 -06:00

48 lines
1.4 KiB
Makefile

SOURCEDIR=.
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
BINARY=cowyo
VERSION=1.1.2
BUILD_TIME=`date +%FT%T%z`
BUILD=`git rev-parse HEAD`
LDFLAGS=-ldflags "-X main.VersionNum=${VERSION} -X main.Build=${BUILD} -X main.BuildTime=${BUILD_TIME}"
.DEFAULT_GOAL: $(BINARY)
$(BINARY): $(SOURCES)
go get github.com/boltdb/bolt
go get github.com/gin-gonic/contrib/sessions
go get github.com/gin-gonic/gin
go get github.com/gorilla/websocket
go get github.com/microcosm-cc/bluemonday
go get github.com/russross/blackfriday
go get github.com/sergi/go-diff/diffmatchpatch
go get github.com/jcelliott/lumber
go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
.PHONY: clean
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
rm -rf binaries
.PHONY: binaries
binaries:
rm -rf binaries
rm -f cowyo
mkdir binaries
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
zip -9 -r cowyo-linux-64bit.zip cowyo static/* templates/*
rm -f cowyo
env GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY}.exe ${SOURCES}
zip -9 -r cowyo-windows-64bit.zip cowyo.exe static/* templates/*
rm -f cowyo.exe
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
zip -9 -r cowyo-raspberrypi.zip cowyo static/* templates/*
rm -f cowyo
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
zip -9 -r cowyo-macosx-64bit.zip cowyo static/* templates/*
rm -f cowyo
mv *.zip binaries/