]>
Commit | Line | Data |
---|---|---|
416c7fcb | 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: |
383456aa | 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 |
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 |
3ff63fb3 | 15 | SYSCONFDIR != if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi |
5738240e | 16 | |
24f7fb5e | 17 | install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish |
e79e8b7d TM |
18 | install -d $(DESTDIR)$(BINDIR) |
19 | install -m 755 youtube-dl $(DESTDIR)$(BINDIR) | |
20 | install -d $(DESTDIR)$(MANDIR)/man1 | |
21 | install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1 | |
22 | install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d | |
23 | install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl | |
24f7fb5e XC |
24 | install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions |
25 | install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl | |
56d1912f JMF |
26 | install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions |
27 | install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish | |
dce10884 | 28 | |
a0ab29f8 | 29 | codetest: |
dc9a441b | 30 | flake8 . |
a0ab29f8 | 31 | |
a7b5c8d6 | 32 | test: |
fedb6816 FV |
33 | #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test |
34 | nosetests --verbose test | |
a0ab29f8 PH |
35 | $(MAKE) codetest |
36 | ||
37 | ot: offlinetest | |
38 | ||
39 | offlinetest: codetest | |
1b0635ab | 40 | $(PYTHON) -m nose --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 --exclude test_iqiyi_sdk_interpreter.py |
a7b5c8d6 | 41 | |
039dc61b PH |
42 | tar: youtube-dl.tar.gz |
43 | ||
416c7fcb | 44 | .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites |
434eb6f2 | 45 | |
56d1912f | 46 | pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish |
dce10884 | 47 | |
633a50cf PH |
48 | youtube-dl: youtube_dl/*.py youtube_dl/*/*.py |
49 | zip --quiet youtube-dl youtube_dl/*.py youtube_dl/*/*.py | |
20ba0426 | 50 | zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py |
c67598c3 | 51 | echo '#!$(PYTHON)' > youtube-dl |
dce10884 FV |
52 | cat youtube-dl.zip >> youtube-dl |
53 | rm youtube-dl.zip | |
85f76ac9 | 54 | chmod a+x youtube-dl |
dce10884 | 55 | |
633a50cf | 56 | README.md: youtube_dl/*.py youtube_dl/*/*.py |
8639f89f | 57 | COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py |
4618f3da | 58 | |
e56190b3 | 59 | CONTRIBUTING.md: README.md |
8639f89f | 60 | $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md |
e56190b3 | 61 | |
416c7fcb | 62 | supportedsites: |
8639f89f | 63 | $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md |
416c7fcb | 64 | |
cc51a7d4 | 65 | README.txt: README.md |
4bb028f4 | 66 | pandoc -f markdown -t plain README.md -o README.txt |
cc51a7d4 | 67 | |
dce10884 | 68 | youtube-dl.1: README.md |
8639f89f | 69 | $(PYTHON) devscripts/prepare_manpage.py >youtube-dl.1.temp.md |
dffcc2ea | 70 | pandoc -s -f markdown -t man youtube-dl.1.temp.md -o youtube-dl.1 |
d19bb9c0 | 71 | rm -f youtube-dl.1.temp.md |
cfcec693 | 72 | |
633a50cf | 73 | youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in |
8639f89f | 74 | $(PYTHON) devscripts/bash-completion.py |
23109d6a | 75 | |
434eb6f2 PH |
76 | bash-completion: youtube-dl.bash-completion |
77 | ||
24f7fb5e | 78 | youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in |
8639f89f | 79 | $(PYTHON) devscripts/zsh-completion.py |
24f7fb5e XC |
80 | |
81 | zsh-completion: youtube-dl.zsh | |
82 | ||
56d1912f | 83 | youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in |
8639f89f | 84 | $(PYTHON) devscripts/fish-completion.py |
56d1912f JMF |
85 | |
86 | fish-completion: youtube-dl.fish | |
87 | ||
24f7fb5e | 88 | youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish |
814eed0e | 89 | @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \ |
039dc61b PH |
90 | --exclude '*.DS_Store' \ |
91 | --exclude '*.kate-swp' \ | |
92 | --exclude '*.pyc' \ | |
93 | --exclude '*.pyo' \ | |
94 | --exclude '*~' \ | |
95 | --exclude '__pycache' \ | |
814eed0e | 96 | --exclude '.git' \ |
76965512 | 97 | --exclude 'testdata' \ |
2c8a4ba6 | 98 | --exclude 'docs/_build' \ |
814eed0e | 99 | -- \ |
2c8a4ba6 | 100 | bin devscripts test youtube_dl docs \ |
aae74e38 | 101 | LICENSE README.md README.txt \ |
56d1912f | 102 | Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \ |
24f7fb5e | 103 | youtube-dl.zsh youtube-dl.fish setup.py \ |
814eed0e | 104 | youtube-dl |