Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. ifeq ($(ROOT),)
  19. $(error "Error: Expect the environment variable $$ROOT to point to the Desktop installation")
  20. endif
  21. include $(ROOT)/Makefile.sdk
  22. default::
  23. @echo ' env-install : Install into virtual-env'
  24. #
  25. # env-install
  26. # Install app into the virtual environment.
  27. #
  28. .PHONY: env-install
  29. env-install: compile ext-env-install
  30. @echo '--- Installing $(APP_NAME) into virtual-env'
  31. @$(ENV_PYTHON) setup.py develop -N -q
  32. ###################################
  33. # Build Hadoop plugins
  34. ###################################
  35. PLUGIN_DIR := $(realpath .)
  36. PLUGIN_JAVA_LIB := $(PLUGIN_DIR)/java-lib
  37. PLUGIN_JAVA_DIR := $(PLUGIN_DIR)/java
  38. BLD_DIR_PLUGINS := $(PLUGIN_DIR)/java/target
  39. SUDO_SHELL_DIR := $(realpath .)/sudo-shell
  40. SUDO_SHELL_SRC := $(SUDO_SHELL_DIR)/src
  41. SUDO_SHELL_BUILD := $(SUDO_SHELL_DIR)/target
  42. SUDO_SHELL_LIB := $(SUDO_SHELL_DIR)/java-lib
  43. SUDO_SHELL := $(SUDO_SHELL_LIB)/sudo-shell-$(DESKTOP_VERSION).jar
  44. CREDENTIALS_MERGER_DIR := $(realpath .)/credentials-merger
  45. CREDENTIALS_MERGER_SRC := $(CREDENTIALS_MERGER_DIR)/src
  46. CREDENTIALS_MERGER_BUILD := $(CREDENTIALS_MERGER_DIR)/target
  47. CREDENTIALS_MERGER_LIB := $(CREDENTIALS_MERGER_DIR)/java-lib
  48. CREDENTIALS_MERGER := $(CREDENTIALS_MERGER_LIB)/credentials-merger-$(DESKTOP_VERSION).jar
  49. compile: $(DESKTOP_PLUGIN_JAR) $(SUDO_SHELL) $(CREDENTIALS_MERGER)
  50. # Build the plugin jar iff the source is present
  51. ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
  52. $(DESKTOP_PLUGIN_JAR): $(shell find $(PLUGIN_JAVA_DIR) -type f)
  53. mkdir -p $(PLUGIN_JAVA_LIB)
  54. @echo "--- Building Hadoop plugins"
  55. cd $(PLUGIN_JAVA_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  56. cp $(BLD_DIR_PLUGINS)/hue-plugins-$(MAVEN_VERSION).jar $(DESKTOP_PLUGIN_JAR)
  57. clean::
  58. rm -rf $(PLUGIN_JAVA_LIB)
  59. cd $(PLUGIN_JAVA_DIR) && mvn clean $(MAVEN_OPTIONS) ||:
  60. else
  61. $(DESKTOP_PLUGIN_JAR):
  62. $(error Cannot build hadoop plugin without source)
  63. endif
  64. # Build the sudo shell jar iff the source is present
  65. ifneq (,$(wildcard $(SUDO_SHELL_SRC)))
  66. $(SUDO_SHELL): $(shell find $(SUDO_SHELL_SRC) -type f)
  67. mkdir -p $(SUDO_SHELL_LIB)
  68. @echo "--- Building sudo fsshell tool"
  69. cd $(SUDO_SHELL_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  70. cp $(SUDO_SHELL_BUILD)/sudo-shell-$(MAVEN_VERSION).jar $(SUDO_SHELL)
  71. clean::
  72. rm -rf $(SUDO_SHELL_LIB)
  73. cd $(SUDO_SHELL_DIR) && mvn clean $(MAVEN_OPTIONS) ||:
  74. else
  75. $(SUDO_SHELL):
  76. $(error cannot build sudo-shell jar without source)
  77. endif
  78. # Build the credentials merger jar iff the source is present
  79. ifneq (,$(wildcard $(CREDENTIALS_MERGER_SRC)))
  80. $(CREDENTIALS_MERGER): $(shell find $(CREDENTIALS_MERGER_SRC) -type f)
  81. mkdir -p $(CREDENTIALS_MERGER_LIB)
  82. @echo "--- Building credentials merger tool"
  83. cd $(CREDENTIALS_MERGER_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  84. cp $(CREDENTIALS_MERGER_BUILD)/credentials-merger-$(MAVEN_VERSION).jar $(CREDENTIALS_MERGER)
  85. clean::
  86. rm -rf $(CREDENTIALS_MERGER_LIB)
  87. cd $(CREDENTIALS_MERGER_DIR) && mvn clean $(MAVEN_OPTIONS) ||:
  88. else
  89. $(CREDENTAILS_MERGER):
  90. $(error cannot build credentials merger jar without source)
  91. endif
  92. #
  93. # Tell the `bdist' target to exclude our java source.
  94. #
  95. BDIST_EXCLUDES += \
  96. --exclude=java \
  97. --exclude=sudo-shell/src \
  98. --exclude=regenerate-thrift.sh