Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 = spark
  22. include $(ROOT)/Makefile.sdk
  23. SPARK_ROOT := $(realpath .)
  24. JAVA_LIB = $(SPARK_ROOT)/java-lib
  25. LIVY_DIR = $(SPARK_ROOT)/java
  26. LIVY_TARGET_DIR = $(LIVY_DIR)/livy-assembly/target/scala-2.10
  27. LIVY_ASSEMBLY_JAR = livy-assembly-$(MAVEN_VERSION).jar
  28. LIVY_JAR = $(JAVA_LIB)/livy-assembly.jar
  29. HAVE_JAVA_SRC = $(wildcard $(LIVY_DIR))
  30. compile: $(LIVY_JAR)
  31. ifneq (,$(wildcard $(LIVY_DIR)))
  32. $(LIVY_JAR): $(shell find $(LIVY_DIR) -type f)
  33. mkdir -p $(JAVA_LIB)
  34. @echo "--- Building Desktop spark"
  35. cd $(LIVY_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  36. cp $(LIVY_TARGET_DIR)/$(LIVY_ASSEMBLY_JAR) $(LIVY_JAR)
  37. clean::
  38. rm -Rf $(JAVA_LIB)
  39. cd $(LIVY_DIR) && mvn clean $(MAVEN_OPTIONS) || :
  40. else
  41. $(LIVY_JAR):
  42. $(error Cannot build spark jars without source)
  43. endif
  44. BDIST_EXCLUDES += \
  45. --exclude=java
  46. SDIST_EXCLUDES += \
  47. --exclude=java-lib