Files
coredns/Makefile

83 lines
2.4 KiB
Makefile
Raw Normal View History

# Makefile for building CoreDNS
GITCOMMIT:=$(shell git describe --dirty --always)
BINARY:=coredns
SYSTEM:=
CHECKS:=check
BUILDOPTS:=-v
GOPATH?=$(HOME)/go
PRESUBMIT:=core coremain plugin test request
MAKEPWD:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
2018-10-09 14:36:42 -04:00
CGO_ENABLED:=0
BK8s datasource middleware -- PoC for A records (#153) * Laying down kubernetes middleware foundation * Duplicated a bunch of code form etcd middleware * Duplicated code hacked to compile and load as a separate middleware * Adding verbose build option to Makefile * Removing stubzone and tls support tls and stubzone support was carried over from base etcd middleware code. Removing to simplify the kube middleware implementation. (For now.) * Adding conf directory for sample conf files * Removing stubzone support from query handler * Remove upstream and proxy from k8s corefile. Not sure that upstream or proxy makes sense for a k8s backed zone. * Comment out use of singleflight serialization * Removing parsing support for "upstream" directive from k8s * Removing upstream directive parsing code * Removing CNAME and TXT lookup implementation * Create README.md Brain-dump of DNS record name assembly and open work items. * Adding notes about wildcard handling * Adding basic k8s API client * Fleshing out methods on k8s connector * Remove PathPrefix from middleware init * Removing incorrect plural * Adding brute-force k8s service lookup functions * Initializing k8s API connector during startup * Hacking around to call k8s connector * Parsing incoming domain name into serviceName and namespace * Improving and simplifying k8s zone matching and label segmentation * Removing unused functions carried over from etcd middleware * Adding basic return of k8s data to DNS client * updated debugging println statements to flag with "[debug]" * removed code in kubernetes.go::Records that was a hold-over from etcd middleware. * Removed some random exploratory hacking. * Minior README.md updates * Updating with demo instructions * Updating README.md with CoreFile and removing completed TODO items * Updating conf file and README to reflect DNS response cache works * Disabling DNS response caching * Adding debug statement on entry to Records() * Changing port number in exampes to port 53. * Misc style and clarity changes * Removing empty function definitions * Adding comment to track future cleanup * Refactoring README to follow style of other middleware * Exposing dataobject field (typo)
2016-06-06 12:49:53 -07:00
.PHONY: all
all: coredns
.PHONY: coredns
coredns: $(CHECKS)
GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY)
.PHONY: check
check: presubmit core/plugin/zplugin.go core/dnsserver/zdirectives.go
.PHONY: travis
travis:
ifeq ($(TEST_TYPE),core)
( cd request ; GO111MODULE=on go test -v -race ./... )
( cd core ; GO111MODULE=on go test -v -race ./... )
( cd coremain ; GO111MODULE=on go test -v -race ./... )
endif
ifeq ($(TEST_TYPE),integration)
( cd test ; GO111MODULE=on go test -v -race ./... )
endif
ifeq ($(TEST_TYPE),plugin)
( cd plugin ; GO111MODULE=on go test -v -race ./... )
endif
ifeq ($(TEST_TYPE),coverage)
for d in `go list ./... | grep -v vendor`; do \
t=$$(date +%s); \
GO111MODULE=on go test -i -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
GO111MODULE=on go test -v -coverprofile=cover.out -covermode=atomic $$d || exit 1; \
echo "Coverage test $$d took $$(($$(date +%s)-t)) seconds"; \
if [ -f cover.out ]; then \
cat cover.out >> coverage.txt; \
rm cover.out; \
fi; \
done
endif
ifeq ($(TEST_TYPE),fuzzit)
# skip fuzzing for PR
if [ "$(TRAVIS_PULL_REQUEST)" = "false" ] || [ "$(FUZZIT_TYPE)" = "local-regression" ] ; then \
export GO111MODULE=off; \
go get -u github.com/dvyukov/go-fuzz/go-fuzz-build; \
go get -u -v .; \
cd ../../go-acme/lego && git checkout v2.5.0; \
cd ../../coredns/coredns; \
LIBFUZZER=YES $(MAKE) -f Makefile.fuzz all; \
$(MAKE) -sf Makefile.fuzz fuzzit; \
for i in `$(MAKE) -sf Makefile.fuzz echo`; do echo $$i; \
./fuzzit create job --type $(FUZZIT_TYPE) coredns/$$i ./$$i; \
done; \
fi;
endif
core/plugin/zplugin.go core/dnsserver/zdirectives.go: plugin.cfg
GO111MODULE=on go generate coredns.go
.PHONY: gen
gen:
GO111MODULE=on go generate coredns.go
.PHONY: pb
pb:
$(MAKE) -C pb
# Presubmit runs all scripts in .presubmit; any non 0 exit code will fail the build.
.PHONY: presubmit
presubmit:
@for pre in $(MAKEPWD)/.presubmit/* ; do "$$pre" $(PRESUBMIT) || exit 1 ; done
.PHONY: clean
clean:
GO111MODULE=on go clean
rm -f coredns