Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. BLD_DIR_SPARK = $(SPARK_ROOT)/java/target
  25. SPARK_JAVA_LIB = $(SPARK_ROOT)/java-lib
  26. SPARK := $(SPARK_JAVA_LIB)/SparkServer.jar
  27. SPARK_JAVA_DIR := $(SPARK_ROOT)/java
  28. HAVE_JAVA_SRC = $(wildcard $(SPARK_JAVA_DIR))
  29. compile: $(SPARK)
  30. ifneq (,$(HAVE_JAVA_SRC))
  31. clean::
  32. rm -Rf $(SPARK_JAVA_LIB)
  33. cd $(SPARK_JAVA_DIR) && mvn clean $(MAVEN_OPTIONS) || :
  34. $(SPARK): $(shell find $(SPARK_JAVA_DIR) -type f)
  35. @echo "--- Building Desktop spark"
  36. cd $(SPARK_JAVA_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  37. else
  38. $(SPARK):
  39. $(error Cannot build spark jars without source)
  40. endif
  41. BDIST_EXCLUDES += \
  42. --exclude=java
  43. SDIST_EXCLUDES += \
  44. --exclude=java-lib