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.

113 lines
4.6 KiB

12 years ago
12 years ago
  1. all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites
  2. clean:
  3. rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish youtube_dl/extractor/lazy_extractors.py *.dump *.part *.info.json *.mp4 *.flv *.mp3 *.avi CONTRIBUTING.md.tmp ISSUE_TEMPLATE.md.tmp youtube-dl youtube-dl.exe
  4. find . -name "*.pyc" -delete
  5. find . -name "*.class" -delete
  6. PREFIX ?= /usr/local
  7. BINDIR ?= $(PREFIX)/bin
  8. MANDIR ?= $(PREFIX)/man
  9. SHAREDIR ?= $(PREFIX)/share
  10. PYTHON ?= /usr/bin/env python
  11. # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
  12. SYSCONFDIR != if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi
  13. install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
  14. install -d $(DESTDIR)$(BINDIR)
  15. install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
  16. install -d $(DESTDIR)$(MANDIR)/man1
  17. install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
  18. install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
  19. install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
  20. install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions
  21. install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl
  22. install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions
  23. install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish
  24. codetest:
  25. flake8 .
  26. test:
  27. #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
  28. nosetests --verbose test
  29. $(MAKE) codetest
  30. ot: offlinetest
  31. offlinetest: codetest
  32. $(PYTHON) -m nose --verbose test --exclude test_download.py --exclude test_age_restriction.py --exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py
  33. tar: youtube-dl.tar.gz
  34. .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites
  35. pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish
  36. youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
  37. zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py
  38. zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
  39. echo '#!$(PYTHON)' > youtube-dl
  40. cat youtube-dl.zip >> youtube-dl
  41. rm youtube-dl.zip
  42. chmod a+x youtube-dl
  43. README.md: youtube_dl/*.py youtube_dl/*/*.py
  44. COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py
  45. CONTRIBUTING.md: README.md
  46. $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md
  47. .github/ISSUE_TEMPLATE.md: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl.md youtube_dl/version.py
  48. $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl.md .github/ISSUE_TEMPLATE.md
  49. supportedsites:
  50. $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md
  51. README.txt: README.md
  52. pandoc -f markdown -t plain README.md -o README.txt
  53. youtube-dl.1: README.md
  54. $(PYTHON) devscripts/prepare_manpage.py >youtube-dl.1.temp.md
  55. pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
  56. rm -f youtube-dl.1.temp.md
  57. youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
  58. $(PYTHON) devscripts/bash-completion.py
  59. bash-completion: youtube-dl.bash-completion
  60. youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in
  61. $(PYTHON) devscripts/zsh-completion.py
  62. zsh-completion: youtube-dl.zsh
  63. youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
  64. $(PYTHON) devscripts/fish-completion.py
  65. fish-completion: youtube-dl.fish
  66. lazy-extractors: youtube_dl/extractor/lazy_extractors.py
  67. _EXTRACTOR_FILES != find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py'
  68. youtube_dl/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES)
  69. $(PYTHON) devscripts/make_lazy_extractors.py $@
  70. youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
  71. @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
  72. --exclude '*.DS_Store' \
  73. --exclude '*.kate-swp' \
  74. --exclude '*.pyc' \
  75. --exclude '*.pyo' \
  76. --exclude '*~' \
  77. --exclude '__pycache' \
  78. --exclude '.git' \
  79. --exclude 'testdata' \
  80. --exclude 'docs/_build' \
  81. -- \
  82. bin devscripts test youtube_dl docs \
  83. LICENSE README.md README.txt \
  84. Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \
  85. youtube-dl.zsh youtube-dl.fish setup.py \
  86. youtube-dl