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.

110 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. PREFIX ?= /usr/local
  5. BINDIR ?= $(PREFIX)/bin
  6. MANDIR ?= $(PREFIX)/man
  7. SHAREDIR ?= $(PREFIX)/share
  8. PYTHON ?= /usr/bin/env python
  9. # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
  10. ifeq ($(PREFIX),/usr)
  11. SYSCONFDIR=/etc
  12. else
  13. ifeq ($(PREFIX),/usr/local)
  14. SYSCONFDIR=/etc
  15. else
  16. SYSCONFDIR=$(PREFIX)/etc
  17. endif
  18. endif
  19. install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
  20. install -d $(DESTDIR)$(BINDIR)
  21. install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
  22. install -d $(DESTDIR)$(MANDIR)/man1
  23. install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
  24. install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
  25. install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
  26. install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions
  27. install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl
  28. install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions
  29. install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish
  30. codetest:
  31. flake8 .
  32. test:
  33. #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
  34. nosetests --verbose test
  35. $(MAKE) codetest
  36. ot: offlinetest
  37. offlinetest: codetest
  38. 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
  39. tar: youtube-dl.tar.gz
  40. .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites
  41. pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish
  42. youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
  43. zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py
  44. zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
  45. echo '#!$(PYTHON)' > youtube-dl
  46. cat youtube-dl.zip >> youtube-dl
  47. rm youtube-dl.zip
  48. chmod a+x youtube-dl
  49. README.md: youtube_dl/*.py youtube_dl/*/*.py
  50. COLUMNS=80 python youtube_dl/__main__.py --help | python devscripts/make_readme.py
  51. CONTRIBUTING.md: README.md
  52. python devscripts/make_contributing.py README.md CONTRIBUTING.md
  53. supportedsites:
  54. python devscripts/make_supportedsites.py docs/supportedsites.md
  55. README.txt: README.md
  56. pandoc -f markdown -t plain README.md -o README.txt
  57. youtube-dl.1: README.md
  58. python devscripts/prepare_manpage.py >youtube-dl.1.temp.md
  59. pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
  60. rm -f youtube-dl.1.temp.md
  61. youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
  62. python devscripts/bash-completion.py
  63. bash-completion: youtube-dl.bash-completion
  64. youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in
  65. python devscripts/zsh-completion.py
  66. zsh-completion: youtube-dl.zsh
  67. youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
  68. python devscripts/fish-completion.py
  69. fish-completion: youtube-dl.fish
  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