]>
Commit | Line | Data |
---|---|---|
ec4a4c6f | 1 | all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites |
4618f3da | 2 | |
85f76ac9 | 3 | clean: |
6f366ef3 | 4 | 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* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dl youtube-dl.exe |
8e678af4 | 5 | find . -name "*.pyc" -delete |
101067de | 6 | find . -name "*.class" -delete |
4618f3da | 7 | |
df866e7f | 8 | PREFIX ?= /usr/local |
9 | BINDIR ?= $(PREFIX)/bin | |
10 | MANDIR ?= $(PREFIX)/man | |
24f7fb5e | 11 | SHAREDIR ?= $(PREFIX)/share |
df866e7f | 12 | PYTHON ?= /usr/bin/env python |
e79e8b7d | 13 | |
5738240e | 14 | # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local |
8204c733 | 15 | SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi) |
5738240e | 16 | |
af751350 S |
17 | # set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 |
18 | MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi) | |
19 | ||
24f7fb5e | 20 | install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish |
e79e8b7d TM |
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 | |
24f7fb5e XC |
27 | install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions |
28 | install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl | |
56d1912f JMF |
29 | install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions |
30 | install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish | |
dce10884 | 31 | |
a0ab29f8 | 32 | codetest: |
dc9a441b | 33 | flake8 . |
a0ab29f8 | 34 | |
a7b5c8d6 | 35 | test: |
fedb6816 FV |
36 | #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test |
37 | nosetests --verbose test | |
a0ab29f8 PH |
38 | $(MAKE) codetest |
39 | ||
40 | ot: offlinetest | |
41 | ||
82a62de1 | 42 | # Keep this list in sync with devscripts/run_tests.sh |
a0ab29f8 | 43 | offlinetest: codetest |
82a62de1 YCH |
44 | $(PYTHON) -m nose --verbose test \ |
45 | --exclude test_age_restriction.py \ | |
46 | --exclude test_download.py \ | |
47 | --exclude test_iqiyi_sdk_interpreter.py \ | |
48 | --exclude test_socks.py \ | |
49 | --exclude test_subtitles.py \ | |
50 | --exclude test_write_annotations.py \ | |
51 | --exclude test_youtube_lists.py \ | |
52 | --exclude test_youtube_signature.py | |
a7b5c8d6 | 53 | |
039dc61b PH |
54 | tar: youtube-dl.tar.gz |
55 | ||
416c7fcb | 56 | .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites |
434eb6f2 | 57 | |
56d1912f | 58 | pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish |
dce10884 | 59 | |
633a50cf | 60 | youtube-dl: youtube_dl/*.py youtube_dl/*/*.py |
305d99f0 BW |
61 | mkdir -p zip |
62 | for d in youtube_dl youtube_dl/downloader youtube_dl/extractor youtube_dl/postprocessor ; do \ | |
63 | mkdir -p zip/$$d ;\ | |
c75c384f | 64 | cp -pPR $$d/*.py zip/$$d/ ;\ |
305d99f0 BW |
65 | done |
66 | touch -t 200001010101 zip/youtube_dl/*.py zip/youtube_dl/*/*.py | |
67 | mv zip/youtube_dl/__main__.py zip/ | |
c75c384f | 68 | cd zip ; zip -q ../youtube-dl youtube_dl/*.py youtube_dl/*/*.py __main__.py |
305d99f0 | 69 | rm -rf zip |
c67598c3 | 70 | echo '#!$(PYTHON)' > youtube-dl |
dce10884 FV |
71 | cat youtube-dl.zip >> youtube-dl |
72 | rm youtube-dl.zip | |
85f76ac9 | 73 | chmod a+x youtube-dl |
dce10884 | 74 | |
633a50cf | 75 | README.md: youtube_dl/*.py youtube_dl/*/*.py |
8639f89f | 76 | COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py |
4618f3da | 77 | |
e56190b3 | 78 | CONTRIBUTING.md: README.md |
8639f89f | 79 | $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md |
e56190b3 | 80 | |
eefa0f21 S |
81 | issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md youtube_dl/version.py |
82 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE/1_broken_site.md | |
83 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE/2_site_support_request.md | |
84 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md | |
85 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE/4_bug_report.md | |
86 | $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md .github/ISSUE_TEMPLATE/5_feature_request.md | |
7710bdf4 | 87 | |
416c7fcb | 88 | supportedsites: |
8639f89f | 89 | $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md |
416c7fcb | 90 | |
cc51a7d4 | 91 | README.txt: README.md |
af751350 | 92 | pandoc -f $(MARKDOWN) -t plain README.md -o README.txt |
cc51a7d4 | 93 | |
dce10884 | 94 | youtube-dl.1: README.md |
27f17c0e | 95 | $(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md |
af751350 | 96 | pandoc -s -f $(MARKDOWN) -t man youtube-dl.1.temp.md -o youtube-dl.1 |
d19bb9c0 | 97 | rm -f youtube-dl.1.temp.md |
cfcec693 | 98 | |
633a50cf | 99 | youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in |
8639f89f | 100 | $(PYTHON) devscripts/bash-completion.py |
23109d6a | 101 | |
434eb6f2 PH |
102 | bash-completion: youtube-dl.bash-completion |
103 | ||
24f7fb5e | 104 | youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in |
8639f89f | 105 | $(PYTHON) devscripts/zsh-completion.py |
24f7fb5e XC |
106 | |
107 | zsh-completion: youtube-dl.zsh | |
108 | ||
56d1912f | 109 | youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in |
8639f89f | 110 | $(PYTHON) devscripts/fish-completion.py |
56d1912f JMF |
111 | |
112 | fish-completion: youtube-dl.fish | |
113 | ||
779822d9 JMF |
114 | lazy-extractors: youtube_dl/extractor/lazy_extractors.py |
115 | ||
8204c733 | 116 | _EXTRACTOR_FILES = $(shell find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') |
779822d9 JMF |
117 | youtube_dl/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) |
118 | $(PYTHON) devscripts/make_lazy_extractors.py $@ | |
119 | ||
3e191da6 | 120 | youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish ChangeLog AUTHORS |
814eed0e | 121 | @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \ |
039dc61b PH |
122 | --exclude '*.DS_Store' \ |
123 | --exclude '*.kate-swp' \ | |
124 | --exclude '*.pyc' \ | |
125 | --exclude '*.pyo' \ | |
126 | --exclude '*~' \ | |
4f90d2ae | 127 | --exclude '__pycache__' \ |
814eed0e | 128 | --exclude '.git' \ |
2c8a4ba6 | 129 | --exclude 'docs/_build' \ |
814eed0e | 130 | -- \ |
2c8a4ba6 | 131 | bin devscripts test youtube_dl docs \ |
3e191da6 | 132 | ChangeLog AUTHORS LICENSE README.md README.txt \ |
56d1912f | 133 | Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \ |
dafb4c66 | 134 | youtube-dl.zsh youtube-dl.fish setup.py setup.cfg \ |
814eed0e | 135 | youtube-dl |