Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
5.5 KiB

  1. # vim: set softtabstop=2 shiftwidth=2:
  2. SHELL = bash
  3. PUBLISHTAG = $(shell node scripts/publish-tag.js)
  4. BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
  5. markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
  6. html_docdeps = html/dochead.html \
  7. html/docfoot.html \
  8. scripts/doc-build.sh \
  9. package.json
  10. cli_mandocs = $(shell find doc/cli -name '*.md' \
  11. |sed 's|.md|.1|g' \
  12. |sed 's|doc/cli/|man/man1/|g' ) \
  13. man/man1/npm-README.1 \
  14. man/man1/npx.1
  15. files_mandocs = $(shell find doc/files -name '*.md' \
  16. |sed 's|.md|.5|g' \
  17. |sed 's|doc/files/|man/man5/|g' ) \
  18. man/man5/npm-json.5 \
  19. man/man5/npm-global.5
  20. misc_mandocs = $(shell find doc/misc -name '*.md' \
  21. |sed 's|.md|.7|g' \
  22. |sed 's|doc/misc/|man/man7/|g' ) \
  23. man/man7/npm-index.7
  24. cli_htmldocs = $(shell find doc/cli -name '*.md' \
  25. |sed 's|.md|.html|g' \
  26. |sed 's|doc/cli/|html/doc/cli/|g' ) \
  27. html/doc/README.html
  28. files_htmldocs = $(shell find doc/files -name '*.md' \
  29. |sed 's|.md|.html|g' \
  30. |sed 's|doc/files/|html/doc/files/|g' ) \
  31. html/doc/files/npm-json.html \
  32. html/doc/files/npm-global.html
  33. misc_htmldocs = $(shell find doc/misc -name '*.md' \
  34. |sed 's|.md|.html|g' \
  35. |sed 's|doc/misc/|html/doc/misc/|g' ) \
  36. html/doc/index.html
  37. mandocs = $(cli_mandocs) $(files_mandocs) $(misc_mandocs)
  38. htmldocs = $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs)
  39. all: doc
  40. latest:
  41. @echo "Installing latest published npm"
  42. @echo "Use 'make install' or 'make link' to install the code"
  43. @echo "in this folder that you're looking at right now."
  44. node bin/npm-cli.js install -g -f npm ${NPMOPTS}
  45. install: all
  46. node bin/npm-cli.js install -g -f ${NPMOPTS} $(shell node bin/npm-cli.js pack | tail -1)
  47. # backwards compat
  48. dev: install
  49. link: uninstall
  50. node bin/npm-cli.js link -f
  51. clean: markedclean marked-manclean doc-clean
  52. rm -rf npmrc
  53. node bin/npm-cli.js cache clean --force
  54. uninstall:
  55. node bin/npm-cli.js rm npm -g -f
  56. doc: $(mandocs) $(htmldocs)
  57. markedclean:
  58. rm -rf node_modules/marked node_modules/.bin/marked .building_marked
  59. marked-manclean:
  60. rm -rf node_modules/marked-man node_modules/.bin/marked-man .building_marked-man
  61. docclean: doc-clean
  62. doc-clean:
  63. rm -rf \
  64. .building_marked \
  65. .building_marked-man \
  66. html/doc \
  67. man
  68. ## build-time tools for the documentation
  69. build-doc-tools := node_modules/.bin/marked \
  70. node_modules/.bin/marked-man
  71. # use `npm install marked-man` for this to work.
  72. man/man1/npm-README.1: README.md scripts/doc-build.sh package.json $(build-doc-tools)
  73. @[ -d man/man1 ] || mkdir -p man/man1
  74. scripts/doc-build.sh $< $@
  75. man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json $(build-doc-tools)
  76. @[ -d man/man1 ] || mkdir -p man/man1
  77. scripts/doc-build.sh $< $@
  78. man/man1/npx.1: node_modules/libnpx/libnpx.1
  79. cat $< | sed s/libnpx/npx/ > $@
  80. man/man5/npm-json.5: man/man5/package.json.5
  81. cp $< $@
  82. man/man5/npm-global.5: man/man5/npm-folders.5
  83. cp $< $@
  84. man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json $(build-doc-tools)
  85. @[ -d man/man5 ] || mkdir -p man/man5
  86. scripts/doc-build.sh $< $@
  87. doc/misc/npm-index.md: scripts/index-build.js package.json $(build-doc-tools)
  88. node scripts/index-build.js > $@
  89. html/doc/index.html: doc/misc/npm-index.md $(html_docdeps) $(build-doc-tools)
  90. @[ -d html/doc ] || mkdir -p html/doc
  91. scripts/doc-build.sh $< $@
  92. man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json $(build-doc-tools)
  93. @[ -d man/man7 ] || mkdir -p man/man7
  94. scripts/doc-build.sh $< $@
  95. html/doc/README.html: README.md $(html_docdeps) $(build-doc-tools)
  96. @[ -d html/doc ] || mkdir -p html/doc
  97. scripts/doc-build.sh $< $@
  98. html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) $(build-doc-tools)
  99. @[ -d html/doc/cli ] || mkdir -p html/doc/cli
  100. scripts/doc-build.sh $< $@
  101. html/doc/files/npm-json.html: html/doc/files/package.json.html
  102. cp $< $@
  103. html/doc/files/npm-global.html: html/doc/files/npm-folders.html
  104. cp $< $@
  105. html/doc/files/%.html: doc/files/%.md $(html_docdeps) $(build-doc-tools)
  106. @[ -d html/doc/files ] || mkdir -p html/doc/files
  107. scripts/doc-build.sh $< $@
  108. html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) $(build-doc-tools)
  109. @[ -d html/doc/misc ] || mkdir -p html/doc/misc
  110. scripts/doc-build.sh $< $@
  111. marked: node_modules/.bin/marked
  112. node_modules/.bin/marked:
  113. node bin/npm-cli.js install marked --no-global --no-timing --no-save
  114. marked-man: node_modules/.bin/marked-man
  115. node_modules/.bin/marked-man:
  116. node bin/npm-cli.js install marked-man --no-global --no-timing --no-save
  117. doc: man
  118. man: $(cli_docs)
  119. test: doc
  120. node bin/npm-cli.js test
  121. tag:
  122. node bin/npm-cli.js tag npm@$(PUBLISHTAG) latest
  123. ls-ok:
  124. node . ls >/dev/null
  125. gitclean:
  126. git clean -fd
  127. publish: gitclean ls-ok link doc-clean doc
  128. @git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true
  129. git push origin $(BRANCH) &&\
  130. git push origin --tags &&\
  131. node bin/npm-cli.js publish --tag=$(PUBLISHTAG)
  132. release: gitclean ls-ok markedclean marked-manclean doc-clean doc
  133. node bin/npm-cli.js prune --production --no-save
  134. @bash scripts/release.sh
  135. sandwich:
  136. @[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)
  137. .PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release ls-ok realclean