Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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)/java/target
  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) && mvn clean install -DskipTests
  44. @mkdir -p $(BEESWAX_JAVA_LIB)
  45. @cp $(BLD_DIR_BEESWAX)/beeswax-server-$(MAVEN_VERSION).jar $@
  46. else
  47. $(BEESWAX):
  48. $(error Cannot build beeswax jars without source)
  49. endif
  50. #
  51. # Tell the `bdist' target to exclude our java source.
  52. #
  53. BDIST_EXCLUDES += \
  54. --exclude=java \
  55. --exclude=thrift
  56. SDIST_EXCLUDES += \
  57. --exclude=java-lib \
  58. --exclude=thrift