Przeglądaj źródła

Remove makefile

tags/v2.1.8^2
9seconds 2 miesięcy temu
rodzic
commit
ad88afeecd
1 zmienionych plików z 0 dodań i 121 usunięć
  1. 0
    121
      Makefile

+ 0
- 121
Makefile Wyświetl plik

@@ -1,121 +0,0 @@
1
-ROOT_DIR     := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
2
-IMAGE_NAME   := mtg
3
-APP_NAME     := $(IMAGE_NAME)
4
-
5
-GOLANGCI_LINT_VERSION := v1.48.0
6
-
7
-VERSION            := $(shell git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)
8
-COMMON_BUILD_FLAGS := -trimpath -mod=readonly -ldflags="-extldflags '-static' -s -w -X 'main.version=$(VERSION)'"
9
-
10
-FUZZ_FLAGS := -fuzztime=120s
11
-
12
-GOBIN  := $(ROOT_DIR)/.bin
13
-GOTOOL := env "GOBIN=$(GOBIN)" "PATH=$(ROOT_DIR)/.bin:$(PATH)"
14
-
15
-# -----------------------------------------------------------------------------
16
-
17
-.PHONY: all
18
-all: build
19
-
20
-.PHONY: build
21
-build:
22
-	@go build $(COMMON_BUILD_FLAGS) -o "$(APP_NAME)"
23
-
24
-$(APP_NAME): build
25
-
26
-.PHONY: static
27
-static:
28
-	@env CGO_ENABLED=0 GOOS=linux go build \
29
-		$(COMMON_BUILD_FLAGS) \
30
-		-tags netgo \
31
-		-a \
32
-		-o "$(APP_NAME)"
33
-
34
-vendor: go.mod go.sum
35
-	@$(MOD_ON) go mod vendor
36
-
37
-.bin:
38
-	@mkdir -p "$(GOBIN)" || true
39
-
40
-.PHONY: fmt
41
-fmt:
42
-	@$(GOTOOL) gofumpt -w -extra "$(ROOT_DIR)"
43
-
44
-.PHONY: test
45
-test:
46
-	@go test -v ./...
47
-
48
-.PHONY: citest
49
-citest:
50
-	@go test -coverprofile=coverage.txt -covermode=atomic -parallel 2 -race -v ./...
51
-
52
-.PHONY: clean
53
-clean:
54
-	@git clean -xfd && \
55
-		git reset --hard >/dev/null && \
56
-		git submodule foreach --recursive sh -c 'git clean -xfd && git reset --hard' >/dev/null
57
-
58
-.PHONY: lint
59
-lint:
60
-	@$(GOTOOL) golangci-lint run
61
-
62
-.PHONY: release
63
-release:
64
-	@$(GOTOOL) goreleaser release --snapshot --rm-dist && \
65
-		find "$(ROOT_DIR)/dist" -type d | grep -vP "dist$$" | xargs -r rm -rf && \
66
-		rm -f "$(ROOT_DIR)/dist/config.yaml"
67
-
68
-.PHONY: docker
69
-docker:
70
-	@docker build --pull -t "$(IMAGE_NAME)" "$(ROOT_DIR)"
71
-
72
-.PHONY: doc
73
-doc:
74
-	@$(GOTOOL) godoc -http 0.0.0.0:10000
75
-
76
-.PHONY: install-tools
77
-install-tools: install-tools-lint install-tools-godoc install-tools-gofumpt install-tools-goreleaser
78
-
79
-.PHONY: install-tools-lint
80
-install-tools-lint: .bin
81
-	@curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
82
-		| bash -s -- -b "$(GOBIN)" "$(GOLANGCI_LINT_VERSION)"
83
-
84
-.PHONY: install-tools-godoc
85
-install-tools-godoc: .bin
86
-	@$(GOTOOL) go install golang.org/x/tools/cmd/godoc@latest
87
-
88
-.PHONY: install-tools-gofumpt
89
-install-tools-gofumpt: .bin
90
-	@$(GOTOOL) go install mvdan.cc/gofumpt@latest
91
-
92
-.PHONY: goreleaser
93
-install-tools-goreleaser: .bin
94
-	@$(GOTOOL) go install github.com/goreleaser/goreleaser@latest
95
-
96
-.PHONY: update-deps
97
-update-deps:
98
-	@go get -u && go mod tidy -go=1.18
99
-
100
-.PHONY: fuzz
101
-fuzz: fuzz-ClientHello fuzz-ServerGenerateHandshakeFrame fuzz-ClientHandshake fuzz-ServerReceive fuzz-ServerSend
102
-
103
-.PHONY: fuzz-ClientHello
104
-fuzz-ClientHello:
105
-	@go test -fuzz=FuzzClientHello $(FUZZ_FLAGS) "$(ROOT_DIR)/mtglib/internal/faketls"
106
-
107
-.PHONY: fuzz-ServerGenerateHandshakeFrame
108
-fuzz-ServerGenerateHandshakeFrame:
109
-	@go test -fuzz=FuzzServerGenerateHandshakeFrame $(FUZZ_FLAGS) "$(ROOT_DIR)/mtglib/internal/obfuscated2"
110
-
111
-.PHONY: fuzz-ClientHandshake
112
-fuzz-ClientHandshake:
113
-	@go test -fuzz=FuzzClientHandshake $(FUZZ_FLAGS) "$(ROOT_DIR)/mtglib/internal/obfuscated2"
114
-
115
-.PHONY: fuzz-ServerReceive
116
-fuzz-ServerReceive:
117
-	@go test -fuzz=FuzzServerReceive $(FUZZ_FLAGS) "$(ROOT_DIR)/mtglib/internal/obfuscated2"
118
-
119
-.PHONY: fuzz-ServerSend
120
-fuzz-ServerSend:
121
-	@go test -fuzz=FuzzServerSend $(FUZZ_FLAGS) "$(ROOT_DIR)/mtglib/internal/obfuscated2"

Ładowanie…
Anuluj
Zapisz