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