Makefile revision 1.30
11.30Sapb#	$NetBSD: Makefile,v 1.30 2012/12/02 12:48:32 apb Exp $
21.1Stv
31.1StvMODULE=		groff
41.1Stv
51.1StvALL_TARGET=	src/include all
61.24SlukemMAKE_ARGS=	bindir=${TOOLDIR}/lib/groff MAKEINFO=${TOOL_MAKEINFO:Q} \
71.24Slukem		INSTALL_INFO=${TOOL_INSTALL_INFO:Q}
81.28Stron# we don't need any of the X applications
91.28StronCONFIGURE_ARGS+=	--without-x
101.6Sjmc
111.6SjmcTMACDIR=	${TOOLDIR}/share/groff/tmac
121.19SwizSITETMACDIR=	${TOOLDIR}/share/groff/site-tmac
131.2Stv
141.2Stv# Add gnuwrap hack directly to the Makefile.
151.2Stv_NOWRAPPER=1
161.14Spk
171.14Spk# Fixup build/Makefile.
181.14Spk# XXX - the groff distribution Makefiles don't get their dependencies right.
191.14Spk#	We use internal knowledge to specify additional target ordering.
201.14Spk#	This can be removed once our own make(1) can be invoked in true
211.14Spk#	sequential (i.e. compatible) mode again for subdir makes.
221.14Spk#
231.21Smartin.configure_done: _post_conf
241.21Smartin_post_conf: .USE
251.21Smartin	@(echo '.include "${.CURDIR}/../Makefile.gnuwrap"'; \
261.21Smartin	  echo '.ORDER: $$(ALLDIRS) dot';\
271.21Smartin	  echo '.ORDER: all install' ) >> build/Makefile
281.14Spk
291.1Stv
301.27Sross
311.1Stv.include "${.CURDIR}/../Makefile.gnuhost"
321.30Sapb.-include "${TOOLDIR}/share/compat/defs.mk"
331.1Stv
341.30Sapb.PATH:	${.CURDIR}/../../share/tmac ${.CURDIR}/../../gnu/usr.bin/groff/tmac
351.1Stv
361.9Stv_installtmac: .USE
371.23Slukem.if ${MKUPDATE} != "no"
381.9Stv	@if ! cmp ${.ALLSRC} ${.TARGET} >/dev/null 2>&1; then \
391.9Stv		echo ${HOST_INSTALL_FILE:Q} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
401.9Stv		${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
411.1Stv	fi
421.1Stv.else
431.9Stv	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
441.1Stv.endif
451.9Stv
461.15Spk#
471.15Spk# Since ${TMACDIR} is created by the `realinstall' target, the `afterinstall'
481.15Spk# sources below that depend on it must wait until `realinstall' is done.
491.15Spk#
501.19Swiz#.for F in an andoc doc doc-ditroff doc-common doc-nroff doc-syms html html-end man man.local mdoc mdoc.local
511.19Swiz.for F in doc2html
521.19Swizafterinstall:	${TMACDIR}/${F}.tmac
531.19Swiz.PHONY:		${TMACDIR}/${F}.tmac
541.19Swiz${TMACDIR}/${F}.tmac: ${F} _installtmac
551.19Swiz.ORDER: realinstall ${TMACDIR}/${F}.tmac
561.19Swiz.endfor
571.19Swiz.for F in man.local mdoc.local
581.19Swizafterinstall:	${SITETMACDIR}/${F}
591.19Swiz.PHONY:		${SITETMACDIR}/${F}
601.25Swiz${SITETMACDIR}/${F}: ${F}-s _installtmac
611.19Swiz.ORDER: realinstall ${SITETMACDIR}/${F}
621.26SlukemCLEANFILES+=${F}-s
631.25Swiz${F}-s: ${F}
641.29Sapb	${TOOL_SED} -f ${.CURDIR}/../../gnu/dist/groff/tmac/strip.sed \
651.29Sapb		${.ALLSRC} > ${.TARGET}
661.1Stv.endfor
671.4Stv
681.12Stv# The silly walk below is because sometimes the files begin with "g",
691.12Stv# and sometimes not, depending on what the host tool has at build time.
701.12Stv
711.12Stvafterinstall: install.grofflinks
721.15Spk.ORDER: realinstall install.grofflinks
731.12Stvinstall.grofflinks:
741.13Stv	@cd ${.CURDIR} && ${MAKE} install.grofflinks.recurse
751.13Stv
761.27Sross.for F in eqn groff indxbib pic refer soelim tbl
771.27Srossinstall.grofflinks.recurse: ${TOOLDIR}/bin/${_TOOL_PREFIX}${F}${HOSTEXEEXT}
781.27Sross.if exists(${TOOLDIR}/lib/groff/g${F}${HOSTEXEEXT})
791.27Sross${TOOLDIR}/bin/${_TOOL_PREFIX}${F}${HOSTEXEEXT}: ${TOOLDIR}/lib/groff/g${F}${HOSTEXEEXT}
801.27Sross.else
811.27Sross${TOOLDIR}/bin/${_TOOL_PREFIX}${F}${HOSTEXEEXT}: ${TOOLDIR}/lib/groff/${F}${HOSTEXEEXT}
821.27Sross.endif
831.27Sross	ln -f ${.ALLSRC} ${.TARGET}
841.27Sross.endfor
851.27Sross
861.27Sross.for F in nroff
871.16Sthorpejinstall.grofflinks.recurse: ${TOOLDIR}/bin/${_TOOL_PREFIX}${F}
881.12Stv.if exists(${TOOLDIR}/lib/groff/g${F})
891.16Sthorpej${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/g${F}
901.12Stv.else
911.16Sthorpej${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/${F}
921.12Stv.endif
931.4Stv	ln -f ${.ALLSRC} ${.TARGET}
941.4Stv.endfor
95