|
| 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 | +# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. |
| 16 | +# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base/Makefile instead. |
| 17 | + |
| 18 | +# NOTE FOR DEVELOPERS: "How do the Makefiles work and how can I extend them?" |
| 19 | +# |
| 20 | +# Shared Makefile logic lives in the make/_shared/ directory. The source of truth for these files |
| 21 | +# lies outside of this repository, eg. in the cert-manager/makefile-modules repository. |
| 22 | +# |
| 23 | +# Logic specific to this repository must be defined in the make/00_mod.mk and make/02_mod.mk files: |
| 24 | +# - The make/00_mod.mk file is included first and contains variable definitions needed by |
| 25 | +# the shared Makefile logic. |
| 26 | +# - The make/02_mod.mk file is included later, it can make use of most of the shared targets |
| 27 | +# defined in the make/_shared/ directory (all targets defined in 00_mod.mk and 01_mod.mk). |
| 28 | +# This file should be used to define targets specific to this repository. |
| 29 | + |
| 30 | +################################## |
| 31 | + |
| 32 | +# Some modules build their dependencies from variables, we want these to be |
| 33 | +# evaluated at the last possible moment. For this we use second expansion to |
| 34 | +# re-evaluate the generate and verify targets a second time. |
| 35 | +# |
| 36 | +# See https://www.gnu.org/software/make/manual/html_node/Secondary-Expansion.html |
| 37 | +.SECONDEXPANSION: |
| 38 | + |
| 39 | +# For details on some of these "prelude" settings, see: |
| 40 | +# https://clarkgrubb.com/makefile-style-guide |
| 41 | +MAKEFLAGS += --warn-undefined-variables --no-builtin-rules |
| 42 | +SHELL := /usr/bin/env bash |
| 43 | +.SHELLFLAGS := -uo pipefail -c |
| 44 | +.DEFAULT_GOAL := help |
| 45 | +.DELETE_ON_ERROR: |
| 46 | +.SUFFIXES: |
| 47 | +FORCE: |
| 48 | + |
| 49 | +noop: # do nothing |
| 50 | + |
| 51 | +# Set empty value for MAKECMDGOALS to prevent the "warning: undefined variable 'MAKECMDGOALS'" |
| 52 | +# warning from happening when running make without arguments |
| 53 | +MAKECMDGOALS ?= |
| 54 | + |
| 55 | +################################## |
| 56 | +# Host OS and architecture setup # |
| 57 | +################################## |
| 58 | + |
| 59 | +# The reason we don't use "go env GOOS" or "go env GOARCH" is that the "go" |
| 60 | +# binary may not be available in the PATH yet when the Makefiles are |
| 61 | +# evaluated. HOST_OS and HOST_ARCH only support Linux, *BSD and macOS (M1 |
| 62 | +# and Intel). |
| 63 | +host_os := $(shell uname -s | tr A-Z a-z) |
| 64 | +host_arch := $(shell uname -m) |
| 65 | +HOST_OS ?= $(host_os) |
| 66 | +HOST_ARCH ?= $(host_arch) |
| 67 | + |
| 68 | +ifeq (x86_64, $(HOST_ARCH)) |
| 69 | + HOST_ARCH = amd64 |
| 70 | +else ifeq (aarch64, $(HOST_ARCH)) |
| 71 | + # linux reports the arm64 arch as aarch64 |
| 72 | + HOST_ARCH = arm64 |
| 73 | +endif |
| 74 | + |
| 75 | +################################## |
| 76 | +# Git and versioning information # |
| 77 | +################################## |
| 78 | + |
| 79 | +git_version := $(shell git describe --tags --always --match='v*' --abbrev=14 --dirty) |
| 80 | +VERSION ?= $(git_version) |
| 81 | +IS_PRERELEASE := $(shell git describe --tags --always --match='v*' --abbrev=0 | grep -q '-' && echo true || echo false) |
| 82 | +GITCOMMIT := $(shell git rev-parse HEAD) |
| 83 | +GITEPOCH := $(shell git show -s --format=%ct HEAD) |
| 84 | + |
| 85 | +################################## |
| 86 | +# Global variables and dirs # |
| 87 | +################################## |
| 88 | + |
| 89 | +bin_dir := _bin |
| 90 | + |
| 91 | +# The ARTIFACTS environment variable is set by the CI system to a directory |
| 92 | +# where artifacts should be placed. These artifacts are then uploaded to a |
| 93 | +# storage bucket by the CI system (https://docs.prow.k8s.io/docs/components/pod-utilities/). |
| 94 | +# An example of such an artifact is a jUnit XML file containing test results. |
| 95 | +# If the ARTIFACTS environment variable is not set, we default to a local |
| 96 | +# directory in the _bin directory. |
| 97 | +ARTIFACTS ?= $(bin_dir)/artifacts |
| 98 | + |
| 99 | +$(bin_dir) $(ARTIFACTS) $(bin_dir)/scratch: |
| 100 | + mkdir -p $@ |
| 101 | + |
| 102 | +.PHONY: clean |
| 103 | +## Clean all temporary files |
| 104 | +## @category [shared] Tools |
| 105 | +clean: |
| 106 | + rm -rf $(bin_dir) |
| 107 | + |
| 108 | +################################## |
| 109 | +# Include all the Makefiles # |
| 110 | +################################## |
| 111 | + |
| 112 | +-include make/00_mod.mk |
| 113 | +-include make/_shared/*/00_mod.mk |
| 114 | +-include make/_shared/*/01_mod.mk |
| 115 | +-include make/02_mod.mk |
| 116 | +-include make/_shared/*/02_mod.mk |
0 commit comments