-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (52 loc) · 2.84 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
.PHONY: all
all: tidy multi_spider baidu_baike_spider baidu_image_spider baidu_tieba_spider baidu_zhidao_spider bnu_spider douban_spider feixiaohao_spider levi_spider nike_spider youtube_spider zdic_spider zhihu_spider example_spider
module := github.com/lizongying/go-crawler
shell:
@echo 'SHELL='$(SHELL)
tidy:
go mod tidy
multi_spider:
go vet ./cmd/multi_spider
go build -ldflags "-s -w" -o ./releases/multi_spider ./cmd/multi_spider
baidu_baike_spider:
go vet ./cmd/baidu_baike_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=baidu_baike_spider" -o ./releases/baidu_baike_spider ./cmd/baidu_baike_spider
baidu_image_spider:
go vet ./cmd/baidu_image_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=baidu_image_spider" -o ./releases/baidu_image_spider ./cmd/baidu_image_spider
baidu_tieba_spider:
go vet ./cmd/baidu_tieba_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=baidu_tieba_spider" -o ./releases/baidu_tieba_spider ./cmd/baidu_tieba_spider
baidu_zhidao_spider:
go vet ./cmd/baidu_zhidao_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=baidu_zhidao_spider" -o ./releases/baidu_zhidao_spider ./cmd/baidu_zhidao_spider
bnu_spider:
go vet ./cmd/bnu_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=bnu_spider" -o ./releases/bnu_spider ./cmd/bnu_spider
douban_spider:
go vet ./cmd/douban_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=douban_spider" -o ./releases/douban_spider ./cmd/douban_spider
feixiaohao_spider:
go vet ./cmd/feixiaohao_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=feixiaohao_spider" -o ./releases/feixiaohao_spider ./cmd/feixiaohao_spider
levi_spider:
go vet ./cmd/levi_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=levi_spider" -o ./releases/levi_spider ./cmd/levi_spider
nike_spider:
go vet ./cmd/nike_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=nike_spider" -o ./releases/nike_spider ./cmd/nike_spider
youtube_spider:
go vet ./cmd/youtube_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=youtube_spider" -o ./releases/youtube_spider ./cmd/youtube_spider
zdic_spider:
go vet ./cmd/zdic_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=zdic_spider" -o ./releases/zdic_spider ./cmd/zdic_spider
zhihu_spider:
go vet ./cmd/zhihu_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=zhihu_spider" -o ./releases/zhihu_spider ./cmd/zhihu_spider
example_spider:
go vet ./cmd/example_spider
go build -ldflags "-s -w -X $(module)/pkg/logger.name=example_spider" -o ./releases/example_spider ./cmd/example_spider
example_spider_linux_amd64:
go vet ./cmd/example_spider
CC=x86_64-linux-musl-gcc GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CGO_LDFLAGS="-static" go build -ldflags "-s -w -X $(module)/pkg/logger.name=example_spider" -o ./releases/example_spider_linux_amd64 ./cmd/example_spider