...

Text file src/github.com/cert-manager/issuer-lib/make/_shared/generate-verify/02_mod.mk

Documentation: github.com/cert-manager/issuer-lib/make/_shared/generate-verify

     1# Copyright 2023 The cert-manager Authors.
     2#
     3# Licensed under the Apache License, Version 2.0 (the "License");
     4# you may not use this file except in compliance with the License.
     5# You may obtain a copy of the License at
     6#
     7#     http://www.apache.org/licenses/LICENSE-2.0
     8#
     9# Unless required by applicable law or agreed to in writing, software
    10# distributed under the License is distributed on an "AS IS" BASIS,
    11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12# See the License for the specific language governing permissions and
    13# limitations under the License.
    14
    15.PHONY: generate
    16## Generate all generate targets.
    17## @category [shared] Generate/ Verify
    18generate: $$(shared_generate_targets)
    19	@echo "The following targets cannot be run simultaniously with each other or other generate scripts:"
    20	$(foreach TARGET,$(shared_generate_targets_dirty), $(MAKE) $(TARGET))
    21
    22verify_script := $(dir $(lastword $(MAKEFILE_LIST)))/util/verify.sh
    23
    24# Run the supplied make target argument in a temporary workspace and diff the results.
    25verify-%: FORCE
    26	+$(verify_script) $(MAKE) $*
    27
    28verify_generated_targets = $(shared_generate_targets:%=verify-%)
    29verify_generated_targets_dirty = $(shared_generate_targets_dirty:%=verify-%)
    30
    31verify_targets = $(sort $(verify_generated_targets) $(shared_verify_targets))
    32verify_targets_dirty = $(sort $(verify_generated_targets_dirty) $(shared_verify_targets_dirty))
    33
    34.PHONY: verify
    35## Verify code and generate targets.
    36## @category [shared] Generate/ Verify
    37verify: $$(verify_targets)
    38	@echo "The following targets create temporary files in the current directory, that is why they have to be run last:"
    39	$(foreach TARGET,$(verify_targets_dirty), $(MAKE) $(TARGET))

View as plain text