Makefile.inc revision 1.15 1 # $NetBSD: Makefile.inc,v 1.15 2000/11/26 02:50:12 matt Exp $
2 #
3
4 # Ross Harvey <ross@netbsd.org>
5
6 .include <bsd.obj.mk> # So we get /etc/mk.conf vars.
7
8 M?= ${.CURDIR:T}
9 V!= /bin/sh ${.CURDIR}/../../../sys/conf/osrelease.sh
10 V_S!= /bin/sh ${.CURDIR}/../../../sys/conf/osrelease.sh -s
11
12 MAIN= ${.CURDIR}/../common/main ${.CURDIR}/../common/macros ${EXTRA}
13 TARG= INSTALL
14 TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more
15 SRCS= ${MAIN} whatis contents hardware xfer prep install\
16 upgrade donations legal.common legal postinstall ../Makefile.inc\
17 ${MERGED_SRCS}
18 ICMD= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} \
19 -o root -g wheel -m ${NONBINMODE}
20
21 .if defined(DESTDIR)
22 PRESET= ${GFLAGS} -dM=${M} -dV=${V} -d.CURDIR=${.CURDIR} -r${M}=1 -M${DESTDIR}/usr/share/tmac
23 .else
24 PRESET= ${GFLAGS} -dM=${M} -dV=${V} -d.CURDIR=${.CURDIR} -r${M}=1
25 .endif
26
27 POST_PLAIN= -P-b -P-u -P-o
28
29 ARGS_PS= ${PRESET} -dformat=PostScript
30 ARGS_TXT= ${PRESET} -dformat=ASCII ${POST_PLAIN} -Tascii -mtty-char
31 ARGS_HTML= ${PRESET} -dformat=HTML ${POST_PLAIN} -Tlatin1 -ww
32 ARGS_MORE= ${PRESET} -dformat=more -P-h -Tascii -mtty-char
33
34 #
35 # For example...
36 #
37 # .if ri386 ...stuff...
38 # .Ss "Install notes for NetBSD/\*[MACHINE]"
39 #
40
41 CLEANFILES+=${TARGS}
42
43 .for i in ps txt html more
44 all: ${TARG}.$i
45 .endfor
46
47 ${TARG}.ps: ${SRCS}
48 groff ${ARGS_PS} -mdoc ${MAIN} > $@
49
50 ${TARG}.pdf: ${TARG}.ps
51 ps2pdf ${TARG}.ps $@
52
53 ${TARG}.txt: ${SRCS}
54 groff ${ARGS_TXT} -mdoc ${MAIN} > $@
55
56 ${TARG}.html: ${SRCS}
57 groff ${ARGS_HTML} -mdoc2html ${MAIN} > $@
58
59 ${TARG}.more: ${SRCS}
60 groff ${ARGS_MORE} -mdoc ${MAIN} > $@
61
62 echosrcs! ${SRCS}
63 @echo ${.ALLSRC}
64
65 echomore!
66 @echo ${.OBJDIR}/${TARG}.more
67
68 .ifndef RELEASEDIR
69 release:
70 @echo setenv RELEASEDIR first
71 @false
72 .else
73 release:
74 .for i in ${TARGS}
75 ${ICMD} ${i} ${RELEASEDIR}/.
76 .endfor
77 .endif
78
79 .PATH: ${.CURDIR}/../common
80
81 # make the "afterdepend" rule happy
82 .depend:
83 @touch $@
84