Makefile:1: *** 遗漏分隔符 。 停止。

水上冰石 2019-12-12 09:51:32
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DBG_MAKEFILE ?=
ifeq ($(DBG_MAKEFILE),1)
$(warning ***** starting Makefile for goal(s) "$(MAKECMDGOALS)")
$(warning ***** $(shell date))
else
# If we're not debugging the Makefile, don't echo recipes.
MAKEFLAGS += -s
endif


# Old-skool build tools.
#
# Commonly used targets (see each target for more information):
# all: Build code.
# test: Run tests.
# clean: Clean up.

# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash

# We don't need make's built-in rules.
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:

# Constants used throughout.
.EXPORT_ALL_VARIABLES:
OUT_DIR ?= _output
BIN_DIR := $(OUT_DIR)/bin
PRJ_SRC_PATH := k8s.io/kubernetes
GENERATED_FILE_PREFIX := zz_generated.

# Metadata for driving the build lives here.
META_DIR := .make

ifdef KUBE_GOFLAGS
$(info KUBE_GOFLAGS is now deprecated. Please use GOFLAGS instead.)
ifndef GOFLAGS
GOFLAGS := $(KUBE_GOFLAGS)
unexport KUBE_GOFLAGS
else
$(error Both KUBE_GOFLAGS and GOFLAGS are set. Please use just GOFLAGS)
endif
endif

# Extra options for the release or quick-release options:
KUBE_RELEASE_RUN_TESTS := $(KUBE_RELEASE_RUN_TESTS)
KUBE_FASTBUILD := $(KUBE_FASTBUILD)

# This controls the verbosity of the build. Higher numbers mean more output.
KUBE_VERBOSE ?= 1

define ALL_HELP_INFO
# Build code.
#
# Args:
# WHAT: Directory names to build. If any of these directories has a 'main'
# package, the build will produce executable files under $(OUT_DIR)/go/bin.
# If not specified, "everything" will be built.
# GOFLAGS: Extra flags to pass to 'go' when building.
# GOLDFLAGS: Extra linking flags passed to 'go' when building.
# GOGCFLAGS: Additional go compile flags passed to 'go' when building.
#
# Example:
# make
# make all
# make all WHAT=cmd/kubelet GOFLAGS=-v
# make all GOLDFLAGS=""
# Note: Specify GOLDFLAGS as an empty string for building unstripped binaries, which allows
# you to use code debugging tools like delve. When GOLDFLAGS is unspecified, it defaults
# to "-s -w" which strips debug information. Other flags that can be used for GOLDFLAGS
# are documented at https://golang.org/cmd/link/
endef
.PHONY: all
ifeq ($(PRINT_HELP),y)
all:
@echo "$$ALL_HELP_INFO"
else
all: generated_files
hack/make-rules/build.sh $(WHAT)
endif

define GINKGO_HELP_INFO
# Build ginkgo
#
# Example:
# make ginkgo
endef
.PHONY: ginkgo
ifeq ($(PRINT_HELP),y)
ginkgo:
@echo "$$GINKGO_HELP_INFO"
else
ginkgo:
hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo
endif

define VERIFY_HELP_INFO
# Runs all the presubmission verifications.
#
# Args:
# BRANCH: Branch to be passed to verify-vendor.sh script.
# WHAT: List of checks to run
#
# Example:
# make verify
# make verify BRANCH=branch_x
# make verify WHAT="bazel typecheck"
endef
.PHONY: verify
ifeq ($(PRINT_HELP),y)
verify:
@echo "$$VERIFY_HELP_INFO"
else
verify:
KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh
endif

define QUICK_VERIFY_HELP_INFO
# Runs only the presubmission verifications that aren't slow.
#
# Example:
# make quick-verify
endef
.PHONY: quick-verify
ifeq ($(PRINT_HELP),y)
quick-verify:
@echo "$$QUICK_VERIFY_HELP_INFO"
else
quick-verify:
QUICK=true SILENT=false hack/make-rules/verify.sh
endif

define UPDATE_HELP_INFO
# Runs all the generated updates.
#
# Example:
# make update
endef
.PHONY: update
ifeq ($(PRINT_HELP),y)
update:
@echo "$$UPDATE_HELP_INFO"
else
update: generated_files
CALLED_FROM_MAIN_MAKEFILE=1 hack/make-rules/update.sh
endif

