]> jfr.im git - yt-dlp.git/blame_incremental - Makefile
and now, also py2exe compiles fine :) (on Windows)
[yt-dlp.git] / Makefile
... / ...
CommitLineData
1all: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion
2
3clean:
4 rm -rf youtube-dl youtube-dl.exe youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/
5
6PREFIX=/usr/local
7BINDIR=$(PREFIX)/bin
8MANDIR=$(PREFIX)/man
9SYSCONFDIR=/etc
10
11install: youtube-dl youtube-dl.1 youtube-dl.bash-completion
12 install -d $(DESTDIR)$(BINDIR)
13 install -m 755 youtube-dl $(DESTDIR)$(BINDIR)
14 install -d $(DESTDIR)$(MANDIR)/man1
15 install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1
16 install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
17 install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl
18
19test:
20 nosetests2 --nocapture test
21
22.PHONY: all clean install test
23
24youtube-dl: youtube_dl/*.py
25 zip --quiet youtube-dl youtube_dl/*.py
26 zip --quiet --junk-paths youtube-dl youtube_dl/__main__.py
27 echo '#!/usr/bin/env python' > youtube-dl
28 cat youtube-dl.zip >> youtube-dl
29 rm youtube-dl.zip
30 chmod a+x youtube-dl
31
32README.md: youtube_dl/*.py
33 @options=$$(COLUMNS=80 python -m youtube_dl --help | sed -e '1,/.*General Options.*/ d' -e 's/^\W\{2\}\(\w\)/## \1/') && \
34 header=$$(sed -e '/.*# OPTIONS/,$$ d' README.md) && \
35 footer=$$(sed -e '1,/.*# CONFIGURATION/ d' README.md) && \
36 echo "$${header}" > README.md && \
37 echo >> README.md && \
38 echo '# OPTIONS' >> README.md && \
39 echo "$${options}" >> README.md&& \
40 echo >> README.md && \
41 echo '# CONFIGURATION' >> README.md && \
42 echo "$${footer}" >> README.md
43
44README.txt: README.md
45 pandoc -s -f markdown -t plain README.md -o README.txt
46
47youtube-dl.1: README.md
48 pandoc -s -f markdown -t man README.md -o youtube-dl.1
49
50youtube-dl.bash-completion: README.md youtube-dl.bash-completion.in
51 @options=`egrep -o '(--[a-z-]+) ' README.md | sort -u | xargs echo` && \
52 content=`sed "s/opts=\"[^\"]*\"/opts=\"$${options}\"/g" youtube-dl.bash-completion.in` && \
53 echo "$${content}" > youtube-dl.bash-completion