summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/groff/Makefile.bsd-wrapper
blob: a284ffad9e5fb08dfe8abe7d0943a41f2b24ba1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#	$OpenBSD: Makefile.bsd-wrapper,v 1.8 1997/06/23 12:13:47 kstailey Exp $

#
# groff config
#
PREFIX=		/usr
DATASUBDIR=	/usr/share
FONTDIR=	/usr/share/groff_font
INDEXDIR=	/usr/share/dict/papers
COMMON_WORDS=	/usr/share/dict/eign

GNUCFLAGS=	CFLAGS="${CFLAGS}"
GNUCXXFLAGS=	CCFLAGS="${CXXFLAGS}"

CLEANFILES=	config.cache config.log pic/pic.cc eqn/eqn.cc \
		refer/label.cc pic/pic.tab.h eqn/eqn.tab.h ${MANALL}

# All of groff's man pages have a .n extension.  Sigh.
MANLOCALBUILD=	yes

MAN_SRC1=	addftinfo/addftinfo.n groff/groff.n troff/troff.n \
	tbl/tbl.n pic/pic.n eqn/eqn.n grops/grops.n grotty/grotty.n \
	grodvi/grodvi.n tfmtodit/tfmtodit.n grolj4/grolj4.n \
	hpftodit/hpftodit.n refer/refer.n lookbib/lookbib.n \
	indxbib/indxbib.n lkbib/lkbib.n soelim/soelim.n \
	pfbtops/pfbtops.n psbb/psbb.n \
	afmtodit/afmtodit.n grog/grog.n nroff/nroff.n
MAN_SRC5=	man/groff_font.n man/groff_out.n
MAN_SRC7=	man/groff_char.n tmac/groff_ms.n tmac/me.n \
	tmac/msafer.n mm/groff_mm.n mm/groff_mmse.n

MAN_BUILD1=	${MAN_SRC1:S/.n$/.cat1/g}
MAN_BUILD5=	${MAN_SRC5:S/.n$/.cat5/g}
MAN_BUILD7=	${MAN_SRC7:S/.n$/.cat7/g}

# Only use for cleaning!
MANALL=		${MAN_BUILD1} ${MAN_BUILD5} ${MAN_BUILD7}

MLINKS=	groff_ms.7 ms.7 groff_mm.7 mm.7

.SUFFIXES: .n .cat1 .cat5 .cat7

.n.cat1 .n.cat5 .n.cat7:
	@echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
	@${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)

all: config.status gnu_build

.FORCE: .IGNORE

config: .FORCE
	-rm -f config.cache
	/bin/sh ${.CURDIR}/configure --prefix=${PREFIX} \
		--mandir=${DATASUBDIR}/man

config.status:
	/bin/sh ${.CURDIR}/configure --prefix=${PREFIX} \
		--mandir=${DATASUBDIR}/man

gnu_build:
	${MAKE} ${GNUCFLAGS} ${GNUCXXFLAGS} LDFLAGS="-s ${LDSTATIC}" \
		prefix=${PREFIX} \
		datasubdir=${DATASUBDIR} \
		fontdir=${FONTDIR} \
		indexdir=${INDEXDIR} \
		common_words_file=${COMMON_WORDS}

.if !defined(NOMAN)
install: ${MAN_BUILD1} ${MAN_BUILD5} ${MAN_BUILD7} maninstall
	${MAKE} ${GNUCFLAGS} ${GNUCXXFLAGS} LDFLAGS=${LDSTATIC} \
		prefix=${DESTDIR}${PREFIX} \
		datasubdir=${DESTDIR}${DATASUBDIR} \
		fontdir=${DESTDIR}${FONTDIR} \
		indexdir=${DESTDIR}${INDEXDIR} \
		common_words_file=${DESTDIR}${COMMON_WORDS} \
		INSTALL_MAN= TMAC_AN= TMAC_ANDOC= MDOCFILES= tmac_an= \
		install
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/tmac/tmac.an \
                ${DESTDIR}${DATASUBDIR}/tmac/tmac.an.old
.else
install:
	${MAKE} ${GNUCFLAGS} ${GNUCXXFLAGS} LDFLAGS=${LDSTATIC} \
		prefix=${DESTDIR}${PREFIX} \
		datasubdir=${DESTDIR}${DATASUBDIR} \
		fontdir=${DESTDIR}${FONTDIR} \
		indexdir=${DESTDIR}${INDEXDIR} \
		common_words_file=${DESTDIR}${COMMON_WORDS} \
		INSTALL_MAN= TMAC_AN= TMAC_ANDOC= MDOCFILES= tmac_an= \
		install
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/tmac/tmac.an \
                ${DESTDIR}${DATASUBDIR}/tmac/tmac.an.old
.endif

clean cleandir:
	rm -f ${CLEANFILES}
	-@if [ -e Makefile ]; then ${MAKE} distclean; fi

depend:
	# Nothing here so far...

lint:
	# Nothing here so far...

tags:
	# Nothing here so far...

.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.ifndef NOMAN
.include <bsd.man.mk>
.endif