2015-10-12 02:57:14 +00:00
|
|
|
OUTPUT_DIR = ./builds
|
2017-08-23 02:15:41 +00:00
|
|
|
GIT_COMMIT = `git rev-parse HEAD | cut -c1-7`
|
2017-12-13 08:37:02 +00:00
|
|
|
VERSION = 2.0.0-alpha.3
|
2017-08-23 02:15:41 +00:00
|
|
|
BUILD_OPTIONS = -ldflags "-X main.Version=$(VERSION) -X main.CommitID=$(GIT_COMMIT)"
|
|
|
|
|
2017-09-28 04:37:34 +00:00
|
|
|
gotty: main.go server/*.go webtty/*.go backend/*.go Makefile
|
2020-02-28 06:47:10 +00:00
|
|
|
go build ${BUILD_OPTIONS}
|
2015-08-16 09:47:23 +00:00
|
|
|
|
2020-02-28 12:49:19 +00:00
|
|
|
docker:
|
|
|
|
docker build . -t gotty-bash:$(VERSION)
|
|
|
|
|
2017-10-03 06:34:51 +00:00
|
|
|
.PHONY: asset
|
2017-09-28 04:37:34 +00:00
|
|
|
asset: bindata/static/js/gotty-bundle.js bindata/static/index.html bindata/static/favicon.png bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css
|
2017-02-25 22:37:07 +00:00
|
|
|
go-bindata -prefix bindata -pkg server -ignore=\\.gitkeep -o server/asset.go bindata/...
|
|
|
|
gofmt -w server/asset.go
|
2015-08-16 09:47:23 +00:00
|
|
|
|
2017-10-03 06:34:51 +00:00
|
|
|
.PHONY: all
|
2020-02-28 12:49:19 +00:00
|
|
|
all: asset gotty docker
|
2017-09-28 04:37:34 +00:00
|
|
|
|
2015-08-16 09:47:23 +00:00
|
|
|
bindata:
|
|
|
|
mkdir bindata
|
2015-08-16 22:00:17 +00:00
|
|
|
|
2015-08-23 05:04:31 +00:00
|
|
|
bindata/static: bindata
|
|
|
|
mkdir bindata/static
|
|
|
|
|
2015-08-23 11:40:18 +00:00
|
|
|
bindata/static/index.html: bindata/static resources/index.html
|
|
|
|
cp resources/index.html bindata/static/index.html
|
2015-08-29 04:12:04 +00:00
|
|
|
|
2015-08-30 07:27:40 +00:00
|
|
|
bindata/static/favicon.png: bindata/static resources/favicon.png
|
|
|
|
cp resources/favicon.png bindata/static/favicon.png
|
|
|
|
|
2015-08-29 04:12:04 +00:00
|
|
|
bindata/static/js: bindata/static
|
2015-08-30 07:27:40 +00:00
|
|
|
mkdir -p bindata/static/js
|
2015-08-29 04:12:04 +00:00
|
|
|
|
2017-05-21 23:16:24 +00:00
|
|
|
|
2017-08-22 07:03:19 +00:00
|
|
|
bindata/static/js/gotty-bundle.js: bindata/static/js js/dist/gotty-bundle.js
|
|
|
|
cp js/dist/gotty-bundle.js bindata/static/js/gotty-bundle.js
|
2017-05-21 23:16:24 +00:00
|
|
|
|
|
|
|
bindata/static/css: bindata/static
|
|
|
|
mkdir -p bindata/static/css
|
|
|
|
|
|
|
|
bindata/static/css/index.css: bindata/static/css resources/index.css
|
|
|
|
cp resources/index.css bindata/static/css/index.css
|
|
|
|
|
|
|
|
bindata/static/css/xterm_customize.css: bindata/static/css resources/xterm_customize.css
|
|
|
|
cp resources/xterm_customize.css bindata/static/css/xterm_customize.css
|
|
|
|
|
|
|
|
bindata/static/css/xterm.css: bindata/static/css js/node_modules/xterm/dist/xterm.css
|
|
|
|
cp js/node_modules/xterm/dist/xterm.css bindata/static/css/xterm.css
|
|
|
|
|
2017-08-22 03:10:52 +00:00
|
|
|
js/node_modules/xterm/dist/xterm.css:
|
|
|
|
cd js && \
|
|
|
|
npm install
|
|
|
|
|
2017-10-03 06:34:51 +00:00
|
|
|
js/dist/gotty-bundle.js: js/src/* js/node_modules/webpack
|
2017-05-21 23:16:24 +00:00
|
|
|
cd js && \
|
2017-10-03 06:34:51 +00:00
|
|
|
`npm bin`/webpack
|
2015-08-29 04:12:04 +00:00
|
|
|
|
2017-10-03 06:34:51 +00:00
|
|
|
js/node_modules/webpack:
|
|
|
|
cd js && \
|
|
|
|
npm install
|
2015-10-12 02:57:14 +00:00
|
|
|
|
|
|
|
tools:
|
|
|
|
go get github.com/tools/godep
|
|
|
|
go get github.com/mitchellh/gox
|
|
|
|
go get github.com/tcnksm/ghr
|
2016-04-13 07:01:14 +00:00
|
|
|
go get github.com/jteeuwen/go-bindata/...
|
2015-10-12 02:57:14 +00:00
|
|
|
|
|
|
|
test:
|
2016-04-13 07:01:14 +00:00
|
|
|
if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi
|
2015-10-12 02:57:14 +00:00
|
|
|
|
|
|
|
cross_compile:
|
2016-07-29 07:52:37 +00:00
|
|
|
GOARM=5 gox -os="darwin linux freebsd netbsd openbsd" -arch="386 amd64 arm" -osarch="!darwin/arm" -output "${OUTPUT_DIR}/pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"
|
2015-10-12 02:57:14 +00:00
|
|
|
|
|
|
|
targz:
|
|
|
|
mkdir -p ${OUTPUT_DIR}/dist
|
2017-08-23 02:15:41 +00:00
|
|
|
cd ${OUTPUT_DIR}/pkg/; for osarch in *; do (cd $$osarch; tar zcvf ../../dist/gotty_${VERSION}_$$osarch.tar.gz ./*); done;
|
2015-10-12 02:57:14 +00:00
|
|
|
|
2015-10-18 02:38:12 +00:00
|
|
|
shasums:
|
2016-08-11 07:48:03 +00:00
|
|
|
cd ${OUTPUT_DIR}/dist; sha256sum * > ./SHA256SUMS
|
2015-10-18 02:38:12 +00:00
|
|
|
|
2015-10-12 02:57:14 +00:00
|
|
|
release:
|
2017-08-08 08:18:49 +00:00
|
|
|
ghr -c ${GIT_COMMIT} --delete --prerelease -u yudai -r gotty pre-release ${OUTPUT_DIR}/dist
|
2020-02-28 12:43:17 +00:00
|
|
|
clean:
|
|
|
|
rm -fr gotty
|