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