1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00
svtplay-dl/lib/Makefile

45 lines
1.1 KiB
Makefile
Raw Normal View History

2014-12-26 02:11:19 +01:00
PYLINT_OPTS = --report=no -d I -d C -d R -d W0511
2013-03-23 16:30:19 +01:00
all: svtplay-dl
clean:
2013-08-10 20:50:52 +02:00
find . -name '*.pyc' -exec rm {} \;
2013-03-23 16:30:19 +01:00
rm -f svtplay-dl
2014-12-26 02:11:19 +01:00
pylint:
pylint $(PYLINT_OPTS) svtplay_dl
export PACKAGES = svtplay_dl \
svtplay_dl.fetcher \
svtplay_dl.utils \
svtplay_dl.service \
svtplay_dl.subtitle
export PYFILES = $(sort $(addsuffix /*.py,$(subst .,/,$(PACKAGES))))
2014-02-02 15:10:17 +01:00
PYTHON ?= /usr/bin/env python
2013-03-23 16:30:19 +01:00
svtplay-dl: $(PYFILES)
@# Verify that there's no .build already \
! [ -d .build ] || { \
echo "ERROR: build already in progress? (or remove $(PWD)/.build/)"; \
exit 1; \
}; \
mkdir -p .build
@# Stage the files in .build for postprocessing
for py in $(PYFILES); do \
install -d ".build/$${py%/*}"; \
install $$py .build/$$py; \
done
@# reset timestamps, to avoid non-determinism in zip file
find .build/ -exec touch -m -t 198001010000 {} \;
(cd .build && zip -X --quiet svtplay-dl $(PYFILES))
(cd .build && zip -X --quiet --junk-paths svtplay-dl svtplay_dl/__main__.py)
2013-03-23 16:30:19 +01:00
echo '#!$(PYTHON)' > svtplay-dl
cat .build/svtplay-dl.zip >> svtplay-dl
rm -rf .build
2013-03-23 16:30:19 +01:00
chmod a+x svtplay-dl