aboutsummaryrefslogtreecommitdiffstats
path: root/pandoc/Makefile
blob: c40b967e4f547312b71843716619d5112a4c26b6 (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
.PHONY: all install uninstall

TMPLS := $(basename $(wildcard *.latex))

all:
	@echo Noting to do

# Install

ifdef XDG_DATA_HOME
DST = $(XDG_DATA_HOME)/pandoc/templates
else
DST = $(HOME)/.local/share/pandoc/templates
endif

install: $(addprefix $(DST)/, $(addsuffix .latex, $(TMPLS)))

$(DST)/%: %
	mkdir -p $(dir $@)
	cat < $< > $@

uninstall:
	rm -fr $(addprefix $(DST)/, $(addsuffix .latex, $(TMPLS)))
	rmdir --ignore-fail-on-non-empty -p $(DST)

# Test

test:
	make -C tests $@

# Clean

clean:
	make -C tests $@
	rm -f *~