BSD 4_3_Reno release
[unix-history] / usr / src / share / mk / bsd.prog.mk
index 1f6443d..406f015 100644 (file)
@@ -1,4 +1,4 @@
-#      @(#)bsd.prog.mk 5.14 (Berkeley) %G%
+#      @(#)bsd.prog.mk 5.20 (Berkeley) 6/29/90
 
 .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"
 
 .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"
@@ -7,7 +7,7 @@
 .SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
 
 .8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:
 .SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0
 
 .8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:
-       nroff -man -h ${.IMPSRC} > ${.TARGET}
+       nroff -mandoc -h ${.IMPSRC} > ${.TARGET}
 
 CFLAGS+=${COPTS}
 
 
 CFLAGS+=${COPTS}
 
@@ -17,7 +17,7 @@ BINGRP?=      bin
 BINOWN?=       bin
 BINMODE?=      555
 
 BINOWN?=       bin
 BINMODE?=      555
 
-LIBC?=         /lib/libc.a
+LIBC?=         /usr/lib/libc.a
 LIBCOMPAT?=    /usr/lib/libcompat.a
 LIBCURSES?=    /usr/lib/libcurses.a
 LIBDBM?=       /usr/lib/libdbm.a
 LIBCOMPAT?=    /usr/lib/libcompat.a
 LIBCURSES?=    /usr/lib/libcurses.a
 LIBDBM?=       /usr/lib/libdbm.a
@@ -29,13 +29,15 @@ LIBM?=              /usr/lib/libm.a
 LIBMP?=                /usr/lib/libmp.a
 LIBPC?=                /usr/lib/libpc.a
 LIBPLOT?=      /usr/lib/libplot.a
 LIBMP?=                /usr/lib/libmp.a
 LIBPC?=                /usr/lib/libpc.a
 LIBPLOT?=      /usr/lib/libplot.a
+LIBRESOLV?=    /usr/lib/libresolv.a
 LIBRPC?=       /usr/lib/sunrpc.a
 LIBTERM?=      /usr/lib/libterm.a
 LIBUTIL?=      /usr/lib/libutil.a
 
 .if defined(SHAREDSTRINGS)
 LIBRPC?=       /usr/lib/sunrpc.a
 LIBTERM?=      /usr/lib/libterm.a
 LIBUTIL?=      /usr/lib/libutil.a
 
 .if defined(SHAREDSTRINGS)
+CLEANFILES+=strings
 .c.o:
 .c.o:
-       ${CC} -E ${CFLAGS} ${.IMPSRC} | /usr/bin/xstr -c -
+       ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c -
        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
        @rm -f x.c
 .endif
        @${CC} ${CFLAGS} -c x.c -o ${.TARGET}
        @rm -f x.c
 .endif
@@ -55,6 +57,8 @@ SRCS= ${PROG}.c
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}
        ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}
 
 ${PROG}: ${SRCS} ${LIBC} ${DPADD}
        ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD}
 
+MKDEP= -p
+
 .endif
 
 .if    !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
 .endif
 
 .if    !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
@@ -94,10 +98,10 @@ cleandir: _PROGSUBDIR
 
 # some of the rules involve .h sources, so remove them from mkdep line
 .if !target(depend)
 
 # some of the rules involve .h sources, so remove them from mkdep line
 .if !target(depend)
-depend: .depend
-.depend: ${SRCS} _PROGSUBDIR
+depend: .depend _PROGSUBDIR
+.depend: ${SRCS}
 .if defined(PROG)
 .if defined(PROG)
-       mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
+       mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
 .endif
 .endif
 
 .endif
 .endif
 
@@ -144,10 +148,21 @@ lint: ${SRCS} _PROGSUBDIR
 .endif
 .endif
 
 .endif
 .endif
 
+.if !target(obj)
+.if defined(NOOBJ)
+obj: _PROGSUBDIR
+.else
+obj: _PROGSUBDIR
+       @cd ${.CURDIR}; rm -rf obj; \
+       here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \
+       echo "$$here -> $$dest"; ln -s $$dest obj
+.endif
+.endif
+
 .if !target(tags)
 tags: ${SRCS} _PROGSUBDIR
 .if defined(PROG)
 .if !target(tags)
 tags: ${SRCS} _PROGSUBDIR
 .if defined(PROG)
-       cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \
+       -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \
            sed "s;\${.CURDIR}/;;" > tags
 .endif
 .endif
            sed "s;\${.CURDIR}/;;" > tags
 .endif
 .endif