-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
116 lines (102 loc) · 3.32 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
GOMOD=$(shell test -f "go.work" && echo "readonly" || echo "vendor")
LDFLAGS=-s -w
cli:
rm -rf bin/*
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/wof-mdparse cmd/wof-mdparse/main.go
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/wof-md2feed cmd/wof-md2feed/main.go
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/wof-md2html cmd/wof-md2html/main.go
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/wof-md2idx cmd/wof-md2idx/main.go
go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o bin/wof-md2ts cmd/wof-md2ts/main.go
dist-build:
# OS=darwin make dist-os
OS=windows make dist-os
OS=linux make dist-os
dist-os:
mkdir -p dist/$(OS)
GOOS=$(OS) GOARCH=386 go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o dist/$(OS)/wof-mdparse cmd/wof-mdparse/main.go
GOOS=$(OS) GOARCH=386 go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o dist/$(OS)/wof-md2feed cmd/wof-md2feed/main.go
GOOS=$(OS) GOARCH=386 go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o dist/$(OS)/wof-md2html cmd/wof-md2html/main.go
GOOS=$(OS) GOARCH=386 go build -mod $(GOMOD) -ldflags="$(LDFLAGS)" -o dist/$(OS)/wof-md2idx cmd/wof-md2idx/main.go
test:
@make test-prune
@make test-posts
@make test-indices
@make test-feeds
test-prune:
find fixtures/blog -type f -name '*.html' | xargs rm
find fixtures/blog -type d -empty -delete
test-posts:
go run -mod $(GOMOD) cmd/wof-md2html/main.go \
-mode directory \
-html-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-template-uri cwd:///fixtures/templates/blog \
-header header \
-footer footer \
blog/
test-indices:
@make test-indices-tags
@make test-indices-authors
@make test-indices-ymd
@make test-indices-landing
test-indices-tags:
go run -mod $(GOMOD) cmd/wof-md2idx/main.go \
-mode tags \
-html-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-html-template-uri cwd:///fixtures/templates/blog \
-header header \
-footer footer \
-list list \
-rollup rollup \
blog/
test-indices-authors:
go run -mod $(GOMOD) cmd/wof-md2idx/main.go \
-mode authors \
-html-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-html-template-uri cwd:///fixtures/templates/blog \
-header header \
-footer footer \
-list list \
-rollup rollup \
blog/
test-indices-ymd:
go run -mod $(GOMOD) cmd/wof-md2idx/main.go \
-mode ymd \
-html-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-html-template-uri cwd:///fixtures/templates/blog \
-header header \
-footer footer \
-list list \
-rollup rollup \
blog/
test-indices-landing:
go run -mod $(GOMOD) cmd/wof-md2idx/main.go \
-mode landing \
-html-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-html-template-uri cwd:///fixtures/templates/blog \
-header header \
-footer footer \
-list list \
-rollup rollup \
blog/
test-feeds:
@make test-feeds-atom
@make test-feeds-rss
test-feeds-atom:
go run -mod $(GOMOD) cmd/wof-md2feed/main.go \
-format atom_10 \
-feeds-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-template-uri cwd:///fixtures/templates/feeds \
blog/
test-feeds-rss:
go run -mod $(GOMOD) cmd/wof-md2feed/main.go \
-format rss_20 \
-feeds-bucket-uri cwd:///fixtures/ \
-markdown-bucket-uri cwd:///fixtures/ \
-template-uri cwd:///fixtures/templates/feeds \
blog/