Makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. # Copyright 2016 The Kubernetes 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. DBG_MAKEFILE ?=
  15. ifeq ($(DBG_MAKEFILE),1)
  16. $(warning ***** starting Makefile for goal(s) "$(MAKECMDGOALS)")
  17. $(warning ***** $(shell date))
  18. else
  19. # If we're not debugging the Makefile, don't echo recipes.
  20. MAKEFLAGS += -s
  21. endif
  22. # Old-skool build tools.
  23. #
  24. # Commonly used targets (see each target for more information):
  25. # all: Build code.
  26. # test: Run tests.
  27. # clean: Clean up.
  28. # It's necessary to set this because some environments don't link sh -> bash.
  29. SHELL := /bin/bash
  30. # We don't need make's built-in rules.
  31. MAKEFLAGS += --no-builtin-rules
  32. .SUFFIXES:
  33. # Constants used throughout.
  34. .EXPORT_ALL_VARIABLES:
  35. OUT_DIR ?= _output
  36. BIN_DIR := $(OUT_DIR)/bin
  37. PRJ_SRC_PATH := k8s.io/kubernetes
  38. GENERATED_FILE_PREFIX := zz_generated.
  39. # Metadata for driving the build lives here.
  40. META_DIR := .make
  41. ifdef KUBE_GOFLAGS
  42. $(info KUBE_GOFLAGS is now deprecated. Please use GOFLAGS instead.)
  43. ifndef GOFLAGS
  44. GOFLAGS := $(KUBE_GOFLAGS)
  45. unexport KUBE_GOFLAGS
  46. else
  47. $(error Both KUBE_GOFLAGS and GOFLAGS are set. Please use just GOFLAGS)
  48. endif
  49. endif
  50. # Extra options for the release or quick-release options:
  51. KUBE_RELEASE_RUN_TESTS := $(KUBE_RELEASE_RUN_TESTS)
  52. KUBE_FASTBUILD := $(KUBE_FASTBUILD)
  53. # This controls the verbosity of the build. Higher numbers mean more output.
  54. KUBE_VERBOSE ?= 1
  55. define ALL_HELP_INFO
  56. # Build code.
  57. #
  58. # Args:
  59. # WHAT: Directory names to build. If any of these directories has a 'main'
  60. # package, the build will produce executable files under $(OUT_DIR)/go/bin.
  61. # If not specified, "everything" will be built.
  62. # GOFLAGS: Extra flags to pass to 'go' when building.
  63. # GOLDFLAGS: Extra linking flags passed to 'go' when building.
  64. # GOGCFLAGS: Additional go compile flags passed to 'go' when building.
  65. #
  66. # Example:
  67. # make
  68. # make all
  69. # make all WHAT=cmd/kubelet GOFLAGS=-v
  70. # make all GOLDFLAGS=""
  71. # Note: Specify GOLDFLAGS as an empty string for building unstripped binaries, which allows
  72. # you to use code debugging tools like delve. When GOLDFLAGS is unspecified, it defaults
  73. # to "-s -w" which strips debug information. Other flags that can be used for GOLDFLAGS
  74. # are documented at https://golang.org/cmd/link/
  75. endef
  76. .PHONY: all
  77. ifeq ($(PRINT_HELP),y)
  78. all:
  79. @echo "$$ALL_HELP_INFO"
  80. else
  81. all: generated_files
  82. hack/make-rules/build.sh $(WHAT)
  83. endif
  84. define GINKGO_HELP_INFO
  85. # Build ginkgo
  86. #
  87. # Example:
  88. # make ginkgo
  89. endef
  90. .PHONY: ginkgo
  91. ifeq ($(PRINT_HELP),y)
  92. ginkgo:
  93. @echo "$$GINKGO_HELP_INFO"
  94. else
  95. ginkgo:
  96. hack/make-rules/build.sh vendor/github.com/onsi/ginkgo/ginkgo
  97. endif
  98. define VERIFY_HELP_INFO
  99. # Runs all the presubmission verifications.
  100. #
  101. # Args:
  102. # BRANCH: Branch to be passed to verify-vendor.sh script.
  103. # WHAT: List of checks to run
  104. #
  105. # Example:
  106. # make verify
  107. # make verify BRANCH=branch_x
  108. # make verify WHAT="bazel typecheck"
  109. endef
  110. .PHONY: verify
  111. ifeq ($(PRINT_HELP),y)
  112. verify:
  113. @echo "$$VERIFY_HELP_INFO"
  114. else
  115. verify:
  116. KUBE_VERIFY_GIT_BRANCH=$(BRANCH) hack/make-rules/verify.sh
  117. endif
  118. define QUICK_VERIFY_HELP_INFO
  119. # Runs only the presubmission verifications that aren't slow.
  120. #
  121. # Example:
  122. # make quick-verify
  123. endef
  124. .PHONY: quick-verify
  125. ifeq ($(PRINT_HELP),y)
  126. quick-verify:
  127. @echo "$$QUICK_VERIFY_HELP_INFO"
  128. else
  129. quick-verify:
  130. QUICK=true SILENT=false hack/make-rules/verify.sh
  131. endif
  132. define UPDATE_HELP_INFO
  133. # Runs all the generated updates.
  134. #
  135. # Example:
  136. # make update
  137. endef
  138. .PHONY: update
  139. ifeq ($(PRINT_HELP),y)
  140. update:
  141. @echo "$$UPDATE_HELP_INFO"
  142. else
  143. update: generated_files
  144. CALLED_FROM_MAIN_MAKEFILE=1 hack/make-rules/update.sh
  145. endif
  146. define CHECK_TEST_HELP_INFO
  147. # Build and run tests.
  148. #
  149. # Args:
  150. # WHAT: Directory names to test. All *_test.go files under these
  151. # directories will be run. If not specified, "everything" will be tested.
  152. # TESTS: Same as WHAT.
  153. # KUBE_COVER: Whether to run tests with code coverage. Set to 'y' to enable coverage collection.
  154. # GOFLAGS: Extra flags to pass to 'go' when building.
  155. # GOLDFLAGS: Extra linking flags to pass to 'go' when building.
  156. # GOGCFLAGS: Additional go compile flags passed to 'go' when building.
  157. #
  158. # Example:
  159. # make check
  160. # make test
  161. # make check WHAT=./pkg/kubelet GOFLAGS=-v
  162. endef
  163. .PHONY: check test
  164. ifeq ($(PRINT_HELP),y)
  165. check test:
  166. @echo "$$CHECK_TEST_HELP_INFO"
  167. else
  168. check test: generated_files
  169. hack/make-rules/test.sh $(WHAT) $(TESTS)
  170. endif
  171. define TEST_IT_HELP_INFO
  172. # Build and run integration tests.
  173. #
  174. # Args:
  175. # WHAT: Directory names to test. All *_test.go files under these
  176. # directories will be run. If not specified, "everything" will be tested.
  177. #
  178. # Example:
  179. # make test-integration
  180. endef
  181. .PHONY: test-integration
  182. ifeq ($(PRINT_HELP),y)
  183. test-integration:
  184. @echo "$$TEST_IT_HELP_INFO"
  185. else
  186. test-integration: generated_files
  187. hack/make-rules/test-integration.sh $(WHAT)
  188. endif
  189. define TEST_E2E_HELP_INFO
  190. # Build and run end-to-end tests.
  191. #
  192. # Example:
  193. # make test-e2e
  194. endef
  195. .PHONY: test-e2e
  196. ifeq ($(PRINT_HELP),y)
  197. test-e2e:
  198. @echo "$$TEST_E2E_HELP_INFO"
  199. else
  200. test-e2e: ginkgo generated_files
  201. go run hack/e2e.go -- --build --up --test --down
  202. endif
  203. define TEST_E2E_NODE_HELP_INFO
  204. # Build and run node end-to-end tests.
  205. #
  206. # Args:
  207. # FOCUS: Regexp that matches the tests to be run. Defaults to "".
  208. # SKIP: Regexp that matches the tests that needs to be skipped. Defaults
  209. # to "".
  210. # RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
  211. # repeatedly until they fail. Defaults to false.
  212. # REMOTE: If true, run the tests on a remote host instance on GCE. Defaults
  213. # to false.
  214. # IMAGES: For REMOTE=true only. Comma delimited list of images for creating
  215. # remote hosts to run tests against. Defaults to a recent image.
  216. # LIST_IMAGES: If true, don't run tests. Just output the list of available
  217. # images for testing. Defaults to false.
  218. # HOSTS: For REMOTE=true only. Comma delimited list of running gce hosts to
  219. # run tests against. Defaults to "".
  220. # DELETE_INSTANCES: For REMOTE=true only. Delete any instances created as
  221. # part of this test run. Defaults to false.
  222. # ARTIFACTS: For REMOTE=true only. Local directory to scp test artifacts into
  223. # from the remote hosts. Defaults to "/tmp/_artifacts".
  224. # REPORT: For REMOTE=false only. Local directory to write juntil xml results
  225. # to. Defaults to "/tmp/".
  226. # CLEANUP: For REMOTE=true only. If false, do not stop processes or delete
  227. # test files on remote hosts. Defaults to true.
  228. # IMAGE_PROJECT: For REMOTE=true only. Project containing images provided to
  229. # IMAGES. Defaults to "kubernetes-node-e2e-images".
  230. # INSTANCE_PREFIX: For REMOTE=true only. Instances created from images will
  231. # have the name "${INSTANCE_PREFIX}-${IMAGE_NAME}". Defaults to "test".
  232. # INSTANCE_METADATA: For REMOTE=true and running on GCE only.
  233. # GUBERNATOR: For REMOTE=true only. Produce link to Gubernator to view logs.
  234. # Defaults to false.
  235. # PARALLELISM: The number of gingko nodes to run. Defaults to 8.
  236. # RUNTIME: Container runtime to use (eg. docker, remote).
  237. # Defaults to "docker".
  238. # CONTAINER_RUNTIME_ENDPOINT: remote container endpoint to connect to.
  239. # Used when RUNTIME is set to "remote".
  240. # IMAGE_SERVICE_ENDPOINT: remote image endpoint to connect to, to prepull images.
  241. # Used when RUNTIME is set to "remote".
  242. # IMAGE_CONFIG_FILE: path to a file containing image configuration.
  243. # SYSTEM_SPEC_NAME: The name of the system spec to be used for validating the
  244. # image in the node conformance test. The specs are located at
  245. # test/e2e_node/system/specs/. For example, "SYSTEM_SPEC_NAME=gke" will use
  246. # the spec at test/e2e_node/system/specs/gke.yaml. If unspecified, the
  247. # default built-in spec (system.DefaultSpec) will be used.
  248. #
  249. # Example:
  250. # make test-e2e-node FOCUS=Kubelet SKIP=container
  251. # make test-e2e-node REMOTE=true DELETE_INSTANCES=true
  252. # make test-e2e-node TEST_ARGS='--kubelet-flags="--cgroups-per-qos=true"'
  253. # Build and run tests.
  254. endef
  255. .PHONY: test-e2e-node
  256. ifeq ($(PRINT_HELP),y)
  257. test-e2e-node:
  258. @echo "$$TEST_E2E_NODE_HELP_INFO"
  259. else
  260. test-e2e-node: ginkgo generated_files
  261. hack/make-rules/test-e2e-node.sh
  262. endif
  263. define TEST_E2E_KUBEADM_HELP_INFO
  264. # Build and run kubeadm end-to-end tests.
  265. #
  266. # Args:
  267. # FOCUS: Regexp that matches the tests to be run. Defaults to "".
  268. # SKIP: Regexp that matches the tests that needs to be skipped. Defaults
  269. # to "".
  270. # RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
  271. # repeatedly until they fail. Defaults to false.
  272. # ARTIFACTS: Local directory to save test artifacts into. Defaults to "/tmp/_artifacts".
  273. # PARALLELISM: The number of gingko nodes to run. If empty ginkgo default
  274. # parallelism (cores - 1) is used
  275. # BUILD: Build kubeadm end-to-end tests. Defaults to true.
  276. #
  277. # Example:
  278. # make test-e2e-kubeadm
  279. # make test-e2e-kubeadm FOCUS=kubeadm-config
  280. # make test-e2e-kubeadm SKIP=kubeadm-config
  281. #
  282. # Build and run tests.
  283. endef
  284. .PHONY: test-e2e-kubeadm
  285. ifeq ($(PRINT_HELP),y)
  286. test-e2e-kubeadm:
  287. @echo "$$TEST_E2E_KUBEADM_HELP_INFO"
  288. else
  289. test-e2e-kubeadm:
  290. hack/make-rules/test-e2e-kubeadm.sh
  291. endif
  292. define TEST_CMD_HELP_INFO
  293. # Build and run cmdline tests.
  294. #
  295. # Args:
  296. # WHAT: List of tests to run, check test/cmd/legacy-script.sh for names.
  297. # For example, WHAT=deployment will run run_deployment_tests function.
  298. # Example:
  299. # make test-cmd
  300. # make test-cmd WHAT="deployment impersonation"
  301. endef
  302. .PHONY: test-cmd
  303. ifeq ($(PRINT_HELP),y)
  304. test-cmd:
  305. @echo "$$TEST_CMD_HELP_INFO"
  306. else
  307. test-cmd: generated_files
  308. hack/make-rules/test-cmd.sh
  309. endif
  310. define CLEAN_HELP_INFO
  311. # Remove all build artifacts.
  312. #
  313. # Example:
  314. # make clean
  315. #
  316. # TODO(thockin): call clean_generated when we stop committing generated code.
  317. endef
  318. .PHONY: clean
  319. ifeq ($(PRINT_HELP),y)
  320. clean:
  321. @echo "$$CLEAN_HELP_INFO"
  322. else
  323. clean: clean_meta
  324. build/make-clean.sh
  325. hack/make-rules/clean.sh
  326. endif
  327. define CLEAN_META_HELP_INFO
  328. # Remove make-related metadata files.
  329. #
  330. # Example:
  331. # make clean_meta
  332. endef
  333. .PHONY: clean_meta
  334. ifeq ($(PRINT_HELP),y)
  335. clean_meta:
  336. @echo "$$CLEAN_META_HELP_INFO"
  337. else
  338. clean_meta:
  339. rm -rf $(META_DIR)
  340. endif
  341. define CLEAN_GENERATED_HELP_INFO
  342. # Remove all auto-generated artifacts. Generated artifacts in staging folder should not be removed as they are not
  343. # generated using generated_files.
  344. #
  345. # Example:
  346. # make clean_generated
  347. endef
  348. .PHONY: clean_generated
  349. ifeq ($(PRINT_HELP),y)
  350. clean_generated:
  351. @echo "$$CLEAN_GENERATED_HELP_INFO"
  352. else
  353. clean_generated:
  354. find . -type f -name $(GENERATED_FILE_PREFIX)\* | grep -v "[.]/staging/.*" | xargs rm -f
  355. endif
  356. define VET_HELP_INFO
  357. # Run 'go vet'.
  358. #
  359. # Args:
  360. # WHAT: Directory names to vet. All *.go files under these
  361. # directories will be vetted. If not specified, "everything" will be
  362. # vetted.
  363. #
  364. # Example:
  365. # make vet
  366. # make vet WHAT=./pkg/kubelet
  367. endef
  368. .PHONY: vet
  369. ifeq ($(PRINT_HELP),y)
  370. vet:
  371. @echo "$$VET_HELP_INFO"
  372. else
  373. vet: generated_files
  374. CALLED_FROM_MAIN_MAKEFILE=1 hack/make-rules/vet.sh $(WHAT)
  375. endif
  376. define RELEASE_HELP_INFO
  377. # Build a release
  378. # Use the 'release-in-a-container' target to build the release when already in
  379. # a container vs. creating a new container to build in using the 'release'
  380. # target. Useful for running in GCB.
  381. #
  382. # Example:
  383. # make release
  384. # make release-in-a-container
  385. endef
  386. .PHONY: release release-in-a-container
  387. ifeq ($(PRINT_HELP),y)
  388. release release-in-a-container:
  389. @echo "$$RELEASE_HELP_INFO"
  390. else
  391. release:
  392. build/release.sh
  393. release-in-a-container:
  394. build/release-in-a-container.sh
  395. endif
  396. define RELEASE_IMAGES_HELP_INFO
  397. # Build release images
  398. #
  399. # Args:
  400. # KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
  401. # KUBE_BUILD_CONFORMANCE: Whether to build conformance testing image as well. Set to 'n' to skip.
  402. #
  403. # Example:
  404. # make release-images
  405. endef
  406. .PHONY: release-images
  407. ifeq ($(PRINT_HELP),y)
  408. release-images:
  409. @echo "$$RELEASE_IMAGES_HELP_INFO"
  410. else
  411. release-images:
  412. build/release-images.sh
  413. endif
  414. define RELEASE_SKIP_TESTS_HELP_INFO
  415. # Build a release, but skip tests
  416. #
  417. # Args:
  418. # KUBE_RELEASE_RUN_TESTS: Whether to run tests. Set to 'y' to run tests anyways.
  419. # KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so.
  420. #
  421. # Example:
  422. # make release-skip-tests
  423. # make quick-release
  424. endef
  425. .PHONY: release-skip-tests quick-release
  426. ifeq ($(PRINT_HELP),y)
  427. release-skip-tests quick-release:
  428. @echo "$$RELEASE_SKIP_TESTS_HELP_INFO"
  429. else
  430. release-skip-tests quick-release: KUBE_RELEASE_RUN_TESTS = n
  431. release-skip-tests quick-release: KUBE_FASTBUILD = true
  432. release-skip-tests quick-release:
  433. build/release.sh
  434. endif
  435. define QUICK_RELEASE_IMAGES_HELP_INFO
  436. # Build release images, but only for linux/amd64
  437. #
  438. # Args:
  439. # KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so.
  440. # KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
  441. # KUBE_BUILD_CONFORMANCE: Whether to build conformance testing image as well. Set to 'n' to skip.
  442. #
  443. # Example:
  444. # make quick-release-images
  445. endef
  446. .PHONY: quick-release-images
  447. ifeq ($(PRINT_HELP),y)
  448. quick-release-images:
  449. @echo "$$QUICK_RELEASE_IMAGES_HELP_INFO"
  450. else
  451. quick-release-images: KUBE_FASTBUILD = true
  452. quick-release-images:
  453. build/release-images.sh
  454. endif
  455. define PACKAGE_HELP_INFO
  456. # Package tarballs
  457. # Use the 'package-tarballs' target to run the final packaging steps of
  458. # a release.
  459. #
  460. # Example:
  461. # make package-tarballs
  462. endef
  463. .PHONY: package package-tarballs
  464. ifeq ($(PRINT_HELP),y)
  465. package package-tarballs:
  466. @echo "$$PACKAGE_HELP_INFO"
  467. else
  468. package package-tarballs:
  469. build/package-tarballs.sh
  470. endif
  471. define CROSS_HELP_INFO
  472. # Cross-compile for all platforms
  473. # Use the 'cross-in-a-container' target to cross build when already in
  474. # a container vs. creating a new container to build from (build-image)
  475. # Useful for running in GCB.
  476. #
  477. # Example:
  478. # make cross
  479. # make cross-in-a-container
  480. endef
  481. .PHONY: cross cross-in-a-container
  482. ifeq ($(PRINT_HELP),y)
  483. cross cross-in-a-container:
  484. @echo "$$CROSS_HELP_INFO"
  485. else
  486. cross:
  487. hack/make-rules/cross.sh
  488. cross-in-a-container: KUBE_OUTPUT_SUBPATH = $(OUT_DIR)/dockerized
  489. cross-in-a-container:
  490. ifeq (,$(wildcard /.dockerenv))
  491. @echo -e "\nThe 'cross-in-a-container' target can only be used from within a docker container.\n"
  492. else
  493. hack/make-rules/cross.sh
  494. endif
  495. endif
  496. define CMD_HELP_INFO
  497. # Add rules for all directories in cmd/
  498. #
  499. # Example:
  500. # make kubectl kube-proxy
  501. endef
  502. #TODO: make EXCLUDE_TARGET auto-generated when there are other files in cmd/
  503. EXCLUDE_TARGET=BUILD OWNERS
  504. .PHONY: $(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/))))
  505. ifeq ($(PRINT_HELP),y)
  506. $(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))):
  507. @echo "$$CMD_HELP_INFO"
  508. else
  509. $(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))): generated_files
  510. hack/make-rules/build.sh cmd/$@
  511. endif
  512. define GENERATED_FILES_HELP_INFO
  513. # Produce auto-generated files needed for the build.
  514. #
  515. # Example:
  516. # make generated_files
  517. endef
  518. .PHONY: generated_files
  519. ifeq ($(PRINT_HELP),y)
  520. generated_files:
  521. @echo "$$GENERATED_FILES_HELP_INFO"
  522. else
  523. generated_files:
  524. $(MAKE) -f Makefile.generated_files $@ CALLED_FROM_MAIN_MAKEFILE=1
  525. endif
  526. define HELP_INFO
  527. # Print make targets and help info
  528. #
  529. # Example:
  530. # make help
  531. endef
  532. .PHONY: help
  533. ifeq ($(PRINT_HELP),y)
  534. help:
  535. @echo "$$HELP_INFO"
  536. else
  537. help:
  538. hack/make-rules/make-help.sh
  539. endif
  540. # Non-dockerized bazel rules.
  541. .PHONY: bazel-build bazel-test bazel-release
  542. ifeq ($(PRINT_HELP),y)
  543. define BAZEL_BUILD_HELP_INFO
  544. # Build with bazel
  545. #
  546. # Example:
  547. # make bazel-build
  548. endef
  549. bazel-build:
  550. @echo "$$BAZEL_BUILD_HELP_INFO"
  551. else
  552. # Some things in vendor don't build due to empty target lists for cross-platform rules.
  553. bazel-build:
  554. bazel build -- //... -//vendor/...
  555. endif
  556. ifeq ($(PRINT_HELP),y)
  557. define BAZEL_TEST_HELP_INFO
  558. # Test with bazel
  559. #
  560. # Example:
  561. # make bazel-test
  562. endef
  563. bazel-test:
  564. @echo "$$BAZEL_TEST_HELP_INFO"
  565. else
  566. # //hack:verify-all is a manual target.
  567. # Some things in vendor don't build due to empty target lists for cross-platform rules.
  568. bazel-test:
  569. bazel test --config=unit -- \
  570. //... \
  571. //hack:verify-all \
  572. -//vendor/...
  573. endif
  574. ifeq ($(PRINT_HELP),y)
  575. define BAZEL_TEST_INTEGRATION_HELP_INFO
  576. # Integration test with bazel
  577. #
  578. # Example:
  579. # make bazel-test-integration
  580. endef
  581. bazel-test-integration:
  582. @echo "$$BAZEL_TEST_INTEGRATION_HELP_INFO"
  583. else
  584. bazel-test-integration:
  585. bazel test --config integration //test/integration/...
  586. endif
  587. ifeq ($(PRINT_HELP),y)
  588. define BAZEL_RELEASE_HELP_INFO
  589. # Build release tars with bazel
  590. #
  591. # Example:
  592. # make bazel-release
  593. endef
  594. bazel-release:
  595. @echo "$$BAZEL_RELEASE_HELP_INFO"
  596. else
  597. bazel-release:
  598. bazel build //build/release-tars
  599. endif