2016-08-21 18:34:26 +03:00
|
|
|
SOURCEDIR=.
|
|
|
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
|
|
|
|
|
|
|
BINARY=cowyo
|
|
|
|
|
|
|
|
VERSION=1.1
|
|
|
|
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 build ${LDFLAGS} -o ${BINARY} ${SOURCES}
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
|
|
|
|
rm -rf binaries
|
|
|
|
|
|
|
|
.PHONY: binaries
|
|
|
|
binaries:
|
2016-02-16 00:59:32 +03:00
|
|
|
rm -rf binaries
|
2016-03-19 18:31:47 +03:00
|
|
|
rm -f cowyo
|
2016-02-16 00:59:32 +03:00
|
|
|
mkdir binaries
|
2016-08-21 18:34:26 +03:00
|
|
|
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
|
2016-03-19 18:31:47 +03:00
|
|
|
zip -9 -r cowyo-linux-64bit.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
2016-08-21 18:34:26 +03:00
|
|
|
env GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
|
2016-03-19 18:31:47 +03:00
|
|
|
zip -9 -r cowyo-windows-64bit.zip cowyo.exe static/* templates/*
|
|
|
|
rm -f cowyo.exe
|
2016-08-21 18:34:26 +03:00
|
|
|
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
|
2016-03-19 18:31:47 +03:00
|
|
|
zip -9 -r cowyo-raspberrypi.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
2016-08-21 18:34:26 +03:00
|
|
|
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY} ${SOURCES}
|
2016-03-19 18:31:47 +03:00
|
|
|
zip -9 -r cowyo-macosx-64bit.zip cowyo static/* templates/*
|
|
|
|
rm -f cowyo
|
2016-02-16 01:22:06 +03:00
|
|
|
mv *.zip binaries/
|