-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
36 lines (29 loc) · 905 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PROJECT := mpvacious
PREFIX ?= /etc/mpv/
BRANCH ?= remotes/origin/master
VERSION := $(shell git describe --tags $(BRANCH))
RELEASE_DIR := .github/RELEASE
ZIP := $(RELEASE_DIR)/$(PROJECT)_$(VERSION).zip
DOCS := $(RELEASE_DIR)/README_$(VERSION).html
MD2HTML = md2html --github --full-html
.PHONY: all clean docs install uninstall
all: $(ZIP)
docs: $(DOCS)
$(ZIP):
git archive \
--prefix=$(PROJECT)_$(VERSION)/ \
--format=zip \
-o $@ \
$(BRANCH) \
$(DOCS):
git show "$(BRANCH):README.md" | $(MD2HTML) -o $@
install:
find . -type f -iname '*.lua' | while read -r file; do \
install -Dm644 "$$file" "$(PREFIX)/scripts/$(PROJECT)/$$file"; \
done
install -Dm644 $(RELEASE_DIR)/subs2srs.conf "$(PREFIX)/script-opts/subs2srs.conf"
uninstall:
rm -rf -- "$(PREFIX)/scripts/$(PROJECT)"
rm -- "$(PREFIX)/script-opts/subs2srs.conf"
clean:
rm -- $(ZIP) $(DOCS)