From caa40a118a0146876e12b0d1c66229978e25b80c Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 21 Jul 1993 17:18:04 +0000 Subject: [PATCH] Changes to allow man to work with or without obj dirs. --- gnu/usr.bin/man/Makefile.inc | 13 ++++++++++++ gnu/usr.bin/man/apropos/Makefile | 31 +++++++++++++++++++---------- gnu/usr.bin/man/lib/Makefile | 15 ++++++++++---- gnu/usr.bin/man/makewhatis/Makefile | 21 ++++++++++++------- gnu/usr.bin/man/man/Makefile | 16 +++++++++++---- gnu/usr.bin/man/manpath/Makefile | 12 ++++++++--- gnu/usr.bin/man/whatis/Makefile | 31 +++++++++++++++++++---------- 7 files changed, 99 insertions(+), 40 deletions(-) diff --git a/gnu/usr.bin/man/Makefile.inc b/gnu/usr.bin/man/Makefile.inc index 4616338e807b..b8bb2d16106c 100644 --- a/gnu/usr.bin/man/Makefile.inc +++ b/gnu/usr.bin/man/Makefile.inc @@ -19,3 +19,16 @@ refer= /usr/bin/refer grap= # no grap pic= /usr/bin/pic zcat= /usr/bin/zcat + +# For scripts. +.if !target(obj) +obj: + @cd ${.CURDIR}; rm -rf obj; \ + here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \ + echo "$$here -> $$dest"; ln -s $$dest obj; \ + if test -d /usr/obj -a ! -d $$dest; then \ + mkdir -p $$dest; \ + else \ + true; \ + fi; +.endif diff --git a/gnu/usr.bin/man/apropos/Makefile b/gnu/usr.bin/man/apropos/Makefile index e249f19fca59..8073f990792a 100644 --- a/gnu/usr.bin/man/apropos/Makefile +++ b/gnu/usr.bin/man/apropos/Makefile @@ -1,26 +1,35 @@ -.include "../Makefile.inc" +.if exists(${.CURDIR}/obj) +MANP= ${.CURDIR}/obj/apropos.1 +TARG= ${.CURDIR}/obj/apropos +.else +MANP= ${.CURDIR}/apropos.1 +TARG= ${.CURDIR}/apropos +.endif -all: apropos apropos.1 +all: ${TARG} ${MANP} -obj depend rcsfreeze tags all: +depend rcsfreeze tags all: @echo -n cleandir: clean + cd ${.CURDIR}; rm -rf obj; clean: - @rm -f apropos apropos.1 + @rm -f ${TARG} ${MANP} -apropos: apropos.sh +${TARG}: ${.CURDIR}/apropos.sh sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' \ - apropos.sh > apropos + ${.CURDIR}/apropos.sh > $@ -apropos.1: apropos.man +${MANP}: ${.CURDIR}/apropos.man sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ -e 's,%manpath_config_file%,${manpath_config_file},' \ - apropos.man > apropos.1 + ${.CURDIR}/apropos.man > $@ -install: apropos apropos.1 - install -c -o bin -g bin -m 555 apropos /usr/bin - install -c -o bin -g bin -m 444 apropos.1 /usr/share/man/man1 +install: ${TARG} ${MANP} + install -c -o bin -g bin -m 555 ${TARG} /usr/bin + install -c -o bin -g bin -m 444 ${MANP} /usr/share/man/man1 + +.include "../Makefile.inc" diff --git a/gnu/usr.bin/man/lib/Makefile b/gnu/usr.bin/man/lib/Makefile index 0990549a09e4..d364b32f4b7a 100644 --- a/gnu/usr.bin/man/lib/Makefile +++ b/gnu/usr.bin/man/lib/Makefile @@ -1,15 +1,22 @@ LIB = man +.if exists(${.CURDIR}/obj) +CONFH= ${.CURDIR}/obj/config.h +.else +CONFH= ${.CURDIR}/config.h +.endif + + CFLAGS+= -I${.CURDIR} -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS -DALT_SYSTEMS -CLEANFILES+= ${.CURDIR}/config.h +CLEANFILES+= ${CONFH} SRCS = util.c gripes.c -libman.a:: ${.CURDIR}/config.h +libman.a:: ${CONFH} install: @echo -n -depend ${.CURDIR}/config.h: ${.CURDIR}/config.h_dist ../Makefile.inc +depend ${CONFH}: ${.CURDIR}/config.h_dist ../Makefile.inc sed -e 's,%apropos%,${apropos},' -e 's,%whatis%,${whatis},' \ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ -e 's,%nroff%,${nroff},' -e 's,%tbl%,${tbl},' \ @@ -18,6 +25,6 @@ depend ${.CURDIR}/config.h: ${.CURDIR}/config.h_dist ../Makefile.inc -e 's,%vgrind%,${vgrind},' -e 's,%refer%,${refer},' \ -e 's,%grap%,${grap},' -e 's,%zcat%,${zcat},' \ -e 's,%manpath_config_file%,${manpath_config_file},' \ - ${.CURDIR}/config.h_dist > ${.CURDIR}/config.h + ${.CURDIR}/config.h_dist > ${CONFH} .include diff --git a/gnu/usr.bin/man/makewhatis/Makefile b/gnu/usr.bin/man/makewhatis/Makefile index 0e70dcf824b9..8dc9c0b69afa 100644 --- a/gnu/usr.bin/man/makewhatis/Makefile +++ b/gnu/usr.bin/man/makewhatis/Makefile @@ -1,17 +1,24 @@ -.include "../Makefile.inc" +.if exists(${.CURDIR}/obj) +TARG= ${.CURDIR}/obj/makewhatis +.else +TARG= ${.CURDIR}/makewhatis +.endif -all: makewhatis +all: ${TARG} -obj depend rcsfreeze tags all: +depend rcsfreeze tags all: @echo -n cleandir: clean + cd ${.CURDIR}; rm -rf obj; clean: - @rm -f makewhatis + @rm -f ${TARG} install: - install -c -o bin -g bin -m 444 makewhatis /usr/bin + install -c -o bin -g bin -m 444 ${TARG} /usr/bin -makewhatis: makewhatis.sh - sed -e 's/%sections%/ "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "p", "o", NULL/' makewhatis.sh > makewhatis +${TARG}: ${.CURDIR}/makewhatis.sh + sed -e 's/%sections%/ "1", "n", "l", "6", "8", "2", "3", "4", "5", "7", "p", "o", NULL/' ${.CURDIR}/makewhatis.sh > ${TARG} + +.include "../Makefile.inc" diff --git a/gnu/usr.bin/man/man/Makefile b/gnu/usr.bin/man/man/Makefile index 397157794f5f..052572324e5c 100644 --- a/gnu/usr.bin/man/man/Makefile +++ b/gnu/usr.bin/man/man/Makefile @@ -1,20 +1,28 @@ PROG= man SRCS= man.c manpath.c glob.c -MAN1= man.1 BINMODE=2555 .if exists(${.CURDIR}/../lib/obj) LDADD= -L${.CURDIR}/../lib/obj -lman +CFLAGS+= -I${.CURDIR}/../lib/obj .else LDADD= -L${.CURDIR}/../lib/ -lman .endif -CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS -DALT_SYSTEMS +.if exists(${.CURDIR}/obj) +MAN1= ${.CURDIR}/obj/man.1 +.else +MAN1= ${.CURDIR}/man.1 +.endif -man.1: man.man +DPADD+= ${MAN1} +CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS -DALT_SYSTEMS +CLEANFILES+= ${MAN1} + +${MAN1}: ${.CURDIR}/man.man sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ -e 's,%manpath_config_file%,${manpath_config_file},' \ - man.man > man.1 + ${.CURDIR}/man.man > ${MAN1} .include diff --git a/gnu/usr.bin/man/manpath/Makefile b/gnu/usr.bin/man/manpath/Makefile index d8eb66d442c1..49d487df5cfc 100644 --- a/gnu/usr.bin/man/manpath/Makefile +++ b/gnu/usr.bin/man/manpath/Makefile @@ -1,5 +1,4 @@ PROG= manpath -MAN1= manpath.1 SRCS= manpath.c .if exists(${.CURDIR}/../lib/obj) @@ -8,13 +7,20 @@ LDADD= -L${.CURDIR}/../lib/obj -lman LDADD= -L${.CURDIR}/../lib/ -lman .endif +.if exists(${.CURDIR}/obj) +MAN1=${.CURDIR}/obj/manpath.1 +.else +MAN1=${.CURDIR}/manpath.1 +.endif + +DPADD+= ${MAN1} CFLAGS+= -I${.CURDIR}/../lib -DMAIN -DSTDC_HEADERS -DPOSIX -DHAS_TROFF -DDO_UNCOMPRESS -DALT_SYSTEMS -manpath.1: manpath.man +${MAN1}: ${.CURDIR}/manpath.man sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ -e 's,%manpath_config_file%,${manpath_config_file},' \ - manpath.man > manpath.1 + ${.CURDIR}/manpath.man > ${MAN1} afterinstall: install -c -o bin -g bin -m 555 ${.CURDIR}/manpath.config ${DESTDIR}${manpath_config_file} diff --git a/gnu/usr.bin/man/whatis/Makefile b/gnu/usr.bin/man/whatis/Makefile index 5ba2781c76df..ebafe0359937 100644 --- a/gnu/usr.bin/man/whatis/Makefile +++ b/gnu/usr.bin/man/whatis/Makefile @@ -1,26 +1,35 @@ -.include "../Makefile.inc" +.if exists(${.CURDIR}/obj) +MANP= ${.CURDIR}/obj/whatis.1 +TARG= ${.CURDIR}/obj/whatis +.else +MANP= ${.CURDIR}/whatis.1 +TARG= ${.CURDIR}/whatis +.endif -all: whatis whatis.1 +all: ${TARG} ${MANP} -obj depend rcsfreeze tags all: +depend rcsfreeze tags all: @echo -n cleandir: clean + cd ${.CURDIR}; rm -rf obj; clean: - @rm -f whatis whatis.1 + @rm -f ${TARG} ${MANP} -whatis: whatis.sh +${TARG}: ${.CURDIR}/whatis.sh sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' \ - whatis.sh > whatis + ${.CURDIR}/whatis.sh > ${TARG} -whatis.1: whatis.man +${MANP}: ${.CURDIR}/whatis.man sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \ -e 's,%manpath_config_file%,${manpath_config_file},' \ - whatis.man > whatis.1 + ${.CURDIR}/whatis.man > ${MANP} -install: whatis whatis.1 - install -c -o bin -g bin -m 555 whatis /usr/bin - install -c -o bin -g bin -m 444 whatis.1 /usr/share/man/man1 +install: ${TARG} ${MANP} + install -c -o bin -g bin -m 555 ${TARG} /usr/bin + install -c -o bin -g bin -m 444 ${MANP} /usr/share/man/man1 + +.include "../Makefile.inc"