]> jfr.im git - yt-dlp.git/blame - Makefile
More work on soundcloud IE
[yt-dlp.git] / Makefile
CommitLineData
85f76ac9 1all: youtube-dl README.md youtube-dl.1 youtube-dl.bash-completion LATEST_VERSION
85f76ac9 2# TODO: re-add youtube-dl.exe, and make sure it's 1. safe and 2. doesn't need sudo
4618f3da 3
85f76ac9
PH
4clean:
5 rm -f youtube-dl youtube-dl.exe youtube-dl.1 LATEST_VERSION
4618f3da 6
0e841bdc 7PREFIX=/usr/local
e79e8b7d
TM
8BINDIR=$(PREFIX)/bin
9MANDIR=$(PREFIX)/man
10SYSCONFDIR=/etc
11
dce10884 12install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
e79e8b7d
TM
13 install -d $(DESTDIR)$(BINDIR)
14 install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
15 install -d $(DESTDIR)$(MANDIR)/man1
16 install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
17 install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
18 install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
dce10884 19
a7b5c8d6
FV
20test:
21 nosetests2 --nocapture test
22
23.PHONY: all clean install test README.md youtube-dl.bash-completion
20326b8b 24# TODO un-phony README.md and youtube-dl.bash_completion by reading from .in files and generating from them
dce10884
FV
25
26youtube-dl: youtube_dl/*.py
20ba0426
FV
27 zip --quiet youtube-dl youtube_dl/*.py
28 zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
dce10884
FV
29 echo '#!/usr/bin/env python' > youtube-dl
30 cat youtube-dl.zip >> youtube-dl
31 rm youtube-dl.zip
85f76ac9 32 chmod a+x youtube-dl
dce10884
FV
33
34youtube-dl.exe: youtube_dl/*.py
35 bash devscripts/wine-py2exe.sh build_exe.py
4618f3da 36
646b885c 37README.md: youtube_dl/*.py
20326b8b 38 @options=$$(COLUMNS=80 python -m youtube_dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \
cfcec693 39 header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \
df4bad32 40 footer=$$(sed -e '1,/.*# CONFIGURATION/ d' README.md) && \
4618f3da 41 echo "$${header}" > README.md && \
66e87777 42 echo >> README.md && \
cfcec693 43 echo '# OPTIONS' >> README.md && \
4618f3da 44 echo "$${options}" >> README.md&& \
66e87777 45 echo >> README.md && \
df4bad32 46 echo '# CONFIGURATION' >> README.md && \
4618f3da
PH
47 echo "$${footer}" >> README.md
48
dce10884 49youtube-dl.1: README.md
cfcec693
FV
50 pandoc -s -w man README.md -o youtube-dl.1
51
dce10884 52youtube-dl.bash-completion: README.md
ce7b2a40
FV
53 @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \
54 content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \
55 echo "$${content}" > youtube-dl.bash-completion
4618f3da 56
646b885c 57LATEST_VERSION: youtube_dl/__init__.py
20326b8b 58 python -m youtube_dl --version > LATEST_VERSION