]> Raphaƫl G. Git Repositories - youtubedl/blob - Makefile
Update upstream source from tag 'upstream/2019.09.01'
[youtubedl] / Makefile
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
3 clean:
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
5 find . -name "*.pyc" -delete
6 find . -name "*.class" -delete
7
8 PREFIX ?= /usr/local
9 BINDIR ?= $(PREFIX)/bin
10 MANDIR ?= $(PREFIX)/man
11 SHAREDIR ?= $(PREFIX)/share
12 PYTHON ?= /usr/bin/env python
13
14 # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
15 SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi)
16
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
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
32 codetest:
33 flake8 .
34
35 test:
36 #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
37 nosetests --verbose test
38 $(MAKE) codetest
39
40 ot: offlinetest
41
42 # Keep this list in sync with devscripts/run_tests.sh
43 offlinetest: codetest
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
53
54 tar: youtube-dl.tar.gz
55
56 .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites
57
58 pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish
59
60 youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
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 ;\
64 cp -pPR $$d/*.py zip/$$d/ ;\
65 done
66 touch -t 200001010101 zip/youtube_dl/*.py zip/youtube_dl/*/*.py
67 mv zip/youtube_dl/__main__.py zip/
68 cd zip ; zip -q ../youtube-dl youtube_dl/*.py youtube_dl/*/*.py __main__.py
69 rm -rf zip
70 echo '#!$(PYTHON)' > youtube-dl
71 cat youtube-dl.zip >> youtube-dl
72 rm youtube-dl.zip
73 chmod a+x youtube-dl
74
75 README.md: youtube_dl/*.py youtube_dl/*/*.py
76 COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py
77
78 CONTRIBUTING.md: README.md
79 $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md
80
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
87
88 supportedsites:
89 $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md
90
91 README.txt: README.md
92 pandoc -f $(MARKDOWN) -t plain README.md -o README.txt
93
94 youtube-dl.1: README.md
95 $(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md
96 pandoc -s -f $(MARKDOWN) -t man youtube-dl.1.temp.md -o youtube-dl.1
97 rm -f youtube-dl.1.temp.md
98
99 youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
100 $(PYTHON) devscripts/bash-completion.py
101
102 bash-completion: youtube-dl.bash-completion
103
104 youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in
105 $(PYTHON) devscripts/zsh-completion.py
106
107 zsh-completion: youtube-dl.zsh
108
109 youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
110 $(PYTHON) devscripts/fish-completion.py
111
112 fish-completion: youtube-dl.fish
113
114 lazy-extractors: youtube_dl/extractor/lazy_extractors.py
115
116 _EXTRACTOR_FILES = $(shell find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py')
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
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
121 @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
122 --exclude '*.DS_Store' \
123 --exclude '*.kate-swp' \
124 --exclude '*.pyc' \
125 --exclude '*.pyo' \
126 --exclude '*~' \
127 --exclude '__pycache__' \
128 --exclude '.git' \
129 --exclude 'docs/_build' \
130 -- \
131 bin devscripts test youtube_dl docs \
132 ChangeLog AUTHORS LICENSE README.md README.txt \
133 Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \
134 youtube-dl.zsh youtube-dl.fish setup.py setup.cfg \
135 youtube-dl