Skip to content

Commit

Permalink
Makefile fixes. (istio#318)
Browse files Browse the repository at this point in the history
- 'make clean' wasn't cleaning everything. Now it is. This
fixes the gencheck CI job.
  • Loading branch information
geeknoid authored and istio-testing committed Oct 3, 2019
1 parent 70a3598 commit 21868f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 451 deletions.
24 changes: 16 additions & 8 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

export GO111MODULE=on

pwd := $(shell pwd)

# make targets
Expand All @@ -39,6 +37,9 @@ fmt: format-go
update-charts: installer.sha
@scripts/run_update_charts.sh `cat installer.sha`

clean-charts:
@rm -fr data/charts

# make target dependencies
vfsgen: data/ update-charts
go generate ./...
Expand All @@ -49,9 +50,12 @@ clean-vfs:
gen: generate-values generate-types vfsgen
generate: gen

gen-check: clean gen check-clean-repo
tidy:
@go mod tidy

gen-check: clean gen tidy check-clean-repo

clean: clean-values clean-types clean-vfs
clean: clean-values clean-types clean-vfs clean-charts

default: mesh

Expand Down Expand Up @@ -80,15 +84,19 @@ protoc_gen_python_plugin := $(protoc_gen_python_prefix):$(repo_dir)/$(python_out

protoc_gen_docs_plugin := --docs_out=warnings=true,mode=html_fragment_with_front_matter:$(repo_dir)/

protoc_gen_k8s_support_plugins := --jsonshim_out=$(gogo_mapping):$(out_path) --deepcopy_out=$(gogo_mapping):$(out_path)

########################

types_v1alpha2_path := pkg/apis/istio/v1alpha2
types_v1alpha2_protos := $(wildcard $(types_v1alpha2_path)/*.proto)
types_v1alpha2_pb_gos := $(types_v1alpha2_protos:.proto=.pb.go)
types_v1alpha2_pb_pythons := $(patsubst $(types_v1alpha2_path)/%.proto,$(python_output_path)/$(types_v1alpha2_path)/%_pb2.py,$(types_v1alpha2_protos))
types_v1alpha2_pb_docs := $(types_v1alpha2_protos:.proto=.pb.html)
types_v1alpha2_pb_docs := $(types_v1alpha2_path)/v1alpha2.pb.html
types_v1alpha2_openapi := $(types_v1alpha2_protos:.proto=.json)

$(types_v1alpha2_pb_gos) $(types_v1alpha2_pb_docs) $(types_v1alpha2_pb_pythons): $(types_v1alpha2_protos)
@$(protoc) $(go_plugin) $(protoc_gen_docs_plugin)$(types_v1alpha2_path) $(protoc_gen_python_plugin) $^
@$(protoc) $(go_plugin) $(protoc_gen_k8s_support_plugins) $(protoc_gen_docs_plugin)$(types_v1alpha2_path) $(protoc_gen_python_plugin) $^
@cp -r ${TMPDIR}/pkg/* pkg/
@sed -i 's|github.com/gogo/protobuf/protobuf/google/protobuf|github.com/gogo/protobuf/types|g' $(types_v1alpha2_path)/istiocontrolplane_types.pb.go
@go run $(repo_dir)/pkg/apis/istio/fixup_structs/main.go -f $(types_v1alpha2_path)/istiocontrolplane_types.pb.go
Expand All @@ -104,11 +112,11 @@ values_v1alpha1_path := pkg/apis/istio/v1alpha1/
values_v1alpha1_protos := $(wildcard $(values_v1alpha1_path)/values_types*.proto)
values_v1alpha1_pb_gos := $(values_v1alpha1_protos:.proto=.pb.go)
values_v1alpha1_pb_pythons := $(patsubst $(values_v1alpha1_path)/%.proto,$(python_output_path)/$(values_v1alpha1_path)/%_pb2.py,$(values_v1alpha1_protos))
values_v1alpha1_pb_docs := $(values_v1alpha1_protos:.proto=.pb.html)
values_v1alpha1_pb_docs := $(values_v1alpha1_path)/v1alpha1.pb.html
values_v1alpha1_openapi := $(values_v1alpha1_protos:.proto=.json)

$(values_v1alpha1_pb_gos) $(values_v1alpha1_pb_docs) $(values_v1alpha1_pb_pythons): $(values_v1alpha1_protos)
@$(protoc) $(go_plugin) $(protoc_gen_docs_plugin)$(values_v1alpha1_path) $(protoc_gen_python_plugin) $^
@$(protoc) $(go_plugin) $(protoc_gen_k8s_support_plugins) $(protoc_gen_docs_plugin)$(values_v1alpha1_path) $(protoc_gen_python_plugin) $^
@cp -r ${TMPDIR}/pkg/* pkg/
@sed -i 's|github.com/gogo/protobuf/protobuf/google/protobuf|github.com/gogo/protobuf/types|g' $(values_v1alpha1_path)/values_types.pb.go
@GOARCH=amd64 GOOS=linux go run $(repo_dir)/pkg/apis/istio/fixup_structs/main.go -f $(values_v1alpha1_path)/values_types.pb.go
Expand Down
Loading

0 comments on commit 21868f4

Please sign in to comment.