]> Raphaƫl G. Git Repositories - youtubedl/blob - Makefile
Add note about mplayer2 and backporters.
[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 *.dump *.part *.info.json *.mp4 *.flv *.mp3 *.avi CONTRIBUTING.md.tmp youtube-dl youtube-dl.exe
5 find . -name "*.pyc" -delete
6
7 PREFIX ?= /usr/local
8 BINDIR ?= $(PREFIX)/bin
9 MANDIR ?= $(PREFIX)/man
10 SHAREDIR ?= $(PREFIX)/share
11 PYTHON ?= /usr/bin/env python
12
13 # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local
14 ifeq ($(PREFIX),/usr)
15 SYSCONFDIR=/etc
16 else
17 ifeq ($(PREFIX),/usr/local)
18 SYSCONFDIR=/etc
19 else
20 SYSCONFDIR=$(PREFIX)/etc
21 endif
22 endif
23
24 install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
25 install -d $(DESTDIR)$(BINDIR)
26 install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
27 install -d $(DESTDIR)$(MANDIR)/man1
28 install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
29 install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
30 install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
31 install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions
32 install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl
33 install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions
34 install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish
35
36 codetest:
37 flake8 .
38
39 test:
40 #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test
41 nosetests --verbose test
42 $(MAKE) codetest
43
44 ot: offlinetest
45
46 offlinetest: codetest
47 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
48
49 tar: youtube-dl.tar.gz
50
51 .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites
52
53 pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish
54
55 youtube-dl: youtube_dl/*.py youtube_dl/*/*.py
56 zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py
57 zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
58 echo '#!$(PYTHON)' > youtube-dl
59 cat youtube-dl.zip >> youtube-dl
60 rm youtube-dl.zip
61 chmod a+x youtube-dl
62
63 README.md: youtube_dl/*.py youtube_dl/*/*.py
64 COLUMNS=80 python youtube_dl/__main__.py --help | python devscripts/make_readme.py
65
66 CONTRIBUTING.md: README.md
67 python devscripts/make_contributing.py README.md CONTRIBUTING.md
68
69 supportedsites:
70 python devscripts/make_supportedsites.py docs/supportedsites.md
71
72 README.txt: README.md
73 pandoc -f markdown -t plain README.md -o README.txt
74
75 youtube-dl.1: README.md
76 python devscripts/prepare_manpage.py >youtube-dl.1.temp.md
77 pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1
78 rm -f youtube-dl.1.temp.md
79
80 youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in
81 python devscripts/bash-completion.py
82
83 bash-completion: youtube-dl.bash-completion
84
85 youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in
86 python devscripts/zsh-completion.py
87
88 zsh-completion: youtube-dl.zsh
89
90 youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in
91 python devscripts/fish-completion.py
92
93 fish-completion: youtube-dl.fish
94
95 youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish
96 @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \
97 --exclude '*.DS_Store' \
98 --exclude '*.kate-swp' \
99 --exclude '*.pyc' \
100 --exclude '*.pyo' \
101 --exclude '*~' \
102 --exclude '__pycache' \
103 --exclude '.git' \
104 --exclude 'testdata' \
105 --exclude 'docs/_build' \
106 -- \
107 bin devscripts test youtube_dl docs \
108 LICENSE README.md README.txt \
109 Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \
110 youtube-dl.zsh youtube-dl.fish setup.py \
111 youtube-dl