2015-11-07 20:16:33 +08:00
|
|
|
SHELL = /bin/bash
|
2014-04-25 01:11:08 +08:00
|
|
|
TAG := $(shell git describe --tags)
|
|
|
|
LAST_TAG := $(shell git describe --tags --abbrev=0)
|
2014-07-04 04:43:14 +08:00
|
|
|
NEW_TAG := $(shell echo $(LAST_TAG) | perl -lpe 's/v//; $$_ += 0.01; $$_ = sprintf("v%.2f", $$_)')
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2014-07-19 20:12:20 +08:00
|
|
|
rclone:
|
2014-04-25 01:11:08 +08:00
|
|
|
@go version
|
2014-07-19 20:12:20 +08:00
|
|
|
go install -v ./...
|
|
|
|
|
|
|
|
test: rclone
|
|
|
|
go test ./...
|
2015-12-30 08:18:31 +08:00
|
|
|
cd fs && go run test_all.go
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2015-09-23 01:47:16 +08:00
|
|
|
check: rclone
|
|
|
|
go vet ./...
|
2016-03-28 18:36:52 +08:00
|
|
|
errcheck ./...
|
2015-11-14 17:20:34 +08:00
|
|
|
goimports -d . | grep . ; test $$? -eq 1
|
2016-03-28 18:36:52 +08:00
|
|
|
golint ./... | grep -E -v '(StorageUrl|CdnUrl)' ; test $$? -eq 1
|
2015-09-23 01:47:16 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
doc: rclone.1 MANUAL.html MANUAL.txt
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
rclone.1: MANUAL.md
|
|
|
|
pandoc -s --from markdown --to man MANUAL.md -o rclone.1
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
MANUAL.md: make_manual.py docs/content/*.md
|
|
|
|
./make_manual.py
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
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
|
2014-04-25 01:11:08 +08:00
|
|
|
|
|
|
|
install: rclone
|
|
|
|
install -d ${DESTDIR}/usr/bin
|
2014-07-19 20:12:20 +08:00
|
|
|
install -t ${DESTDIR}/usr/bin ${GOPATH}/bin/rclone
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2014-03-29 06:34:13 +08:00
|
|
|
clean:
|
2014-04-25 01:11:08 +08:00
|
|
|
go clean ./...
|
2014-03-29 06:34:13 +08:00
|
|
|
find . -name \*~ | xargs -r rm -f
|
2014-04-18 05:32:39 +08:00
|
|
|
rm -rf build docs/public
|
2016-02-01 00:33:20 +08:00
|
|
|
rm -f rclone rclonetest/rclonetest
|
2014-03-29 06:34:13 +08:00
|
|
|
|
|
|
|
website:
|
2014-04-18 05:32:39 +08:00
|
|
|
cd docs && hugo
|
2014-03-29 06:34:13 +08:00
|
|
|
|
|
|
|
upload_website: website
|
2014-07-19 20:12:20 +08:00
|
|
|
rclone -v sync docs/public memstore:www-rclone-org
|
2014-03-29 06:34:13 +08:00
|
|
|
|
|
|
|
upload:
|
2014-07-19 20:12:20 +08:00
|
|
|
rclone -v copy build/ memstore:downloads-rclone-org
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2015-11-24 05:58:54 +08:00
|
|
|
upload_github:
|
2016-01-02 20:18:32 +08:00
|
|
|
./upload-github $(TAG)
|
2015-11-24 05:58:54 +08:00
|
|
|
|
2014-04-25 01:11:08 +08:00
|
|
|
cross: doc
|
|
|
|
./cross-compile $(TAG)
|
2014-03-29 06:34:13 +08:00
|
|
|
|
2016-02-21 18:29:48 +08:00
|
|
|
beta:
|
2015-11-12 00:55:49 +08:00
|
|
|
./cross-compile $(TAG)β
|
|
|
|
rm build/*-current-*
|
|
|
|
rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β
|
2015-11-30 18:10:41 +08:00
|
|
|
@echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/
|
2015-11-12 00:55:49 +08:00
|
|
|
|
2016-01-16 22:10:57 +08:00
|
|
|
serve: website
|
2014-04-18 05:32:39 +08:00
|
|
|
cd docs && hugo server -v -w
|
2014-04-25 01:11:08 +08:00
|
|
|
|
2016-02-01 01:50:13 +08:00
|
|
|
tag: doc
|
2014-04-25 01:11:08 +08:00
|
|
|
@echo "Old tag is $(LAST_TAG)"
|
|
|
|
@echo "New tag is $(NEW_TAG)"
|
2016-06-04 03:09:34 +08:00
|
|
|
echo -e "package fs\n\n// Version of rclone\nvar Version = \"$(NEW_TAG)\"\n" | gofmt > fs/version.go
|
2014-04-25 01:11:08 +08:00
|
|
|
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)
|
2015-06-06 17:05:21 +08:00
|
|
|
@echo "Add this to changelog in docs/content/changelog.md"
|
2014-06-27 00:57:32 +08:00
|
|
|
@echo " * $(NEW_TAG) -" `date -I`
|
2014-04-25 01:11:08 +08:00
|
|
|
@git log $(LAST_TAG)..$(NEW_TAG) --oneline
|
|
|
|
@echo "Then commit the changes"
|
2015-06-06 17:05:21 +08:00
|
|
|
@echo git commit -m \"Version $(NEW_TAG)\" -a -v
|
2014-04-25 01:11:08 +08:00
|
|
|
@echo "And finally run make retag before make cross etc"
|
|
|
|
|
|
|
|
retag:
|
2014-06-27 00:57:32 +08:00
|
|
|
git tag -f $(LAST_TAG)
|
2014-07-27 00:18:29 +08:00
|
|
|
|
|
|
|
gen_tests:
|
2015-02-15 02:48:08 +08:00
|
|
|
cd fstest/fstests && go generate
|