Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. APP_FULL_NAME = hue-beeswax-$(APP_VERSION)
  22. include $(ROOT)/Makefile.sdk
  23. ###################################
  24. # Build beeswax
  25. ###################################
  26. BEESWAX_ROOT := $(realpath .)
  27. BLD_DIR_BEESWAX=$(BEESWAX_ROOT)/build/java
  28. BEESWAX_JAVA_LIB := $(BEESWAX_ROOT)/java-lib
  29. BEESWAX_HIVE_LIB := $(BEESWAX_ROOT)/hive/lib
  30. BEESWAX := $(BEESWAX_JAVA_LIB)/BeeswaxServer.jar
  31. BEESWAX_JAVA_DIR := $(BEESWAX_ROOT)/java
  32. HAVE_JAVA_SRC=$(wildcard $(BEESWAX_JAVA_DIR))
  33. compile: $(BEESWAX)
  34. ifneq (,$(HAVE_JAVA_SRC))
  35. # If we have the source, remove it for clean
  36. clean::
  37. rm -Rf $(BEESWAX_JAVA_LIB)
  38. BEESWAX_OPTS := -Dbuild.dir=$(BLD_DIR_BEESWAX) \
  39. -Dhadoop.home=$(HADOOP_HOME) \
  40. -Dhive.lib=$(BEESWAX_HIVE_LIB)
  41. $(BEESWAX): $(shell find $(BEESWAX_JAVA_DIR))
  42. @echo "--- Building Desktop beeswax"
  43. cd $(BEESWAX_JAVA_DIR) && ant $(ANT_OPTS) $(BEESWAX_OPTS) jar test-jar
  44. @mkdir -p $(BEESWAX_JAVA_LIB)
  45. @cp $(BLD_DIR_BEESWAX)/jar/BeeswaxServer.jar $@
  46. @cp $(BLD_DIR_BEESWAX)/jar/BeeswaxTest.jar $(BEESWAX_JAVA_LIB)/BeeswaxTest.jar
  47. else
  48. $(BEESWAX):
  49. $(error Cannot build beeswax jars without source)
  50. endif
  51. #
  52. # Tell the `bdist' target to exclude our java source.
  53. #
  54. BDIST_EXCLUDES += \
  55. --exclude=java \
  56. --exclude=thrift
  57. SDIST_EXCLUDES += \
  58. --exclude=java-lib \
  59. --exclude=thrift