diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 4246ccbeba..64634df4fc 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -174,10 +174,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-#{{ .Config.Provider }}#/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 481ca4fcc1..a4c1924c90 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -138,10 +138,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-acme/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index fe06626130..063c3a17c8 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -148,10 +148,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-aws/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index d11a9b7d5e..dc8896d7d6 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -148,10 +148,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-cloudflare/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 645d420c9a..5f63f283c2 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -151,10 +151,13 @@ lint_provider.fix: # `make provider_no_deps` builds the provider binary directly, without ensuring that # `cmd/pulumi-resource-docker/schema.json` is valid and up to date. # To create a release ready binary, you should use `make provider`. +.PHONY: provider provider_no_deps +build_provider_cmd = cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER) +provider: bin/$(PROVIDER) provider_no_deps: - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "$(LDFLAGS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) - -provider: tfgen provider_no_deps + $(call build_provider_cmd) +bin/$(PROVIDER): .make/schema + $(call build_provider_cmd) test: export PATH := $(WORKING_DIR)/bin:$(PATH) test: