aboutsummaryrefslogtreecommitdiff
blob: 9d2d0166f770df832f40fbbf07b21a79bba00870 (plain)
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
37
38
39
40
41
42
43
# Makefile for gentoo-syntax

PREFIX = ${HOME}/.vim/

files = $(wildcard \
	doc/* \
	ftdetect/* \
	ftplugin/* \
	indent/* \
	plugin/* \
	syntax/* \
	syntax_checkers/* \
)

scripts: ${files}

install: install-dirs install-files

install-dirs: $(foreach a, $(sort $(dir $(files))), \
	install-dir-$(a))

install-files: $(foreach a, $(sort $(files)), \
	install-file-$(subst /,_,$(a) ))

install-dir-%:
	mkdir -p "$(PREFIX)/$*"

install-file-%: $(subst _,/,$*)
	cp "$(subst _,/,$*)" "$(PREFIX)/$(subst _,/,$*)"

tag:
	git tag -s v$$(( $$(git tag -l --sort=-creatordate | sed -n -e 's:^v::p' | head -n 1) + 1 ))

uninstall : uninstall-files

uninstall-files: $(foreach a, $(sort $(files)), \
	uninstall-file-$(subst /,_,$(a) ))

uninstall-file-%: $(subst _,/,$*)
	[ ! -f "$(PREFIX)/$(subst _,/,$*)" ] || rm "$(PREFIX)/$(subst _,/,$*)"

clean:
	find . -name '*~' | xargs rm || true