Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v rcsdiff: /ftp/cvs/cvsroot/src/share/mk/bsd.prog.mk,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.2 retrieving revision 1.37 diff -u -p -r1.2 -r1.37 --- src/share/mk/bsd.prog.mk 1993/03/22 08:09:40 1.2 +++ src/share/mk/bsd.prog.mk 1994/04/06 06:37:38 1.37 @@ -1,37 +1,32 @@ -# @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 +# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 +# $Id: bsd.prog.mk,v 1.37 1994/04/06 06:37:38 chopps Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif -.SUFFIXES: .out .o .c .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 +.SUFFIXES: .out .o .c .cc .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 -mandoc ${.IMPSRC} > ${.TARGET} - -CFLAGS+=${COPTS} - -STRIP?= -s - -BINGRP?= bin -BINOWN?= bin -BINMODE?= 555 +CFLAGS+= ${COPTS} +LIBCRT0?= /usr/lib/crt0.o LIBC?= /usr/lib/libc.a LIBCOMPAT?= /usr/lib/libcompat.a +LIBCRYPT?= /usr/lib/libcrypt.a LIBCURSES?= /usr/lib/libcurses.a LIBDBM?= /usr/lib/libdbm.a LIBDES?= /usr/lib/libdes.a LIBL?= /usr/lib/libl.a LIBKDB?= /usr/lib/libkdb.a LIBKRB?= /usr/lib/libkrb.a +LIBKVM?= /usr/lib/libkvm.a LIBM?= /usr/lib/libm.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 +LIBRPCSVC?= /usr/lib/librpcsvc.a +LIBTERMCAP?= /usr/lib/libtermcap.a LIBUTIL?= /usr/lib/libutil.a .if defined(SHAREDSTRINGS) @@ -40,22 +35,43 @@ CLEANFILES+=strings ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c - @${CC} ${CFLAGS} -c x.c -o ${.TARGET} @rm -f x.c + +.cc.o: + ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c - + @mv -f x.c x.cc + @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET} + @rm -f x.cc + +.C.o: + ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c - + @mv -f x.c x.C + @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET} + @rm -f x.C .endif .if defined(PROG) .if defined(SRCS) -OBJS+= ${SRCS:R:S/$/.o/g} +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} + +.if defined(LDONLY) + +${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} + ${LD} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDADD} + +.else defined(LDONLY) -${PROG}: ${OBJS} ${LIBC} ${DPADD} - ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} +${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${DPADD} + ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} -.else defined(PROG) +.endif + +.else -SRCS= ${PROG}.c +SRCS= ${PROG}.c -${PROG}: ${SRCS} ${LIBC} ${DPADD} - ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} +${PROG}: ${LIBCRT0} ${SRCS} ${LIBC} ${DPADD} + ${CC} ${LDFLAGS} ${LDSTATIC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} MKDEP= -p @@ -63,47 +79,20 @@ MKDEP= -p .if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ - !defined(MAN7) && !defined(MAN8) && !defined(NOMAN) + !defined(MAN7) && !defined(MAN8) MAN1= ${PROG}.0 .endif .endif -MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} - -_PROGSUBDIR: .USE -.if defined(SUBDIR) && !empty(SUBDIR) - @for entry in ${SUBDIR}; do \ - (echo "===> $$entry"; \ - if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ - cd ${.CURDIR}/$${entry}.${MACHINE}; \ - else \ - cd ${.CURDIR}/$${entry}; \ - fi; \ - ${MAKE} ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \ - done -.endif .MAIN: all -all: ${PROG} ${MANALL} _PROGSUBDIR +all: ${PROG} .if !target(clean) -clean: _PROGSUBDIR - 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 ${MANALL} +clean: + rm -f a.out [Ee]rrs mklog core *.core ${PROG} ${OBJS} ${CLEANFILES} .endif -# some of the rules involve .h sources, so remove them from mkdep line -.if !target(depend) -depend: .depend _PROGSUBDIR -.depend: ${SRCS} -.if defined(PROG) - mkdep ${MKDEP} ${CFLAGS:M-[ID]*} ${.ALLSRC:M*.c} -.endif -.endif +cleandir: clean .if !target(install) .if !target(beforeinstall) @@ -113,15 +102,19 @@ beforeinstall: afterinstall: .endif -realinstall: _PROGSUBDIR +.if !target(realinstall) +realinstall: .if defined(PROG) - install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + install ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${PROG} ${DESTDIR}${BINDIR} .endif .if defined(HIDEGAME) (cd ${DESTDIR}/usr/games; rm -f ${PROG}; ln -s dm ${PROG}; \ chown games.bin ${PROG}) .endif +.endif + +install: maninstall _SUBDIRUSE .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ @@ -135,55 +128,22 @@ realinstall: _PROGSUBDIR done; true .endif -install: maninstall maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall .endif .if !target(lint) -lint: ${SRCS} _PROGSUBDIR +lint: ${SRCS} .if defined(PROG) @${LINT} ${LINTFLAGS} ${CFLAGS} ${.ALLSRC} | more 2>&1 .endif .endif -.if !target(obj) -.if defined(NOOBJ) -obj: _PROGSUBDIR -.else -obj: _PROGSUBDIR - @cd ${.CURDIR}; \ - here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \ - if test $$here != $$subdir ; then \ - rm -rf obj; \ - dest=/usr/obj/$$subdir ; \ - echo "$$here -> $$dest"; ln -s $$dest obj; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; \ - else \ - true ; \ - dest=$$here/obj ; \ - /bin/rm -f $$dest 2> /dev/null || true; \ - echo "making $$here/obj" ; \ - if test ! -d obj ; then \ - mkdir $$here/obj; \ - fi ; \ - fi; -.endif -.endif - -.if !target(tags) -tags: ${SRCS} _PROGSUBDIR -.if defined(PROG) - -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \ - sed "s;\${.CURDIR}/;;" > tags -.endif -.endif - .if !defined(NOMAN) .include .endif + +.include +.include +.include