File: Makefile

package info (click to toggle)
libcidr 1.2.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 956 kB
  • sloc: ansic: 2,800; perl: 333; makefile: 262; sh: 90; awk: 9
file content (138 lines) | stat: -rw-r--r-- 3,612 bytes parent folder | download
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
128
129
130
131
132
133
134
135
136
137
138
# Makefile for libcidr docs
#
# Derived from libpostal-docs Makefile
# $Libpostal: Makefile,v 1.9 2003/07/16 15:32:11 fullermd Exp $
#
# TARGETS:
# Only the following targets are useful for manual invocation
# - main: Build the docs and install finished outputs in the docs/
#         directory
# - minimal: Build ONLY HTML and TXT verions
# - validate: Validate the libpostal.sgml file against the DTD
# - clean: Clean out the build directory
# - allclean: Clean out the build and output directories

# Files and paths
RTPATH ?= ${PWD}
INSTALLMODE ?= 644

FNAME = libcidr
INFILE = ${RTPATH}/${FNAME}.sgml
INFILES = ${RTPATH}/inc/geninfo.sgml ${RTPATH}/inc/datastructs.sgml \
		${RTPATH}/inc/functions.sgml

CODELIBDIR = ${RTPATH}/codelibrary
PRINTSS = ${CODELIBDIR}/dsssl/print.dsl
HTMLSS = ${CODELIBDIR}/dsssl/html-onepage.dsl

OUTDIR = ${RTPATH}/..
BUILDDIR = ${RTPATH}/.build

# Args
TIDYARGS = -i -raw -quiet -wrap 75
NSGMLS ?= onsgmls
JADE ?= openjade
JADECATDIR ?= /usr/local/share/sgml/openjade/catalog
JADECAT = -c ${JADECATDIR}
CODELIBCAT = -c ${RTPATH}/codelibrary/catalog
JADESTD = ${JADECAT} ${CODELIBCAT}

# All our files
ALLFILES = ${FNAME}.ps ${FNAME}.pdf ${FNAME}.dvi ${FNAME}-big.html \
		${FNAME}.txt ${FNAME}.rtf
MINFILES = ${FNAME}-big.html ${FNAME}.txt

# The main user-invokable 
minimal: build-minimal install-minimal
main: build-docs install-docs
all: main

clean:
	rm -rf ${BUILDDIR}

allclean: clean
	rm -f ${OUTDIR}/${FNAME}* ${OUTDIR}/codelibrary-html.css

validate:
	${NSGMLS} ${CODELIBCAT} -s ${INFILE}

build-docs: ${BUILDDIR}
	cd ${BUILDDIR} && \
		${MAKE} -f ${RTPATH}/Makefile RTPATH=${RTPATH} build-all

install-docs: ${BUILDDIR}
	cd ${BUILDDIR} && \
		${MAKE} -f ${RTPATH}/Makefile RTPATH=${RTPATH} install-all

build-minimal: ${BUILDDIR}
	cd ${BUILDDIR} && \
		${MAKE} -f ${RTPATH}/Makefile RTPATH=${RTPATH} do-build-minimal

install-minimal: ${BUILDDIR}
	cd ${BUILDDIR} && \
		${MAKE} -f ${RTPATH}/Makefile RTPATH=${RTPATH} do-install-minimal

# Don't forget the .css for the HTML file too
install-all:
	mkdir -p ${OUTDIR}
	install -c -m ${INSTALLMODE} ${ALLFILES} ${OUTDIR}
	install -c -m ${INSTALLMODE} ${CODELIBDIR}/css/codelibrary-html.css \
			${OUTDIR}
	@echo %%%%% Install done %%%%%

do-install-minimal:
	mkdir -p ${OUTDIR}
	install -c -m ${INSTALLMODE} ${MINFILES} ${OUTDIR}
	install -c -m ${INSTALLMODE} ${CODELIBDIR}/css/codelibrary-html.css \
			${OUTDIR}
	@echo %%%%% Install done %%%%%
	
# Everything
build-all all-formats: tex ps pdf dvi html txt rtf
do-build-minimal: html txt

# Aliases
ps: ${FNAME}.ps
pdf: ${FNAME}.pdf
dvi: ${FNAME}.dvi
tex: ${FNAME}.tex
txt: ${FNAME}.txt
ascii: ${FNAME}.txt
html: ${FNAME}-big.html
rtf: ${FNAME}.rtf

${FNAME}.ps: dvi
	dvips -o ${FNAME}.ps ${FNAME}.dvi
	@echo %%%%% Postscript built %%%%%

${FNAME}.pdf: tex
	pdftex "&pdfjadetex" ${FNAME}.tex
	@echo %%%%% PDF built %%%%%

${FNAME}.dvi: tex
	jadetex ${FNAME}.tex
	@echo %%%%% DVI built %%%%%

${FNAME}.tex: ${INFILE} ${INFILES}
	${JADE} ${JADESTD} -d ${PRINTSS} -t tex -o ${@} ${INFILE}
	@echo %%%%% TeX built %%%%%

${FNAME}.rtf: ${INFILE} ${INFILES}
	${JADE} ${JADESTD} -d ${PRINTSS} -t rtf -o ${@} ${INFILE}
	@echo %%%%% RTF built %%%%%

${FNAME}.txt: html
	lynx -dump -nolist ${FNAME}-big.html > ${FNAME}.txt
	@echo %%%%% ASCII built %%%%%

${FNAME}-big.html: ${INFILE} ${INFILES}
	${JADE} ${JADESTD} -d ${HTMLSS} -t sgml ${INFILE} > ${FNAME}-big-notidy.html
.ifndef NOTIDY
	tidy ${TIDYARGS} < ${FNAME}-big-notidy.html > ${FNAME}-big.html
.else
	cp ${FNAME}-big-notidy.html ${FNAME}-big.html
.endif
	@echo %%%%% HTML built %%%%%

${BUILDDIR}:
	mkdir -p ${BUILDDIR}