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