Makefile.vars 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Licensed to Cloudera, Inc. under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. Cloudera, Inc. licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. # Public (SDK) Makefile variables. It requires the following to be defined:
  18. # ROOT
  19. # Points to the root of the Hue installation.
  20. # From here, we can include $(ROOT)/Makefile.vars
  21. # to access various
  22. #
  23. SHELL := /bin/bash
  24. ##############################
  25. # 1. Check for python-dev
  26. # 2. Locate the system Python
  27. ##############################
  28. # If we're an installed Makefile, allow the build to override
  29. # some things. This allows the install to prepopulate
  30. # SYS_PYTHON, in particular.
  31. ifneq ($(wildcard $(ROOT)/Makefile.buildvars),)
  32. include $(ROOT)/Makefile.buildvars
  33. endif
  34. PYTHON_H ?= $(shell ls /usr/include/python2.7/Python.h 2>/dev/null || ls /usr/include/python2.6/Python.h 2>/dev/null || ls /usr/include/python2.5/Python.h 2>/dev/null || ls /usr/include/python2.4/Python.h 2>/dev/null)
  35. ifndef SKIP_PYTHONDEV_CHECK
  36. ifeq ($(PYTHON_H),)
  37. $(error "Error: must have python development packages for 2.4, 2.5, 2.6 or 2.7. Could not find Python.h. Please install python2.4-devel, python2.5-devel, python2.6-devel or python2.7-devel")
  38. endif
  39. SYS_PYTHON := $(shell echo $(PYTHON_H) | grep -o python2..)
  40. else
  41. SYS_PYTHON ?= $(shell which python)
  42. endif
  43. ifeq ($(SYS_PYTHON),)
  44. $(error "Error: Need python version 2.4, 2.5, 2.6 or 2.7.")
  45. endif
  46. HADOOP_HOME ?= /usr/lib/hadoop
  47. ##############################
  48. # Location of the virtual environment
  49. ##############################
  50. BLD_DIR := $(ROOT)/build
  51. BLD_DIR_ENV := $(BLD_DIR)/env
  52. BLD_DIR_BIN := $(BLD_DIR_ENV)/bin
  53. THIRDPARTY_DIR := $(ROOT)/ext/thirdparty
  54. THIRDPARTY_JS_DIR := $(THIRDPARTY_DIR)/js
  55. ##############################
  56. # ENV_PYTHON is the Python installed in the virtual environment. App
  57. # installation should always use the ENV_PYTHON.
  58. ##############################
  59. ENV_PYTHON := $(BLD_DIR_ENV)/bin/$(notdir $(SYS_PYTHON))
  60. ENV_PYTHON_VERSION = $(shell $(ENV_PYTHON) -c 'import sys; print "python%d.%d"% sys.version_info[:2]')
  61. ##############################
  62. # ENV_EASY_INSTALL uses the easy_install script installed in the virtual
  63. # environment. It must be called as an argument to ENV_PYTHON so the
  64. # problem of the shebang being truncated at 80 characters in most kernels
  65. # doesn't arise.
  66. ##############################
  67. ENV_EASY_INSTALL := $(ENV_PYTHON) $(BLD_DIR_BIN)/easy_install
  68. ##############################
  69. # This version is substituted through to the tarballs and packages.
  70. ##############################
  71. DESKTOP_VERSION := $(shell python <(cat $(ROOT)/VERSION; echo print VERSION))
  72. MAVEN_VERSION = $(DESKTOP_VERSION)-SNAPSHOT
  73. ##############################
  74. # Path to the desktop hadoop plugin jar
  75. ##############################
  76. DESKTOP_PLUGIN_JAR := $(ROOT)/desktop/libs/hadoop/java-lib/hue-plugins-$(MAVEN_VERSION).jar
  77. ################################################
  78. # Internationalization
  79. ################################################
  80. PYBABEL := $(ROOT)/build/env/bin/pybabel