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.

107 lines
4.2 KiB

12 years ago
12 years ago
  1. all: youtube-dl README.md CONTRIBUTING.md ISSUE_TEMPLATE.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 *.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. ISSUE_TEMPLATE.md:
  48. $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE.tmpl .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. youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
  67. @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
  68. --exclude '*.DS_Store' \
  69. --exclude '*.kate-swp' \
  70. --exclude '*.pyc' \
  71. --exclude '*.pyo' \
  72. --exclude '*~' \
  73. --exclude '__pycache' \
  74. --exclude '.git' \
  75. --exclude 'testdata' \
  76. --exclude 'docs/_build' \
  77. -- \
  78. bin devscripts test youtube_dl docs \
  79. LICENSE README.md README.txt \
  80. Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \
  81. youtube-dl.zsh youtube-dl.fish setup.py \
  82. youtube-dl