Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. ###################################
  23. # Build Hadoop plugins
  24. ###################################
  25. PLUGIN_DIR := $(realpath .)
  26. PLUGIN_JAVA_LIB := $(PLUGIN_DIR)/java-lib
  27. PLUGIN_JAVA_DIR := $(PLUGIN_DIR)/java
  28. PLUGIN := $(PLUGIN_JAVA_LIB)/hue-plugins-$(DESKTOP_VERSION).jar
  29. BLD_DIR_PLUGINS := $(PLUGIN_DIR)/build/java
  30. compile: $(PLUGIN)
  31. clean::
  32. rm -Rf $(PLUGIN_JAVA_LIB)
  33. ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
  34. PLUGIN_OPTS := -Dbuild.dir=$(BLD_DIR_PLUGINS) \
  35. -Dhadoop.home=$(HADOOP_HOME) \
  36. -Dplugins.version=$(DESKTOP_VERSION)
  37. $(PLUGIN): $(shell find $(PLUGIN_JAVA_DIR) )
  38. mkdir -p $(PLUGIN_JAVA_LIB)
  39. @echo "--- Building Hadoop plugins"
  40. cd $(PLUGIN_JAVA_DIR) && ant $(ANT_OPTS) $(PLUGIN_OPTS) jar
  41. cp $(BLD_DIR_PLUGINS)/$(notdir $(PLUGIN)) $(PLUGIN)
  42. else
  43. $(PLUGIN):
  44. $(error Cannot build hadoop plugin without source)
  45. endif
  46. #
  47. # Tell the `bdist' target to exclude our java source.
  48. #
  49. BDIST_EXCLUDES += \
  50. --exclude=java \
  51. --exclude=regenerate-thrift.sh