Makefile revision 1.25
1#	$NetBSD: Makefile,v 1.25 2003/10/20 08:25:36 wiz Exp $
2
3MODULE=		groff
4
5ALL_TARGET=	src/include all
6MAKE_ARGS=	bindir=${TOOLDIR}/lib/groff MAKEINFO=${TOOL_MAKEINFO:Q} \
7		INSTALL_INFO=${TOOL_INSTALL_INFO:Q}
8
9TMACDIR=	${TOOLDIR}/share/groff/tmac
10SITETMACDIR=	${TOOLDIR}/share/groff/site-tmac
11
12# Add gnuwrap hack directly to the Makefile.
13_NOWRAPPER=1
14
15# Fixup build/Makefile.
16# XXX - the groff distribution Makefiles don't get their dependencies right.
17#	We use internal knowledge to specify additional target ordering.
18#	This can be removed once our own make(1) can be invoked in true
19#	sequential (i.e. compatible) mode again for subdir makes.
20#
21.configure_done: _post_conf
22_post_conf: .USE
23	@(echo '.include "${.CURDIR}/../Makefile.gnuwrap"'; \
24	  echo '.ORDER: $$(ALLDIRS) dot';\
25	  echo '.ORDER: all install' ) >> build/Makefile
26
27
28.include "${.CURDIR}/../Makefile.gnuhost"
29
30.PATH:		${.CURDIR}/../../share/tmac ${.CURDIR}/../../gnu/usr.bin/groff/tmac
31
32_installtmac: .USE
33.if ${MKUPDATE} != "no"
34	@if ! cmp ${.ALLSRC} ${.TARGET} >/dev/null 2>&1; then \
35		echo ${HOST_INSTALL_FILE:Q} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
36		${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
37	fi
38.else
39	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
40.endif
41
42#
43# Since ${TMACDIR} is created by the `realinstall' target, the `afterinstall'
44# sources below that depend on it must wait until `realinstall' is done.
45#
46#.for F in an andoc doc doc-ditroff doc-common doc-nroff doc-syms html html-end man man.local mdoc mdoc.local
47.for F in doc2html
48afterinstall:	${TMACDIR}/${F}.tmac
49.PHONY:		${TMACDIR}/${F}.tmac
50${TMACDIR}/${F}.tmac: ${F} _installtmac
51.ORDER: realinstall ${TMACDIR}/${F}.tmac
52.endfor
53.for F in man.local mdoc.local
54afterinstall:	${SITETMACDIR}/${F}
55.PHONY:		${SITETMACDIR}/${F}
56${SITETMACDIR}/${F}: ${F}-s _installtmac
57.ORDER: realinstall ${SITETMACDIR}/${F}
58${F}-s: ${F}
59	sed -f ${.CURDIR}/../../gnu/dist/groff/tmac/strip.sed ${.ALLSRC} > ${.TARGET}
60.endfor
61
62# The silly walk below is because sometimes the files begin with "g",
63# and sometimes not, depending on what the host tool has at build time.
64
65afterinstall: install.grofflinks
66.ORDER: realinstall install.grofflinks
67install.grofflinks:
68	@cd ${.CURDIR} && ${MAKE} install.grofflinks.recurse
69
70.for F in eqn groff indxbib nroff pic refer soelim tbl
71install.grofflinks.recurse: ${TOOLDIR}/bin/${_TOOL_PREFIX}${F}
72.if exists(${TOOLDIR}/lib/groff/g${F})
73${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/g${F}
74.else
75${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/${F}
76.endif
77	ln -f ${.ALLSRC} ${.TARGET}
78.endfor
79