File: Makefile

package info (click to toggle)
criu 4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,500 kB
  • sloc: ansic: 139,280; python: 7,484; sh: 3,824; java: 2,799; makefile: 2,659; asm: 1,137; perl: 206; xml: 117; exp: 45
file content (50 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
ifneq ($(USE_ASCIIDOCTOR),)
ASCIIDOC       := asciidoctor
XMLTO          :=
else
ASCIIDOC	:= asciidoc
XMLTO		:= xmlto
endif
PS2PDF		:= ps2pdf

SRC		+= nmk.txt
XMLS		:= $(patsubst %.txt,%.xml,$(SRC))
MANS		:= $(patsubst %.txt,%.8,$(SRC))

GROFF		:= groff
PAPER		:= $(shell paperconf 2>/dev/null || echo letter)
GROFF_OPTS	:= -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) -man -msafer -rC1 -rD1 -rS11
PSS		:= $(MANS:%.8=%.ps)
PDFS		:= $(MANS:%.8=%.pdf)

ps: $(PSS)
pdf: $(PDFS)
all: check $(MANS)

.PHONY: all ps pdf check clean

check:
	$(Q) for B in $(ASCIIDOC) $(XMLTO); do	\
		$$B --version > /dev/null || exit 1;	\
	done

%.8: %.txt
	$(call msg-gen, $@)
ifneq ($(USE_ASCIIDOCTOR),)
	$(Q) $(ASCIIDOC) -b manpage -d manpage -o $@ $<
else
	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
	$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
endif

%.ps: %.8
	$(call msg-gen, $@)
	$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@

%.pdf: %.ps
	$(call msg-gen, $@)
	$(Q) $(PS2PDF) $< $@

clean:
	$(call msg-clean, "docs")
	$(Q) $(RM) $(XMLS) $(MANS) $(PSS) $(PDFS)