aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/Books/src/Makefile
blob: 9d346cb2303df0ea0d9815314cfac8532045ceb6 (plain) (blame)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# ----------------------------------------------------
# Copyright (C) 1997, Ericsson Telecommunications
# Author: Lars Thorsen, Hans Nilsson
# ----------------------------------------------------
include $(ERL_TOP)/make/target.mk
include $(ERL_TOP)/make/$(TARGET)/otp.mk

# ----------------------------------------------------
# Include dependency
# ----------------------------------------------------

ifeq (ug.dep,$(wildcard ug.dep))
include ug.dep
include database_management.dep
include orber_ic.dep
include basic_application.dep
include tools.dep
include operation_maintenance.dep
include interfaces.dep
include stdlib.dep
include corba_service.dep
endif

# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
BOOKS = \
	ug \
	database_management \
	orber_ic \
	corba_service \
	basic_application \
	tools \
	operation_maintenance \
	interfaces \
	stdlib

TEX_FILES = $(shell for i in $(BOOKS) ; do (echo $$i.tex); done)

FRAME_CROP_PDF_FILES = $(BOOKS:%=%.frame.pdf) $(BOOKS:%=%.crop.pdf)

# ----------------------------------------------------
# FLAGS 
# ----------------------------------------------------
XML_FLAG_booksty = -booksty otpBOOK
DVIPS_FLAGS += -O '19mm,32.5mm'

# ----------------------------------------------------
# Targets
# ----------------------------------------------------

all:	$(FRAME_CROP_PDF_FILES)

books:	all

clean:
	rm -f $(TEX_FILES)
	rm -f *.psframe *.pscrop *.ps
	rm -f $(TOP_PS_FILES)
	rm -f errs core *~ $(LATEX_CLEAN)
	rm -f *.dep *.pdf

dep depend:
	@for i in $(BOOKS); do \
		echo "Running docdepend for $$i ..." ; \
		docdepend $$i.xml | \
		sed s/insidecover.tex/insidecover.xml/ > $$i.dep ; \
	done

# ----------------------------------------------------
# Rules
# ----------------------------------------------------
.SUFFIXES: .psframe .pscrop

# The following rules are for multiple suffixes, e.g. kalle.pdf, 
# kalle.frame.pdf. The order of the rules is important. Default rules
# from otp.mk are disabled in order to get it right.

%.pdf:	%.ps

%.ps:	%.dvi

%.pdf:	%.dvi

%.frame.ps:	%.dvi
	BOOK=$@ ./make_headers
	$(DVI2PS) -frame $(DVIPS_FLAGS) -f $< > $@

%.frame.pdf:	%.dvi
	BOOK=$@ ./make_headers
	$(DVI2PS) -frame $(DVIPS_FLAGS) -f $< | \
		$(DISTILL) $(DISTILL_FLAGS) > $@

%.crop.ps:	%.dvi
	BOOK=$@ ./make_headers
	$(DVI2PS) -crop $(DVIPS_FLAGS) -f $< > $@

%.crop.pdf:	%.dvi
	BOOK=$@ ./make_headers
	$(DVI2PS) -crop $(DVIPS_FLAGS) -f $< | \
		$(DISTILL) $(DISTILL_FLAGS) > $@

%.pdf:	%.dvi
	$(DVI2PS) $(DVIPS_FLAGS) -f $< | \
		$(DISTILL) $(DISTILL_FLAGS) > $@

%.ps:  %.dvi
	$(DVI2PS) $(DVIPS_FLAGS) -f $< > $@

%.pdf: %.dvi
	$(DVI2PS) $(DVIPS_FLAGS) -f $< | \
		$(DISTILL) $(DISTILL_FLAGS) > $@

# ----------------------------------------------------
# Release targets
# ----------------------------------------------------
#

ifeq ($(TESTROOT),)
release_books:	all

else
release_books:	all
	$(INSTALL_DIR) $(TESTROOT)/books
	$(INSTALL_DATA) $(FRAME_CROP_PDF_FILES) $(TESTROOT)/books
endif