define CHECK_TEST_HELP_INFO
# Build and run tests.
#
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
# TESTS: Same as WHAT.
# KUBE_COVER: Whether to run tests with code coverage. Set to 'y' to enable coverage collection.
# GOFLAGS: Extra flags to pass to 'go' when building.
# GOLDFLAGS: Extra linking flags to pass to 'go' when building.
# GOGCFLAGS: Additional go compile flags passed to 'go' when building.
#
# Example:
# make check
# make test
# make check WHAT=./pkg/kubelet GOFLAGS=-v
endef
.PHONY: check test
ifeq ($(PRINT_HELP),y)
check test:
@echo "$$CHECK_TEST_HELP_INFO"
else
check test: generated_files
hack/make-rules/test.sh $(WHAT) $(TESTS)
endif

define TEST_IT_HELP_INFO
# Build and run integration tests.
#
# Args:
# WHAT: Directory names to test. All *_test.go files under these
# directories will be run. If not specified, "everything" will be tested.
#
# Example:
# make test-integration
endef
.PHONY: test-integration
ifeq ($(PRINT_HELP),y)
test-integration:
@echo "$$TEST_IT_HELP_INFO"
else
test-integration: generated_files
hack/make-rules/test-integration.sh $(WHAT)
endif

define TEST_E2E_NODE_HELP_INFO
# Build and run node end-to-end tests.
#
# Args:
# FOCUS: Regexp that matches the tests to be run. Defaults to "".
# SKIP: Regexp that matches the tests that needs to be skipped. Defaults
# to "".
# RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
# repeatedly until they fail. Defaults to false.
# REMOTE: If true, run the tests on a remote host instance on GCE. Defaults
# to false.
# IMAGES: For REMOTE=true only. Comma delimited list of images for creating
# remote hosts to run tests against. Defaults to a recent image.
# LIST_IMAGES: If true, don't run tests. Just output the list of available
# images for testing. Defaults to false.
# HOSTS: For REMOTE=true only. Comma delimited list of running gce hosts to
# run tests against. Defaults to "".
# DELETE_INSTANCES: For REMOTE=true only. Delete any instances created as
# part of this test run. Defaults to false.
# PREEMPTIBLE_INSTANCES: For REMOTE=true only. Mark created gce instances
# as preemptible. Defaults to false.
# ARTIFACTS: For REMOTE=true only. Local directory to scp test artifacts into
# from the remote hosts. Defaults to "/tmp/_artifacts".
# REPORT: For REMOTE=false only. Local directory to write juntil xml results
# to. Defaults to "/tmp/".
# CLEANUP: For REMOTE=true only. If false, do not stop processes or delete
# test files on remote hosts. Defaults to true.
# IMAGE_PROJECT: For REMOTE=true only. Project containing images provided to
# IMAGES. Defaults to "kubernetes-node-e2e-images".
# INSTANCE_PREFIX: For REMOTE=true only. Instances created from images will
# have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test".
# INSTANCE_METADATA: For REMOTE=true and running on GCE only.
# GUBERNATOR: For REMOTE=true only. Produce link to Gubernator to view logs.
# Defaults to false.
# PARALLELISM: The number of gingko nodes to run. Defaults to 8.
# RUNTIME: Container runtime to use (eg. docker, remote).
# Defaults to "docker".
# CONTAINER_RUNTIME_ENDPOINT: remote container endpoint to connect to.
# Used when RUNTIME is set to "remote".
# IMAGE_SERVICE_ENDPOINT: remote image endpoint to connect to, to prepull images.
# Used when RUNTIME is set to "remote".
# IMAGE_CONFIG_FILE: path to a file containing image configuration.
# SYSTEM_SPEC_NAME: The name of the system spec to be used for validating the
# image in the node conformance test. The specs are located at
# test/e2e_node/system/specs/. For example, "SYSTEM_SPEC_NAME=gke" will use
# the spec at test/e2e_node/system/specs/gke.yaml. If unspecified, the
# default built-in spec (system.DefaultSpec) will be used.
#
# Example:
# make test-e2e-node FOCUS=Kubelet SKIP=container
# make test-e2e-node REMOTE=true DELETE_INSTANCES=true
# make test-e2e-node TEST_ARGS='--kubelet-flags="--cgroups-per-qos=true"'
# Build and run tests.
endef
.PHONY: test-e2e-node
ifeq ($(PRINT_HELP),y)
test-e2e-node:
@echo "$$TEST_E2E_NODE_HELP_INFO"
else
test-e2e-node: ginkgo generated_files
hack/make-rules/test-e2e-node.sh
endif

