Changes to allow man to work with or without obj dirs.

This commit is contained in:
Jordan K. Hubbard 1993-07-21 17:18:04 +00:00
parent 31e73a990a
commit caa40a118a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176
7 changed files with 99 additions and 40 deletions

View File

@ -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

View File

@ -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"

View File

@ -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 <bsd.lib.mk>

View File

@ -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"

View File

@ -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 <bsd.prog.mk>

View File

@ -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}

View File

@ -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"