Makefile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. STATIC_GROUP_MAPPING_DIR := $(realpath .)/static-group-mapping
  41. STATIC_GROUP_MAPPING_SRC := $(STATIC_GROUP_MAPPING_DIR)/src
  42. STATIC_GROUP_MAPPING_BUILD := $(STATIC_GROUP_MAPPING_DIR)/build
  43. STATIC_GROUP_MAPPING_LIB := $(STATIC_GROUP_MAPPING_DIR)/java-lib
  44. STATIC_GROUP_MAPPING := $(STATIC_GROUP_MAPPING_LIB)/static-group-mapping-$(DESKTOP_VERSION).jar
  45. compile: $(PLUGIN) $(STATIC_GROUP_MAPPING)
  46. clean::
  47. rm -Rf $(PLUGIN_JAVA_LIB) $(STATIC_GROUP_MAPPING_LIB)
  48. ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
  49. PLUGIN_OPTS := -Dbuild.dir=$(BLD_DIR_PLUGINS) \
  50. -Dhadoop.home=$(HADOOP_HOME) \
  51. -Dplugins.version=$(DESKTOP_VERSION)
  52. $(PLUGIN): $(shell find $(PLUGIN_JAVA_DIR) )
  53. mkdir -p $(PLUGIN_JAVA_LIB)
  54. @echo "--- Building Hadoop plugins"
  55. cd $(PLUGIN_JAVA_DIR) && ant $(ANT_OPTS) $(PLUGIN_OPTS) jar
  56. cp $(BLD_DIR_PLUGINS)/$(notdir $(PLUGIN)) $(PLUGIN)
  57. else
  58. $(PLUGIN):
  59. $(error Cannot build hadoop plugin without source)
  60. endif
  61. STATIC_GROUP_MAPPING_OPTS := -Dbuild.dir=$(STATIC_GROUP_MAPPING_BUILD) \
  62. -Dhadoop.home=$(HADOOP_HOME) \
  63. -Dstatic-group-mapping.version=$(DESKTOP_VERSION)
  64. $(STATIC_GROUP_MAPPING): $(shell find $(STATIC_GROUP_MAPPING_SRC))
  65. mkdir -p $(STATIC_GROUP_MAPPING_LIB)
  66. @echo "--- Building static UserGroupMappingService"
  67. cd $(STATIC_GROUP_MAPPING_DIR) && ant $(ANT_OPTS) $(STATIC_GROUP_MAPPING_OPTS) jar
  68. cp $(STATIC_GROUP_MAPPING_BUILD)/$(notdir $(STATIC_GROUP_MAPPING)) $(STATIC_GROUP_MAPPING)
  69. #
  70. # Tell the `bdist' target to exclude our java source.
  71. #
  72. BDIST_EXCLUDES += \
  73. --exclude=java \
  74. --exclude=regenerate-thrift.sh