rclone/Makefile

104 lines
2.5 KiB
Makefile
Raw Normal View History

2015-11-07 12:16:33 +00:00
SHELL = /bin/bash
TAG := $(shell git describe --tags)
LAST_TAG := $(shell git describe --tags --abbrev=0)
2014-07-03 20:43:14 +00:00
NEW_TAG := $(shell echo $(LAST_TAG) | perl -lpe 's/v//; $$_ += 0.01; $$_ = sprintf("v%.2f", $$_)')
2014-07-19 12:12:20 +00:00
rclone:
@go version
2014-07-19 12:12:20 +00:00
go install -v ./...
2016-07-13 11:25:19 +00:00
# Full suite of integration tests
2014-07-19 12:12:20 +00:00
test: rclone
go test ./...
cd fs && go run test_all.go
2014-03-28 22:34:13 +00:00
2016-07-13 11:25:19 +00:00
# Quick test
quicktest:
go test ./...
go test -cpu=2 -race ./...
# Do source code quality checks
2015-09-22 17:47:16 +00:00
check: rclone
go vet ./...
errcheck ./...
goimports -d . | grep . ; test $$? -eq 1
golint ./... | grep -E -v '(StorageUrl|CdnUrl)' ; test $$? -eq 1
2015-09-22 17:47:16 +00:00
2016-07-13 11:25:19 +00:00
# Get the build dependencies
build_dep:
go get -t ./...
go get -u github.com/kisielk/errcheck
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
# Update dependencies
update:
go get -t -u -f -v ./...
doc: rclone.1 MANUAL.html MANUAL.txt
rclone.1: MANUAL.md
pandoc -s --from markdown --to man MANUAL.md -o rclone.1
MANUAL.md: make_manual.py docs/content/*.md
./make_manual.py
MANUAL.html: MANUAL.md
pandoc -s --from markdown --to html MANUAL.md -o MANUAL.html
MANUAL.txt: MANUAL.md
pandoc -s --from markdown --to plain MANUAL.md -o MANUAL.txt
install: rclone
install -d ${DESTDIR}/usr/bin
2014-07-19 12:12:20 +00:00
install -t ${DESTDIR}/usr/bin ${GOPATH}/bin/rclone
2014-03-28 22:34:13 +00:00
clean:
go clean ./...
2014-03-28 22:34:13 +00:00
find . -name \*~ | xargs -r rm -f
2014-04-17 21:32:39 +00:00
rm -rf build docs/public
2016-01-31 16:33:20 +00:00
rm -f rclone rclonetest/rclonetest
2014-03-28 22:34:13 +00:00
website:
2014-04-17 21:32:39 +00:00
cd docs && hugo
2014-03-28 22:34:13 +00:00
upload_website: website
2014-07-19 12:12:20 +00:00
rclone -v sync docs/public memstore:www-rclone-org
2014-03-28 22:34:13 +00:00
upload:
2014-07-19 12:12:20 +00:00
rclone -v copy build/ memstore:downloads-rclone-org
2014-03-28 22:34:13 +00:00
upload_github:
2016-01-02 12:18:32 +00:00
./upload-github $(TAG)
cross: doc
./cross-compile $(TAG)
2014-03-28 22:34:13 +00:00
2016-02-21 10:29:48 +00:00
beta:
./cross-compile $(TAG)β
rm build/*-current-*
rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β
2015-11-30 10:10:41 +00:00
@echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/
serve: website
2014-04-17 21:32:39 +00:00
cd docs && hugo server -v -w
2016-01-31 17:50:13 +00:00
tag: doc
@echo "Old tag is $(LAST_TAG)"
@echo "New tag is $(NEW_TAG)"
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEW_TAG)\"\n" | gofmt > fs/version.go
perl -lpe 's/VERSION/${NEW_TAG}/g; s/DATE/'`date -I`'/g;' docs/content/downloads.md.in > docs/content/downloads.md
git tag $(NEW_TAG)
@echo "Add this to changelog in docs/content/changelog.md"
2014-06-26 16:57:32 +00:00
@echo " * $(NEW_TAG) -" `date -I`
@git log $(LAST_TAG)..$(NEW_TAG) --oneline
@echo "Then commit the changes"
@echo git commit -m \"Version $(NEW_TAG)\" -a -v
@echo "And finally run make retag before make cross etc"
retag:
2014-06-26 16:57:32 +00:00
git tag -f $(LAST_TAG)
gen_tests:
cd fstest/fstests && go generate