Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. export ROOT := $(realpath ..)
  19. include $(ROOT)/Makefile.vars.priv
  20. .PHONY: default docs
  21. default: docs
  22. docs: $(BLD_DIR_DOC)
  23. # Option for a2x
  24. NO_TOC := --xsltproc-opts='--stringparam generate.toc ""'
  25. #
  26. # Being lazy/loose with the prerequsite. Include all files except sdk, which is
  27. # handled separately below.
  28. #
  29. $(BLD_DIR_DOC): $(BLD_DIR_DOC)/sdk $(shell find . -name sdk -prune -o -print)
  30. @echo '--- Generating doc at $@'
  31. @mkdir -p $@
  32. @a2x $(NO_TOC) --icons --icons-dir=images --format=xhtml --stylesheet=docbook.css -D $@ index.txt
  33. @a2x --asciidoc-opts="-a toc.max.depth=4" --format=xhtml --icons --icons-dir=images --stylesheet=docbook.css -D $@ manual.txt
  34. @rm -f {index,manual}.xml
  35. @cp docbook.css $@
  36. @cp *.repo $@
  37. @# Remove intermediate file
  38. @rsync -a images $@/
  39. @cp -r release-notes $@/
  40. $(BLD_DIR_DOC)/sdk: $(shell find sdk)
  41. @echo '--- Generating sdk doc at $@'
  42. @mkdir -p $@
  43. @cp sdk/*.png $@
  44. @cp docbook.css $@
  45. @# This is somewhat heinous, but works fine and avoids the need
  46. @# to install markdown on developer systems, or depend on building
  47. @# out the virtual env to build sdk docs
  48. @PYTHONPATH=$(DESKTOP_DIR)/core/ext-py/markdown \
  49. $(DESKTOP_DIR)/core/ext-py/markdown/bin/markdown \
  50. sdk/sdk.md -x toc > $@/sdk.html
  51. @echo "--- Generated $@/sdk.html"
  52. clean:
  53. @echo '--- Removing $(BLD_DIR_DOC)'
  54. @rm -rf $(BLD_DIR_DOC)