Makefile revision 1.17
11.17Slukem#	$NetBSD: Makefile,v 1.17 2003/02/07 01:52:53 lukem Exp $
21.1Stv
31.1StvMODULE=		groff
41.1Stv
51.1StvALL_TARGET=	src/include all
61.11StvMAKE_ARGS=	bindir=${TOOLDIR}/lib/groff
71.6Sjmc
81.6SjmcTMACDIR=	${TOOLDIR}/share/groff/tmac
91.2Stv
101.2Stv# Add gnuwrap hack directly to the Makefile.
111.2Stv_NOWRAPPER=1
121.14Spk
131.14Spk#
141.14Spk# Fixup build/Makefile.
151.14Spk# XXX - the groff distribution Makefiles don't get their dependencies right.
161.14Spk#	We use internal knowledge to specify additional target ordering.
171.14Spk#	This can be removed once our own make(1) can be invoked in true
181.14Spk#	sequential (i.e. compatible) mode again for subdir makes.
191.14Spk#
201.14Spk.configure_done: _post_conf
211.14Spk_post_conf: .USE
221.14Spk	@(echo '.include "${.CURDIR}/../Makefile.gnuwrap"'; \
231.14Spk	  echo '.ORDER: $$(ALLDIRS) dot';\
241.14Spk	  echo '.ORDER: all install' ) >> build/Makefile
251.14Spk
261.1Stv
271.1Stv.include "${.CURDIR}/../Makefile.gnuhost"
281.1Stv
291.1Stv.PATH:		${.CURDIR}/../../share/tmac
301.1Stv
311.9Stv_installtmac: .USE
321.1Stv.if defined(UPDATE)
331.9Stv	@if ! cmp ${.ALLSRC} ${.TARGET} >/dev/null 2>&1; then \
341.9Stv		echo ${HOST_INSTALL_FILE:Q} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
351.9Stv		${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}; \
361.1Stv	fi
371.1Stv.else
381.9Stv	${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}
391.1Stv.endif
401.9Stv
411.15Spk#
421.15Spk# Since ${TMACDIR} is created by the `realinstall' target, the `afterinstall'
431.15Spk# sources below that depend on it must wait until `realinstall' is done.
441.15Spk#
451.9Stv.for F in andoc doc doc-ditroff doc-common doc-nroff doc-syms doc2html
461.9Stvafterinstall:	${TMACDIR}/tmac.${F}
471.9Stv.PHONY:		${TMACDIR}/tmac.${F}
481.9Stv${TMACDIR}/tmac.${F}: ${F} _installtmac
491.15Spk.ORDER: realinstall ${TMACDIR}/tmac.${F}
501.1Stv.endfor
511.1Stv
521.8Sjmcafterinstall: ${TMACDIR}/tmac.an.old
531.17Slukem${TMACDIR}/tmac.an.old: ${GNUHOSTDIST}/tmac/tmac.an _installtmac
541.15Spk.ORDER: realinstall ${TMACDIR}/tmac.an.old
551.8Sjmc
561.1Stvafterinstall: ${TMACDIR}/tmac.an
571.9Stv${TMACDIR}/tmac.an: ${TMACDIR}/tmac.andoc _installtmac
581.15Spk.ORDER: realinstall ${TMACDIR}/tmac.an
591.4Stv
601.12Stv# The silly walk below is because sometimes the files begin with "g",
611.12Stv# and sometimes not, depending on what the host tool has at build time.
621.12Stv
631.12Stvafterinstall: install.grofflinks
641.15Spk.ORDER: realinstall install.grofflinks
651.12Stvinstall.grofflinks:
661.13Stv	@cd ${.CURDIR} && ${MAKE} install.grofflinks.recurse
671.13Stv
681.4Stv.for F in eqn groff indxbib pic refer soelim tbl
691.16Sthorpejinstall.grofflinks.recurse: ${TOOLDIR}/bin/${_TOOL_PREFIX}${F}
701.12Stv.if exists(${TOOLDIR}/lib/groff/g${F})
711.16Sthorpej${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/g${F}
721.12Stv.else
731.16Sthorpej${TOOLDIR}/bin/${_TOOL_PREFIX}${F}: ${TOOLDIR}/lib/groff/${F}
741.12Stv.endif
751.4Stv	ln -f ${.ALLSRC} ${.TARGET}
761.4Stv.endfor
771.13Stv
78