Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. include $(ROOT)/Makefile.sdk
  22. default::
  23. @echo ' env-install : Install into virtual-env'
  24. #
  25. # env-install
  26. # Install app into the virtual environment.
  27. #
  28. .PHONY: env-install
  29. env-install: compile ext-env-install
  30. @echo '--- Installing $(APP_NAME) into virtual-env'
  31. @$(ENV_PYTHON) -m pip install -e .
  32. ###################################
  33. # Build DBProxy plugin
  34. ###################################
  35. PLUGIN_DIR := $(realpath .)
  36. PLUGIN_JAVA_LIB := $(PLUGIN_DIR)/java-lib
  37. PLUGIN_JAVA_DIR := $(PLUGIN_DIR)/java
  38. BLD_DIR_PLUGINS := $(PLUGIN_DIR)/java/target
  39. compile: $(DB_PROXY_JAR)
  40. # Build the plugin jar iff BUILD_DB_PROXY is set and the source is present
  41. ifneq (,$(BUILD_DB_PROXY))
  42. ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
  43. $(DB_PROXY_JAR): $(shell find $(PLUGIN_JAVA_DIR) -type f)
  44. mkdir -p $(PLUGIN_JAVA_LIB)
  45. @echo "--- Building DBProxy plugin"
  46. cd $(PLUGIN_JAVA_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  47. cp $(BLD_DIR_PLUGINS)/dbproxy-1.0-SNAPSHOT.jar $(DB_PROXY_JAR)
  48. clean::
  49. rm -rf $(PLUGIN_JAVA_LIB)
  50. cd $(PLUGIN_JAVA_DIR) && mvn clean $(MAVEN_OPTIONS) ||:
  51. else
  52. $(DB_PROXY_JAR):
  53. $(error Cannot build DBProxy plugin without source)
  54. endif
  55. else
  56. $(DB_PROXY_JAR):
  57. @echo 'Skipping DB Proxy Jar build as BUILD_DB_PROXY not set.'
  58. endif