* Makefile: support running with multiple parallel jobs (e.g. -j8)

This commit is contained in:
Simon Zolin 2020-08-03 19:13:51 +03:00
parent 3cecd6f090
commit e57cbc36d9
1 changed files with 11 additions and 3 deletions

View File

@ -98,7 +98,8 @@ all: build
init: init:
git config core.hooksPath .githooks git config core.hooksPath .githooks
build: dependencies client build: client_with_deps
go mod download
PATH=$(GOPATH)/bin:$(PATH) go generate ./... PATH=$(GOPATH)/bin:$(PATH) go generate ./...
CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)" CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean PATH=$(GOPATH)/bin:$(PATH) packr clean
@ -106,6 +107,10 @@ build: dependencies client
client: client:
npm --prefix client run build-prod npm --prefix client run build-prod
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
client-watch: client-watch:
npm --prefix client run watch npm --prefix client run watch
@ -139,7 +144,9 @@ test:
@echo Running Go unit-tests @echo Running Go unit-tests
go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./... go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./...
ci: dependencies client test ci: client_with_deps
go mod download
$(MAKE) test
dependencies: dependencies:
npm --prefix client ci npm --prefix client ci
@ -176,7 +183,8 @@ docker-multi-arch:
@echo If the image was pushed to the registry, you can now run it: @echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME) @echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: dependencies client release: client_with_deps
go mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL) @echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND) CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call repack_dist) $(call repack_dist)