File: Makefile

package info (click to toggle)
criu 3.11-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 8,004 kB
  • sloc: ansic: 106,666; python: 5,295; sh: 2,679; makefile: 1,949; asm: 1,108; perl: 103; exp: 45; java: 16
file content (86 lines) | stat: -rw-r--r-- 2,295 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
__nmk_dir ?= ../scripts/nmk/scripts/
include $(__nmk_dir)include.mk
include $(__nmk_dir)macro.mk

ASCIIDOC	:= asciidoc
A2X		:= a2x
XMLTO		:= xmlto

FOOTER		:= footer.txt
SRC1		+= crit.txt
SRC8		+= criu.txt
SRC		:= $(SRC1) $(SRC8)
XMLS		:= $(patsubst %.txt,%.xml,$(SRC))
MAN1S		:= $(patsubst %.txt,%.1,$(SRC1))
MAN8S		:= $(patsubst %.txt,%.8,$(SRC8))
MANS		:= $(MAN1S) $(MAN8S)
MAN1DIR		:= $(MANDIR)/man1
MAN8DIR		:= $(MANDIR)/man8

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		:= $(patsubst %,%.ps,$(basename $(MANS)))
PDFS		:= $(patsubst %,%.pdf,$(basename $(MANS)))

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

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

ifeq ($(CRIU_VERSION),)
 include ../Makefile.versions
endif
$(FOOTER): ../Makefile.versions
	$(call msg-gen, $@)
	$(Q) echo ":doctype:       manpage"		>  $@
	$(Q) echo ":man source:    criu"		>> $@
	$(Q) echo ":man version:   $(CRIU_VERSION)"	>> $@
	$(Q) echo ":man manual:    CRIU Manual"		>> $@

%.1: %.txt $(FOOTER) custom.xsl
	$(call msg-gen, $@)
	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $<
	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null

%.8: %.txt $(FOOTER) custom.xsl
	$(call msg-gen, $@)
	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null

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

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

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

clean:
	$(call msg-clean, "Documentation")
	$(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS) $(FOOTER)

install: check $(MANS)
	$(E) "  INSTALL " $(MAN8S)
	$(Q) mkdir -p $(DESTDIR)$(MAN8DIR)
	$(Q) install -m 644 $(MAN8S) $(DESTDIR)$(MAN8DIR)
	$(E) "  INSTALL " $(MAN1S)
	$(Q) mkdir -p $(DESTDIR)$(MAN1DIR)
	$(Q) install -m 644 $(MAN1S) $(DESTDIR)$(MAN1DIR)

uninstall:
	$(E) " UNINSTALL" $(MAN1S)
	$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN1DIR)/,$(MAN1S))
	$(E) " UNINSTALL" $(MAN8S)
	$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN8DIR)/,$(MAN8S))

.PHONY: clean install uninstall