This repository has been archived by the owner on Aug 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (67 loc) · 2.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# Simple Makefile for conviently testing, building and deploying experiment.
#
PROJECT = rss2
VERSION = $(shell grep -m 1 'Version =' $(PROJECT).go | cut -d\` -f 2)
BRANCH = $(shell git branch | grep '* ' | cut -d\ -f 2)
OS = $(shell uname)
EXT =
ifeq ($(OS), Windows)
EXT = .exe
endif
PROJECT_LIST = rss2json
build: package $(PROJECT_LIST)
package: rss2.go
go build
rss2json$(EXT): bin/rss2json$(EXT)
bin/rss2json$(EXT): rss2.go cmd/rss2json/rss2json.go
go build -o bin/rss2json$(EXT) cmd/rss2json/rss2json.go
install:
env GOBIN=$(GOPATH)/bin go install cmd/rss2json/rss2json.go
website: page.tmpl README.md nav.md INSTALL.md LICENSE css/site.css
./mk-website.bash
test:
go test
clean:
if [ -d bin ]; then rm -fR bin; fi
if [ -d dist ]; then rm -fR dist; fi
if [ -d man ]; then rm -fR man; fi
man: build
mkdir -p man/man1
bin/rss2json -generate-manpage | nroff -Tutf8 -man > man/man1/rss2json.1
dist/linux-amd64:
mkdir -p dist/bin
env GOOS=linux GOARCH=amd64 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
cd dist && zip -r $(PROJECT)-$(VERSION)-linux-amd64.zip README.md LICENSE INSTALL.md docs/* bin/*
rm -fR dist/bin
dist/windows-amd64:
mkdir -p dist/bin
env GOOS=windows GOARCH=amd64 go build -o dist/bin/rss2json.exe cmd/rss2json/rss2json.go
cd dist && zip -r $(PROJECT)-$(VERSION)-windows-amd64.zip README.md LICENSE INSTALL.md docs/* bin/*
rm -fR dist/bin
dist/macosx-amd64:
mkdir -p dist/bin
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
cd dist && zip -r $(PROJECT)-$(VERSION)-macosx-amd64.zip README.md LICENSE INSTALL.md docs/* bin/*
rm -fR dist/bin
dist/raspbian-arm7:
mkdir -p dist/bin
env GOOS=linux GOARCH=arm GOARM=7 go build -o dist/bin/rss2json cmd/rss2json/rss2json.go
cd dist && zip -r $(PROJECT)-$(VERSION)-raspbian-arm7.zip README.md LICENSE INSTALL.md docs/* bin/*
rm -fR dist/bin
distribute_docs:
mkdir -p dist/docs
cp -v README.md dist/
cp -v LICENSE dist/
cp -v INSTALL.md dist/
cp -vR docs/* dist/docs/
./package-versions.bash > dist/package-versions.txt
release: distribute_docs dist/linux-amd64 dist/windows-amd64 dist/macosx-amd64 dist/raspbian-arm7
status:
git status
save:
if [ "$(msg)" != "" ]; then git commit -am "$(msg)"; else git commit -am "Quick Save"; fi
git push origin $(BRANCH)
publish:
./mk-website.bash
./publish.bash