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