mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
465b0b3f84
Former-commit-id: 567e9474a209c2f18c45184a4b3ea27707b1f8da [formerly 2f0d76d8fcb47f48665a6d9e6dd3a7a62bdb8c3b] [formerly bc4797d56c793bb16baf2ab44dcf3f8d46b491e4 [formerly 6ecaef78577b3416c58e26ca4f6fe8d812e9600a [formerlyc10c7b16e2
]]] Former-commit-id: 9beec0c669e6fe5dad80e09d519ab076d3333202 [formerly 9f6e746719f5093312b7c33bae80d5476eabc82b] Former-commit-id: b483ae83fd9623c758135d25f7c90eecdc88a6f4 Former-commit-id:14b820f0e4
47 lines
1.4 KiB
Makefile
47 lines
1.4 KiB
Makefile
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:
|
|
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} ${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/
|