define TEST_E2E_KUBEADM_HELP_INFO
# Build and run kubeadm end-to-end tests.
#
# Args:
# FOCUS: Regexp that matches the tests to be run. Defaults to "".
# SKIP: Regexp that matches the tests that needs to be skipped. Defaults
# to "".
# RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
# repeatedly until they fail. Defaults to false.
# ARTIFACTS: Local directory to save test artifacts into. Defaults to "/tmp/_artifacts".
# PARALLELISM: The number of gingko nodes to run. If empty ginkgo default
# parallelism (cores - 1) is used
# BUILD: Build kubeadm end-to-end tests. Defaults to true.
#
# Example:
# make test-e2e-kubeadm
# make test-e2e-kubeadm FOCUS=kubeadm-config
# make test-e2e-kubeadm SKIP=kubeadm-config
#
# Build and run tests.
endef
.PHONY: test-e2e-kubeadm
ifeq ($(PRINT_HELP),y)
test-e2e-kubeadm:
@echo "$$TEST_E2E_KUBEADM_HELP_INFO"
else
test-e2e-kubeadm:
hack/make-rules/test-e2e-kubeadm.sh
endif

define TEST_CMD_HELP_INFO
# Build and run cmdline tests.
#
# Args:
# WHAT: List of tests to run, check test/cmd/legacy-script.sh for names.
# For example, WHAT=deployment will run run_deployment_tests function.
# Example:
# make test-cmd
# make test-cmd WHAT="deployment impersonation"
endef
.PHONY: test-cmd
ifeq ($(PRINT_HELP),y)
test-cmd:
@echo "$$TEST_CMD_HELP_INFO"
else
test-cmd: generated_files
hack/make-rules/test-cmd.sh
endif

cents-arm64位,make失败。不知道makefile这么写有什么问题
...全文
604 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
水上冰石 2019-12-25
  • 打赏
  • 举报
回复
引用 6 楼 mouse_zhu的回复:
怎么样行不行啊。行的话结贴吧
等回家操作哈,手机操作不了,😂
水上冰石 2019-12-25
  • 打赏
  • 举报
回复
引用 6 楼 mouse_zhu的回复:
怎么样行不行啊。行的话结贴吧
你的方法应该是可以的,不过可能因为我源码是先下载到windows系统,然后拷贝到linux,可能所有文件格式都不对。后来直接在linux上拉取的源码,就好了。谢谢你的回复,结帖
水上冰石 2019-12-25
  • 打赏
  • 举报
回复
你的方法应该是可以的,不过可能因为我源码是先下载到windows系统,然后拷贝到linux,可能所有文件格式都不对。后来直接在linux上拉取的源码,就好了。谢谢你的回复,结帖
mouse_zhu 2019-12-25
  • 打赏
  • 举报
回复
怎么样行不行啊。行的话结贴吧
mouse_zhu 2019-12-13
  • 打赏
  • 举报
回复
你的文本编译器有问题,你是不是下载后打开了?另外Makefile:1 后面的数字就是行数你可以按照这个提示去使用tab缩进
水上冰石 2019-12-13
  • 打赏
  • 举报
回复
引用 1 楼 mouse_zhu的回复:
所有“hack/make-rules” 字样的全部要使用tab

test-e2e-kubeadm: 
hack/make-rules/test-e2e-kubeadm.sh
endif
好的,我试下。这个没条命令都需要进行tab 开头,可是为什么我从github 上下载的都不行呢?格式好像都是错误的
mouse_zhu 2019-12-13
  • 打赏
  • 举报
回复
所有“hack/make-rules” 字样的全部要使用tab

test-e2e-kubeadm: 
hack/make-rules/test-e2e-kubeadm.sh
endif
水上冰石 2019-12-13
  • 打赏
  • 举报
回复
引用 3 楼 mouse_zhu的回复:
你的文本编译器有问题,你是不是下载后打开了?另外Makefile:1 后面的数字就是行数你可以按照这个提示去使用tab缩进
嗯,我在windows 上打开过

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