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.

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