1 all: compile exe readme man-page bash-completion update-latest
4 ./youtube-dl --version > LATEST_VERSION
7 @options=$$(COLUMNS=80 ./youtube-dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \
8 header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \
9 footer=$$(sed -e '1,/.*# FAQ/ d' README.md) && \
10 echo "$${header}" > README.md && \
11 echo >> README.md && \
12 echo '# OPTIONS' >> README.md && \
13 echo "$${options}" >> README.md&& \
14 echo >> README.md && \
15 echo '# FAQ' >> README.md && \
16 echo "$${footer}" >> README.md
19 pandoc -s -w man README.md -o youtube-dl.1
22 @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \
23 content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion` && \
24 echo "$${content}" > youtube-dl.bash-completion
27 zip --quiet --junk-paths youtube-dl youtube_dl/*.py
28 echo '#!/usr/bin/env python' > youtube-dl
29 cat youtube-dl.zip >> youtube-dl
33 bash devscripts/wine-py2exe.sh build_exe.py
36 install -m 755 --owner root --group root youtube-dl /usr/local/bin/
37 install -m 644 --owner root --group root youtube-dl.1 /usr/local/man/man1
38 install -m 644 --owner root --group root youtube-dl.bash-completion /etc/bash_completion.d/youtube-dl
40 .PHONY: all update-latest readme man-page bash-completion compile exe install