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.

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