diff --git a/Makefile b/Makefile index 367e4aed6e..ee895f8f8b 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ test: build go test ./utility/... $(GO_TEST_FLAGS) go test ./web/... $(GO_TEST_FLAGS) -web: preparation +web: preparation model $(MAKE) -C web .PHONY: advice binary build clean documentation format model package preparation run search_index source_path test diff --git a/model/Makefile b/model/Makefile index 2382a6a2bb..328b33f5ef 100644 --- a/model/Makefile +++ b/model/Makefile @@ -11,14 +11,18 @@ # See the License for the specific language governing permissions and # limitations under the License. +all: generated + +SUFFIXES: + MAKE_ARTIFACTS = generated-stamp -all: generated +include ../Makefile.INCLUDE generated: generated-stamp generated-stamp: data.proto - protoc --go_out=generated/ data.proto + protoc --proto_path=$(PREFIX)/include:. --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto touch $@ clean: diff --git a/model/data.proto b/model/data.proto index ce6cff9209..1678da4737 100644 --- a/model/data.proto +++ b/model/data.proto @@ -11,7 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package dto; +package io.prometheus; + +import "google/protobuf/descriptor.proto"; message LabelPair { optional string name = 1; diff --git a/model/generated/.gitignore b/model/generated/.gitignore index cd6d21b5f9..01d8818eb2 100644 --- a/model/generated/.gitignore +++ b/model/generated/.gitignore @@ -1,4 +1,2 @@ -*.cc -*.go -*.h -*.o +data.pb.go +descriptor.blob diff --git a/web/blob/Makefile b/web/blob/Makefile index 891010d56a..171d1affbd 100644 --- a/web/blob/Makefile +++ b/web/blob/Makefile @@ -13,10 +13,19 @@ all: files.go -files.go: $(shell find ../templates/ ../static/ -type f) - ../../utility/embed-static.sh ../static ../templates | gofmt > $@ +SUFFIXES: + +generated: + mkdir -vp generated + +generated/protocol_buffer.descriptor: generated ../../model/generated/descriptor.blob + cp ../../model/generated/descriptor.blob -f $@ + +files.go: $(shell find ../templates/ ../static/ -type f) generated/protocol_buffer.descriptor + ../../utility/embed-static.sh ../static ../templates ./generated | gofmt > $@ clean: -rm files.go + -rm -rf generated .PHONY: clean