]> jfr.im git - yt-dlp.git/blame - Makefile
Re-engineered Dailymotion qualities selection (thanks @knagano, sort of merges #176)
[yt-dlp.git] / Makefile
CommitLineData
85f76ac9 1all: youtube-dl README.md youtube-dl.1 youtube-dl.bash-completion LATEST_VERSION
5fd5ce08 2
85f76ac9 3# TODO: re-add youtube-dl.exe, and make sure it's 1. safe and 2. doesn't need sudo
4618f3da 4
85f76ac9
PH
5clean:
6 rm -f youtube-dl youtube-dl.exe youtube-dl.1 LATEST_VERSION
4618f3da 7
0e841bdc 8PREFIX=/usr/local
dce10884 9install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
0e841bdc
FV
10 install -m 755 --owner root --group root youtube-dl $(PREFIX)/bin/
11 install -m 644 --owner root --group root youtube-dl.1 $(PREFIX)/man/man1
dce10884
FV
12 install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl
13
85f76ac9 14.PHONY: all clean install README.md youtube-dl.bash-completion
20326b8b 15# TODO un-phony README.md and youtube-dl.bash_completion by reading from .in files and generating from them
dce10884
FV
16
17youtube-dl: youtube_dl/*.py
18 zip --quiet --junk-paths youtube-dl youtube_dl/*.py
19 echo '#!/usr/bin/env python' > youtube-dl
20 cat youtube-dl.zip >> youtube-dl
21 rm youtube-dl.zip
85f76ac9 22 chmod a+x youtube-dl
dce10884
FV
23
24youtube-dl.exe: youtube_dl/*.py
25 bash devscripts/wine-py2exe.sh build_exe.py
4618f3da 26
20326b8b
PH
27README.md:
28 @options=$$(COLUMNS=80 python -m youtube_dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \
cfcec693
FV
29 header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \
30 footer=$$(sed -e '1,/.*# FAQ/ d' README.md) && \
4618f3da 31 echo "$${header}" > README.md && \
66e87777 32 echo >> README.md && \
cfcec693 33 echo '# OPTIONS' >> README.md && \
4618f3da 34 echo "$${options}" >> README.md&& \
66e87777 35 echo >> README.md && \
cfcec693 36 echo '# FAQ' >> README.md && \
4618f3da
PH
37 echo "$${footer}" >> README.md
38
dce10884 39youtube-dl.1: README.md
cfcec693
FV
40 pandoc -s -w man README.md -o youtube-dl.1
41
dce10884 42youtube-dl.bash-completion: README.md
ce7b2a40
FV
43 @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \
44 content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \
45 echo "$${content}" > youtube-dl.bash-completion
4618f3da 46
20326b8b
PH
47LATEST_VERSION:
48 python -m youtube_dl --version > LATEST_VERSION