Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. PLUGIN := $(PLUGIN_JAVA_LIB)/hue-plugins-$(DESKTOP_VERSION).jar
  39. BLD_DIR_PLUGINS := $(PLUGIN_DIR)/build/java
  40. compile: $(PLUGIN)
  41. clean::
  42. rm -Rf $(PLUGIN_JAVA_LIB)
  43. ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
  44. PLUGIN_OPTS := -Dbuild.dir=$(BLD_DIR_PLUGINS) \
  45. -Dhadoop.home=$(HADOOP_HOME) \
  46. -Dplugins.version=$(DESKTOP_VERSION)
  47. $(PLUGIN): $(shell find $(PLUGIN_JAVA_DIR) )
  48. mkdir -p $(PLUGIN_JAVA_LIB)
  49. @echo "--- Building Hadoop plugins"
  50. cd $(PLUGIN_JAVA_DIR) && ant $(ANT_OPTS) $(PLUGIN_OPTS) jar
  51. cp $(BLD_DIR_PLUGINS)/$(notdir $(PLUGIN)) $(PLUGIN)
  52. else
  53. $(PLUGIN):
  54. $(error Cannot build hadoop plugin without source)
  55. endif
  56. #
  57. # Tell the `bdist' target to exclude our java source.
  58. #
  59. BDIST_EXCLUDES += \
  60. --exclude=java \
  61. --exclude=regenerate-thrift.sh