Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. # Application installation
  19. # ========================
  20. # The apps/ directory contains all the opensource apps. The standard build
  21. # process installs all of them. You can use the `app_reg' tool for more
  22. # fine-grain control.
  23. #
  24. export ROOT := $(realpath ..)
  25. include $(ROOT)/Makefile.vars.priv
  26. default: env-install
  27. .PHONY: clean default distclean install
  28. APPS := $(shell find . -maxdepth 2 -name "src" -type d|cut -d"/" -f2|sort)
  29. ################################################
  30. # Install all applications into the Desktop environment
  31. # Updates all recursive targets to pass through PYTHON_VER, ENV_PYTHON, and VIRTUAL_ENV
  32. # to ensure application builds and installs work per Python version.
  33. ################################################
  34. EGG_INFO_TARGETS := $(APPS:%=.recursive-egg-info/%)
  35. .recursive-egg-info/%:
  36. @$(MAKE) -C $* egg-info ext-eggs
  37. .PHONY: env-install
  38. env-install: $(EGG_INFO_TARGETS)
  39. ENV_PYTHON=$(ENV_PYTHON) PYTHON_VER=$(PYTHON_VER) VIRTUAL_ENV=$(BLD_DIR_ENV) $(APP_REG) --install $(APPS) --relative-paths
  40. ################################################
  41. # Distribution
  42. ################################################
  43. INSTALL_BDIST_TARGETS := $(APPS:%=.recursive-install-bdist/%)
  44. .recursive-install-bdist/%: %
  45. INSTALL_DIR=$(INSTALL_DIR)/apps/$< PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $< install-bdist
  46. .PHONY: install
  47. install: install-source-parts $(INSTALL_BDIST_TARGETS)
  48. #
  49. # install-source-parts:
  50. # Installs the non-app parts into the INSTALL_DIR
  51. #
  52. SOURCE_PARTS = Makefile
  53. .PHONY: install-source-parts
  54. install-source-parts:
  55. mkdir -p $(INSTALL_DIR)/apps
  56. tar cf - $(SOURCE_PARTS) | tar -C $(INSTALL_DIR)/apps -xf -
  57. ################################################
  58. # Clean all the apps
  59. ################################################
  60. CLEAN_TARGETS := $(APPS:%=.recursive-clean/%)
  61. DISTCLEAN_TARGETS := $(APPS:%=.recursive-distclean/%)
  62. EXT_CLEAN_TARGETS := $(APPS:%=.recursive-ext-clean/%)
  63. clean: $(CLEAN_TARGETS)
  64. .recursive-clean/%:
  65. @PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $* clean
  66. @$(APP_REG) --remove $* ||:
  67. distclean: $(DISTCLEAN_TARGETS)
  68. .recursive-distclean/%:
  69. @PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $* distclean
  70. @$(APP_REG) --remove $* ||:
  71. ext-clean: $(EXT_CLEAN_TARGETS)
  72. .recursive-ext-clean/%:
  73. @PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $* ext-clean
  74. ################################################
  75. # Internationalization
  76. ################################################
  77. I18N_APPS := about \
  78. beeswax \
  79. metastore \
  80. filebrowser \
  81. jobbrowser \
  82. jobsub \
  83. useradmin \
  84. oozie \
  85. impala \
  86. pig \
  87. search \
  88. hbase \
  89. sqoop \
  90. zookeeper \
  91. rdbms \
  92. spark \
  93. hive
  94. COMPILE_LOCALE_TARGETS := $(I18N_APPS:%=.recursive-compile-locales/%)
  95. compile-locales: $(COMPILE_LOCALE_TARGETS)
  96. .recursive-compile-locales/%:
  97. -@PYTHON_VER=$(PYTHON_VER) ENV_PYTHON=$(ENV_PYTHON) VIRTUAL_ENV=$(BLD_DIR_ENV) $(MAKE) -C $* compile-locale