Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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_NAME = beeswax
  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 the java-lib
  36. clean::
  37. rm -Rf $(BEESWAX_JAVA_LIB)
  38. cd $(BEESWAX_JAVA_DIR) && mvn clean $(MAVEN_OPTIONS) || :
  39. $(BEESWAX): $(shell find $(BEESWAX_JAVA_DIR) -type f)
  40. @echo "--- Building Desktop beeswax"
  41. cd $(BEESWAX_JAVA_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  42. @mkdir -p $(BEESWAX_JAVA_LIB)
  43. @cp $(BLD_DIR_BEESWAX)/beeswax-server-$(MAVEN_VERSION).jar $@
  44. else
  45. $(BEESWAX):
  46. $(error Cannot build beeswax jars without source)
  47. endif
  48. #
  49. # Tell the `bdist' target to exclude our java source.
  50. #
  51. BDIST_EXCLUDES += \
  52. --exclude=java \
  53. --exclude=thrift
  54. SDIST_EXCLUDES += \
  55. --exclude=java-lib \
  56. --exclude=thrift