mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
d5f3ae1b5f
Former-commit-id: adc295b095c0b963911c3d0fe63c8a933f34eb29 [formerly 5cc558bafca350ee0870aa796733fa6668add6d3] [formerly 95debc30dbbc8e8b0fec10747964d510d3b3448c [formerly f2bc22e8d8
]]
Former-commit-id: a2c396414437d207a7b547d7e15761dd2723d63f [formerly cce67f77ec106ab31fc100c3aadd7db0a64b8063]
Former-commit-id: 1b2f1389b2ff3e63b934966d1f67bc5ef0689f47
48 lines
1.4 KiB
Makefile
48 lines
1.4 KiB
Makefile
SOURCEDIR=.
|
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
|
|
|
BINARY=cowyo
|
|
|
|
VERSION=1.1.0
|
|
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/
|