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