Makefile revision 1.26
1#	$NetBSD: Makefile,v 1.26 2003/10/28 07:46:16 lukem 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}
58CLEANFILES+=${F}-s
59${F}-s: ${F}
60	sed -f ${.CURDIR}/../../gnu/dist/groff/tmac/strip.sed ${.ALLSRC} > ${.TARGET}
61.endfor
62
63# The silly walk below is because sometimes the files begin with "g",
64# and sometimes not, depending on what the host tool has at build time.
65
66afterinstall: install.grofflinks
67.ORDER: realinstall install.grofflinks
68install.grofflinks:
69	@cd ${.CURDIR} && ${MAKE} install.grofflinks.recurse
70
71.for F in eqn groff indxbib nroff pic refer soelim tbl
72install.grofflinks.recurse: ${TOOLDIR}/bin/${_TOOL_PREFIX}${F}
73.if exists(${TOOLDIR}/lib/groff/g${F})
74${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/g${F}
75.else
76${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/${F}
77.endif
78	ln -f ${.ALLSRC} ${.TARGET}
79.endfor
80