Makefile.tarball 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # <<<< DEV ONLY
  18. PROD_INCLUDES := \
  19. apps \
  20. desktop \
  21. ext/thirdparty \
  22. LICENSE.txt \
  23. Makefile* \
  24. tools/app_reg \
  25. tools/virtual-bootstrap \
  26. VERSION_DATA
  27. PROD_EXCLUDES := \
  28. Makefile.tarball \
  29. desktop/apps/jframegallery \
  30. desktop/apps/beeswax \
  31. desktop/conf \
  32. desktop/desktop.db \
  33. desktop/apps/hello \
  34. desktop/apps/visualizer \
  35. desktop/devtools.mk \
  36. ext/thirdparty/README.md \
  37. ext/thirdparty/js/manifest.json
  38. # Macro to remove things we don't want to package
  39. define remove_devtree_exclusions
  40. @find $(1) \( -name '.git' -o \
  41. -name '.gitignore' -o \
  42. -name '.*~' -o \
  43. -name '.#*' -o \
  44. -name '.pylintrc' -o \
  45. -name 'tags' -o \
  46. -name 'desktop.db' -o \
  47. -name 'app.reg' -o \
  48. -name '*.py[co]' -o \
  49. -name '.*.sw?' \) -prune -exec rm -rf {} \;
  50. endef
  51. ###################################
  52. # Packaging for production release
  53. ###################################
  54. # Make a tarball
  55. .PHONY: prod
  56. prod: $(BLD_DIR_PROD_TGZ)
  57. $(BLD_DIR_PROD_TGZ): $(BLD_DIR_PROD)
  58. @tar -C $(BLD_DIR_PROD)/.. -czf $(BLD_DIR_PROD_TGZ) hue-$(DESKTOP_VERSION)
  59. @echo "--- Generated $(BLD_DIR_PROD_TGZ)"
  60. .PHONY: $(BLD_DIR_PROD)
  61. $(BLD_DIR_PROD): crepo docs
  62. @echo "--- Preparing general distribution tree at $@"
  63. @rm -rf $@
  64. @mkdir -p $@
  65. tar -cf - $(PROD_INCLUDES) | tar -C $(BLD_DIR_PROD) -xf -
  66. @echo "---- Removing exclusions"
  67. @for i in $(PROD_EXCLUDES) ; do rm -rf $(BLD_DIR_PROD)/$$i ; done
  68. $(call remove_devtree_exclusions,$(BLD_DIR_PROD))
  69. @echo "---- Copying misc files"
  70. @cp $(ROOT)/dist/* $(BLD_DIR_PROD)
  71. @mv $(BLD_DIR_PROD)/desktop/conf{.dist,}
  72. cp -r $(BLD_DIR_DOC) $(BLD_DIR_PROD)/docs
  73. @echo "---- Stripping Makefiles"
  74. @$(call STRIP_DEV, $(ROOT)/Makefile, $(BLD_DIR_PROD)/Makefile)
  75. @$(call STRIP_DEV, $(ROOT)/Makefile.vars.priv, $(BLD_DIR_PROD)/Makefile.vars.priv)
  76. @$(call STRIP_DEV, $(APPS_DIR)/Makefile, $(BLD_DIR_PROD)/apps/Makefile)
  77. @$(call STRIP_DEV, $(DESKTOP_DIR)/Makefile, $(BLD_DIR_PROD)/desktop/Makefile)
  78. @cd $(BLD_DIR_PROD) && make distclean
  79. # END DEV ONLY >>>>