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