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
-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"
# 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 \
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
@${LD} -x -r ${.TARGET}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
@${LD} -x -r ${.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}
.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}
.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}
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: 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}
- lint -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
+ ${LINT} -C${LIB} ${CFLAGS} ${.ALLSRC:M*.c}
-clean: STDCLEAN
-STDCLEAN: .USE
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
- 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:
- ${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
-
-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>
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 \
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
.endif
rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES}
.endif
+.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}
# 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
+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)
chown games.bin ${PROG})
.endif
chown games.bin ${PROG})
.endif
+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
-STDTAGS: PROGSUBDIR
- tags -f ${.CURDIR}/tags ${.ALLSRC}
+.if !target(tags)
+tags: ${SRCS} PROGSUBDIR
+ ctags -f ${.CURDIR}/tags ${.ALLSRC}
+.endif
-# 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.
-# 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 \
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)
+.endif
+
+.if !target(clean)
+.endif
+
+.if !target(cleandir)
+.endif
+
+.if !target(depend)
+.endif
+
+.if !target(lint)
+.endif
+
+.if !target(tags)
-# 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
-.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
-CI= /usr/new/ci
-CIFLAGS=
-CO= /usr/new/co
-COFLAGS=
-
-CPP= /usr/bin/newcpp
-FC= /usr/bin/f77
-FFLAGS=
-LINT= /usr/bin/lint
-LINTFLAGS= -chapbx
-MAKE= /usr/src/usr.bin/pmake/obj/pmake
+LINT= lint
+LINTFLAGS= -chapbx
-YACC= /usr/bin/yacc
-YFLAGS=
-#.c,v.c .y,v.y .l,v.l .s,v.s .h,v.h:
-# ${CO} ${COFLAGS} ${.IMPSRC} ${.TARGET}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
.c.o:
${CC} ${CFLAGS} -c ${.IMPSRC}
.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}
.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}
.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}
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
.y.c:
${YACC} ${YFLAGS} ${.IMPSRC}
.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}
.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}