1# $NetBSD: Makefile,v 1.14 2002/02/19 12:13:10 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.for F in andoc doc doc-ditroff doc-common doc-nroff doc-syms doc2html 42afterinstall: ${TMACDIR}/tmac.${F} 43.PHONY: ${TMACDIR}/tmac.${F} 44${TMACDIR}/tmac.${F}: ${F} _installtmac 45.endfor 46 47afterinstall: ${TMACDIR}/tmac.an.old 48${TMACDIR}/tmac.an.old: ${DIST}/tmac/tmac.an _installtmac 49 50afterinstall: ${TMACDIR}/tmac.an 51${TMACDIR}/tmac.an: ${TMACDIR}/tmac.andoc _installtmac 52 53# The silly walk below is because sometimes the files begin with "g", 54# and sometimes not, depending on what the host tool has at build time. 55 56afterinstall: install.grofflinks 57install.grofflinks: 58 @cd ${.CURDIR} && ${MAKE} install.grofflinks.recurse 59 60.for F in eqn groff indxbib pic refer soelim tbl 61install.grofflinks.recurse: ${TOOLDIR}/bin/nb${F} 62.if exists(${TOOLDIR}/lib/groff/g${F}) 63${TOOLDIR}/bin/nb${F}: ${TOOLDIR}/lib/groff/g${F} 64.else 65${TOOLDIR}/bin/nb${F}: ${TOOLDIR}/lib/groff/${F} 66.endif 67 ln -f ${.ALLSRC} ${.TARGET} 68.endfor 69 70