mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-14 10:00:13 +00:00
24 lines
553 B
Makefile
24 lines
553 B
Makefile
.PHONY: all test clean
|
|
|
|
DIRS=$(shell find . -maxdepth 2 -name *.go | xargs -n1 dirname | sort -u)
|
|
TARGETS=$(join $(patsubst %,%/,$(DIRS)),$(patsubst ./%,%,$(DIRS)))
|
|
BUILD_IN_CONTAINER=true
|
|
RM=--rm
|
|
|
|
all: $(TARGETS)
|
|
|
|
ifeq ($(BUILD_IN_CONTAINER),true)
|
|
$(TARGETS):
|
|
$(SUDO) docker run -ti $(RM) -v $(shell pwd)/../:/go/src/github.com/weaveworks/scope -e GOARCH -e GOOS \
|
|
weaveworks/scope-backend-build -C extras $@
|
|
else
|
|
$(TARGETS):
|
|
go build -ldflags "-extldflags \"-static\"" -tags netgo -o $@ ./$(@D)
|
|
endif
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
clean:
|
|
go clean ./...
|