-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 841 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
37
38
39
40
41
42
DESTDIR =
PREFIX = /usr
LIBDIR = $(DESTDIR)$(PREFIX)/lib
MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1
DOCDIR = $(DESTDIR)$(PREFIX)/share/doc
all: man
.PHONY: clean
lib = log4sh
libs = $(addprefix doc/, $(lib))
%.1: %.pod
pod2man $< > $@
%.txt: %.pod
pod2text $< > $@
%.wiki: %.pod
pod2wiki --style markdown $< > $@
# generate doc/$lib.{txt,1,wiki}
doc: $(addsuffix .txt, $(addprefix doc/, $(lib) ) )
man: $(addsuffix .1, $(addprefix doc/, $(lib) ) )
wiki: $(addsuffix .wiki, $(addprefix doc/, $(lib)))
install: all
$(foreach _lib,$(lib), \
install -Dm644 doc/$(_lib).txt $(DOCDIR)/$(_lib).txt; \
install -Dm644 doc/$(_lib).1 $(MANDIR)/$(_lib).1; \
install -Dm644 $(_lib).sh $(LIBDIR)/$(_lib).sh; \
)
clean:
$(foreach _lib,$(lib), \
$(RM) doc/$(_lib).1; \
$(RM) doc/$(_lib).txt; \
$(RM) doc/$(_lib).wiki; \
)