BUILD 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("@rules_cc//cc:defs.bzl", "cc_binary")
  5. load("install.bzl", "install_path_rule")
  6. # Turns `--//installers/local:install_path=arg` into `$(INSTALL_PATH)`.
  7. install_path_rule(
  8. name = "install_path",
  9. build_setting_default = "/usr",
  10. )
  11. sh_binary(
  12. name = "install",
  13. srcs = ["install.sh"],
  14. args = [
  15. "--install_path",
  16. "$(INSTALL_PATH)",
  17. "--carbon",
  18. "$(location :carbon)",
  19. "$(locations //explorer:standard_libraries)",
  20. ],
  21. data = [
  22. ":carbon",
  23. "//explorer:standard_libraries",
  24. ],
  25. toolchains = [":install_path"],
  26. )
  27. sh_binary(
  28. name = "uninstall",
  29. srcs = ["uninstall.sh"],
  30. args = [
  31. "--install_path",
  32. "$(INSTALL_PATH)",
  33. ],
  34. toolchains = [":install_path"],
  35. )
  36. # A busybox-like binary for Carbon tools; multiple tools are part of this binary
  37. # so that shared code is deduplicated.
  38. cc_binary(
  39. name = "carbon",
  40. srcs = ["carbon.cpp"],
  41. visibility = ["//bazel/check_deps:__pkg__"],
  42. deps = [
  43. "//explorer:main",
  44. "@llvm-project//llvm:Support",
  45. ],
  46. )