checkpoint, the world rebuilds
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 9 May 1990 04:42:49 +0000 (20:42 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 9 May 1990 04:42:49 +0000 (20:42 -0800)
SCCS-vsn: share/mk/bsd.lib.mk 5.2
SCCS-vsn: share/mk/bsd.prog.mk 5.8
SCCS-vsn: share/mk/bsd.subdir.mk 5.4
SCCS-vsn: share/mk/sys.mk 5.6

usr/src/share/mk/bsd.lib.mk
usr/src/share/mk/bsd.prog.mk
usr/src/share/mk/bsd.subdir.mk
usr/src/share/mk/sys.mk

index 74cf245..c285378 100644 (file)
@@ -1,15 +1,11 @@
-LIBDIR=                /usr/lib
-LINTLIBDIR=    /usr/libdata/lint
-SORT=          /usr/bin/sort
-CTAGS=         /usr/bin/ctags
+.include <bsd.global.mk>
 
 
-.MAIN: all
-
-DEPENDFILE=    .depend
-.if exists(.depend)
-.include ".depend"
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
 .endif
 
 .endif
 
+.MAIN: all
+
 # minor mods to prefer .s to a .c, and add .po
 .SUFFIXES:
 .SUFFIXES: .out .a .ln .o .po .s .c .F .f .e .r .y .l .cl .p .h \
 # minor mods to prefer .s to a .c, and add .po
 .SUFFIXES:
 .SUFFIXES: .out .a .ln .o .po .s .c .F .f .e .r .y .l .cl .p .h \
@@ -17,87 +13,84 @@ DEPENDFILE= .depend
 .c.o:
        ${CC} ${CFLAGS} -c ${.IMPSRC} 
        @${LD} -x -r ${.TARGET}
 .c.o:
        ${CC} ${CFLAGS} -c ${.IMPSRC} 
        @${LD} -x -r ${.TARGET}
-       @${MV} a.out ${.TARGET}
+       @mv a.out ${.TARGET}
 
 .c.po:
        ${CC} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
        @${LD} -X -r ${.TARGET}
 
 .c.po:
        ${CC} -p ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
        @${LD} -X -r ${.TARGET}
-       @${MV} a.out ${.TARGET}
+       @mv a.out ${.TARGET}
 
 .s.o:
        ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
            ${AS} -o ${.TARGET}
        @${LD} -x -r ${.TARGET}
 
 .s.o:
        ${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
            ${AS} -o ${.TARGET}
        @${LD} -x -r ${.TARGET}
-       @${MV} a.out ${.TARGET}
+       @mv a.out ${.TARGET}
 
 .s.po:
        ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
            ${AS} -o ${.TARGET}
        @${LD} -X -r ${.TARGET}
 
 .s.po:
        ${CPP} -E -DPROF ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
            ${AS} -o ${.TARGET}
        @${LD} -X -r ${.TARGET}
-       @${MV} a.out ${.TARGET}
+       @mv a.out ${.TARGET}
 
 MANALL=        ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
 
 all: ranlib llib-l${LIB}.ln ${MANALL}
 
 
 MANALL=        ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
 
 all: ranlib llib-l${LIB}.ln ${MANALL}
 
-ranlib: reorder
+ranlib: lib${LIB}.a lib${LIB}_p.a
        ranlib lib${LIB}.a
        ranlib lib${LIB}_p.a
 
        ranlib lib${LIB}.a
        ranlib lib${LIB}_p.a
 
-STDREORDER: lib${LIB}.a lib${LIB}_p.a .USE
-
-reorder: STDREORDER
+.if target(reorder)
+ranlib: reorder
+.endif
 
 OBJS=  ${SRCS:S/.c$/.o/g:S/.f$/.o/g:S/.s$/.o/g}
 lib${LIB}.a:: ${OBJS}
        @echo building standard ${LIB} library
 
 OBJS=  ${SRCS:S/.c$/.o/g:S/.f$/.o/g:S/.s$/.o/g}
 lib${LIB}.a:: ${OBJS}
        @echo building standard ${LIB} library
-       @ar cr lib${LIB}.a `lorder ${OBJS} | tsort`
+       @${AR} cr lib${LIB}.a `lorder ${OBJS} | tsort` ${LDADD}
 
 POBJS= ${OBJS:.o=.po}
 lib${LIB}_p.a:: ${POBJS}
        @echo building profiled ${LIB} library
 
 POBJS= ${OBJS:.o=.po}
 lib${LIB}_p.a:: ${POBJS}
        @echo building profiled ${LIB} library
-       @ar cr lib${LIB}_p.a `lorder ${POBJS} | tsort`
+       @${AR} cr lib${LIB}_p.a `lorder ${POBJS} | tsort` ${LDADD}
 
 llib-l${LIB}.ln: ${SRCS}
 
 llib-l${LIB}.ln: ${SRCS}
-       lint -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
+       ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
 
 
-clean: STDCLEAN
-STDCLEAN: .USE
+STDCLEAN:
        rm -f a.out Errs errs mklog core ${CLEANFILES} ${OBJS} ${POBJS} \
            profiled/*.o lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln
 
        rm -f a.out Errs errs mklog core ${CLEANFILES} ${OBJS} ${POBJS} \
            profiled/*.o lib${LIB}.a lib${LIB}_p.a llib-l${LIB}.ln
 
-cleandir: clean STDCLEANDIR
-STDCLEANDIR: .USE
-       rm -f ${MANALL} ${TAGSFILE} ${DEPENDFILE}
+STDCLEANDIR:
+       rm -f ${MANALL} tags .depend
 
 
-depend: .depend
-.depend: STDDEPEND
 STDDEPEND: ${SRCS} .USE
 STDDEPEND: ${SRCS} .USE
-       mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC}
+       mkdep ${CFLAGS:M-[ID]*} ${AINC} ${.ALLSRC}
+
+STDINSTALL:
+       install -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} lib${LIB}.a \
+           ${DESTDIR}${LIBDIR}
+       ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
+       install -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+           lib${LIB}_p.a ${DESTDIR}${LIBDIR}
+       ${RANLIB} -t ${DESTDIR}/usr/lib/lib${LIB}_p.a
+       install -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+           llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
+
+STDLINT:
 
 
-tags: ${SRCS} STDTAGS
 STDTAGS: .USE
 STDTAGS: .USE
-       ${CTAGS} ${.ALLSRC:M*.c}
-       ${SED} -e 's;../gen/;/usr/src/lib/libc/gen/;' \
+       tags ${.ALLSRC:M*.c}
+       sed -e 's;../gen/;/usr/src/lib/libc/gen/;' \
            -e 's;../compat-43/;/usr/src/lib/libc/gen/;' \
            < tags > tags.tmp
 .if !empty(SRCS:M*.s)
        egrep -o "^ENTRY(.*)|^SYSCALL(.*)" ${.ALLSRC:M*.s} | sed \
        "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \`pwd\`/\1 /^\2(\3\4$$/;" \
        >> tags.tmp
            -e 's;../compat-43/;/usr/src/lib/libc/gen/;' \
            < tags > tags.tmp
 .if !empty(SRCS:M*.s)
        egrep -o "^ENTRY(.*)|^SYSCALL(.*)" ${.ALLSRC:M*.s} | sed \
        "s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \`pwd\`/\1 /^\2(\3\4$$/;" \
        >> tags.tmp
-       ${SORT} tags.tmp -o tags.tmp
+       sort tags.tmp -o tags.tmp
 .endif
 .endif
-       ${MV} tags.tmp tags
+       mv tags.tmp tags
 
 .include <bsd.own.mk>
 
 .include <bsd.own.mk>
-
-install: STDINSTALL
-STDINSTALL: MANINSTALL .USE
-       ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} lib${LIB}.a \
-           ${DESTDIR}${LIBDIR}
-       ${RANLIB} -t ${DESTDIR}${LIBDIR}/lib${LIB}.a
-       ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-           lib${LIB}_p.a ${DESTDIR}${LIBDIR}
-       ${RANLIB} -t ${DESTDIR}/usr/lib/lib${LIB}_p.a
-       ${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-           llib-l${LIB}.ln ${DESTDIR}${LINTLIBDIR}
+.include <bsd.stdtarg.mk>
index 7b93dd1..eabedb7 100644 (file)
@@ -46,7 +46,7 @@ MANALL=       ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8}
 PROGSUBDIR: .USE
 .if defined(SUBDIR) && !empty(SUBDIR)
        @for entry in ${SUBDIR}; do \
 PROGSUBDIR: .USE
 .if defined(SUBDIR) && !empty(SUBDIR)
        @for entry in ${SUBDIR}; do \
-               (echo "===> $$entry"; \
+               (echo "===> ${PROG}/$$entry"; \
                if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
                        cd ${.CURDIR}/$${entry}.${MACHINE}; \
                else \
                if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
                        cd ${.CURDIR}/$${entry}.${MACHINE}; \
                else \
@@ -64,15 +64,25 @@ clean: PROGSUBDIR
        rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
 .endif
 
        rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
 .endif
 
-STDCLEANDIR: PROGSUBDIR
+.if !target(cleandir)
+cleandir: PROGSUBDIR
        rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
        rm -f .depend ${.CURDIR}/tags ${MANALL}
        rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
        rm -f .depend ${.CURDIR}/tags ${MANALL}
+.endif
 
 # some of the rules involve .h sources, so remove them from mkdep line
 
 # some of the rules involve .h sources, so remove them from mkdep line
-STDDEPEND: ${SRCS} PROGSUBDIR
+.if !target(depend)
+depend: .depend
+.depend: ${SRCS} PROGSUBDIR
        mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
        mkdep ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c}
+.endif
+
+.if !target(install)
+.if !target(beforeinstall)
+beforeinstall:
+.endif
 
 
-STDINSTALL: PROGSUBDIR
+realinstall: beforeinstall PROGSUBDIR
        install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
            ${PROG} ${DESTDIR}${BINDIR}
 .if defined(HIDEGAME)
        install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
            ${PROG} ${DESTDIR}${BINDIR}
 .if defined(HIDEGAME)
@@ -80,10 +90,18 @@ STDINSTALL: PROGSUBDIR
            chown games.bin ${PROG})
 .endif
 
            chown games.bin ${PROG})
 .endif
 
-STDLINT: PROGSUBDIR
+install: afterinstall
+afterinstall: realinstall MANINSTALL
+.endif
+
+.if !target(lint)
+lint: ${SRCS} PROGSUBDIR
        @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
        @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1
+.endif
 
 
-STDTAGS: PROGSUBDIR
-       tags -f ${.CURDIR}/tags ${.ALLSRC}
+.if !target(tags)
+tags: ${SRCS} PROGSUBDIR
+       ctags -f ${.CURDIR}/tags ${.ALLSRC}
+.endif
 
 .include <bsd.own.mk>
 
 .include <bsd.own.mk>
index edc9d76..66e9264 100644 (file)
@@ -1,43 +1,56 @@
-# A Makefile for handling subdirectories.
-# Machine dependent subdirectories take precedence.
-#
-#      @(#)bsd.subdir.mk       5.3 (Berkeley) %G%
-#
+.include <bsd.global.mk>
 
 
-# user defines:
-#      SUBDIR -- the list of subdirectories to be processed
-
-# the default target.
 .MAIN: all
 
 .MAIN: all
 
-# The standard targets change to the subdirectory and make the
-# target.
 STDALL STDDEPEND STDCLEAN STDCLEANDIR STDLINT STDINSTALL STDTAGS: .USE
        @for entry in ${SUBDIR}; do \
 STDALL STDDEPEND STDCLEAN STDCLEANDIR STDLINT STDINSTALL STDTAGS: .USE
        @for entry in ${SUBDIR}; do \
-               (echo "===> $$entry"; \
-               if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
+               (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
+                       echo "===> $${entry}.${MACHINE}"; \
                        cd ${.CURDIR}/$${entry}.${MACHINE}; \
                else \
                        cd ${.CURDIR}/$${entry}.${MACHINE}; \
                else \
+                       echo "===> $$entry"; \
                        cd ${.CURDIR}/$${entry}; \
                fi; \
                ${MAKE} ${.TARGET}) \
        done
 
                        cd ${.CURDIR}/$${entry}; \
                fi; \
                ${MAKE} ${.TARGET}) \
        done
 
-# If the user has not specified the target, use the standard version.
+${SUBDIR}::
+       @if test -d ${.TARGET}.${MACHINE}; then \
+               cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
+       else \
+               cd ${.CURDIR}/${.TARGET}; \
+       fi; \
+       ${MAKE} all
+
+.if !target(all)
 all: STDALL
 all: STDALL
+.endif
+
+.if !target(clean)
 clean: STDCLEAN
 clean: STDCLEAN
+.endif
+
+.if !target(cleandir)
 cleandir: STDCLEANDIR
 cleandir: STDCLEANDIR
+.endif
+
+.if !target(depend)
 depend: STDDEPEND
 depend: STDDEPEND
+.endif
+
+.if !target(lint)
 lint: STDLINT
 lint: STDLINT
-install: STDINSTALL
+.endif
+
+.if !target(tags)
 tags: STDTAGS
 tags: STDTAGS
+.endif
 
 
-# If trying to make one of the subdirectories, change to it and make
-# the default target.
-${SUBDIR}:
-       @if test -d ${.TARGET}.${MACHINE}; then \
-               cd ${.CURDIR}/${.TARGET}.${MACHINE}; \
-       else \
-               cd ${.CURDIR}/${.TARGET}; \
-       fi; \
-       ${MAKE}
+.if !target(install)
+.if target(beforeinstall)
+install: beforeinstall
+install: STDINSTALL
+.else
+install: STDINSTALL
+.endif
+.endif
index 4dfaf05..6d5849e 100644 (file)
@@ -1,57 +1,46 @@
 unix=          We run UNIX.
 unix=          We run UNIX.
-SHELL=         /bin/sh
 
 
-.SUFFIXES: .out .a .ln .o .c .F .f .e .r .y .l .s .cl .p .h \
-               .8 .7 .6 .5 .4 .3 .2 .1 .0
-
-# for RCS
-#.SUFFIXES: .out .a .ln .o .c .F .f .e .r .y .l .s .cl .p .h \
-#              .c,v .y,v .l,v .s,v .h,v .8 .7 .6 .5 .4 .3 .2 .1 .0
+.SUFFIXES: .out .a .ln .o .c .F .f .e .r .y .l .s .cl .p .h 
 
 .LIBS:         .a
 
 .LIBS:         .a
-#.NULL:                .out
 
 
-AR=            /usr/bin/ar
+AR=            ar
 ARFLAGS=       rl
 ARFLAGS=       rl
+RANLIB=                ranlib
 
 
-AS=            /usr/bin/as
+AS=            as
 AFLAGS=
 
 AFLAGS=
 
-CC=            /usr/bin/cc
+CC=            cc
 CFLAGS=                -O
 
 CFLAGS=                -O
 
-CI=            /usr/new/ci
-CIFLAGS=
-CO=            /usr/new/co
-COFLAGS=
-
-CPP=           /usr/bin/newcpp
+CPP=           cpp
 
 
-FC=            /usr/bin/f77
-FFLAGS=
+FC=            f77
+FFLAGS=                -O
 EFLAGS=
 
 EFLAGS=
 
-LEX=           /usr/bin/lex
+LEX=           lex
 LFLAGS=
 
 LFLAGS=
 
-LINT=          /usr/bin/lint
-LINTFLAGS=     -chapbx
+LD=            ld
+LDFLAGS=
 
 
-MAKE=          /usr/src/usr.bin/pmake/obj/pmake
+LINT=          lint
+LINTFLAGS=     -chapbx
 
 
-NROFF=         /usr/bin/nroff
+MAKE=          make
 
 
-PC=            /usr/bin/pc
+PC=            pc
 PFLAGS=
 
 PFLAGS=
 
-RC=            /usr/bin/f77
+RC=            f77
 RFLAGS=
 
 RFLAGS=
 
-YACC=          /usr/bin/yacc
-YFLAGS=
+SHELL=         sh
 
 
-#.c,v.c .y,v.y .l,v.l .s,v.s .h,v.h:
-#      ${CO} ${COFLAGS} ${.IMPSRC} ${.TARGET}
+YACC=          yacc
+YFLAGS=-d
 
 .c.o:
        ${CC} ${CFLAGS} -c ${.IMPSRC}
 
 .c.o:
        ${CC} ${CFLAGS} -c ${.IMPSRC}
@@ -59,9 +48,6 @@ YFLAGS=
 .p.o:
        ${PC} ${PFLAGS} -c ${.IMPSRC}
 
 .p.o:
        ${PC} ${PFLAGS} -c ${.IMPSRC}
 
-.cl.o:
-       class -c ${.IMPSRC}
-
 .e.o .r.o .F.o .f.o:
        ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC}
 
 .e.o .r.o .F.o .f.o:
        ${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC}
 
@@ -71,12 +57,12 @@ YFLAGS=
 .y.o:
        ${YACC} ${YFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
 .y.o:
        ${YACC} ${YFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
-       rm y.tab.c
+       rm -f y.tab.c
 
 .l.o:
        ${LEX} ${LFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} -c lex.yy.c -o ${.TARGET}
 
 .l.o:
        ${LEX} ${LFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} -c lex.yy.c -o ${.TARGET}
-       rm lex.yy.c
+       rm -f lex.yy.c
 
 .y.c:
        ${YACC} ${YFLAGS} ${.IMPSRC}
 
 .y.c:
        ${YACC} ${YFLAGS} ${.IMPSRC}
@@ -97,12 +83,9 @@ YFLAGS=
 .y.out:
        ${YACC} ${YFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
 .y.out:
        ${YACC} ${YFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
-       rm y.tab.c
+       rm -f y.tab.c
 
 .l.out:
        ${LEX} ${LFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} lex.yy.c ${LDLIBS} -ll -o ${.TARGET}
 
 .l.out:
        ${LEX} ${LFLAGS} ${.IMPSRC}
        ${CC} ${CFLAGS} lex.yy.c ${LDLIBS} -ll -o ${.TARGET}
-       rm lex.yy.c
-
-.8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0:
-       ${NROFF} -man -h ${.IMPSRC} > ${.TARGET}
+       rm -f lex.yy.c