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.6 retrieving revision 1.25 diff -u -p -r1.6 -r1.25 --- src/share/mk/bsd.prog.mk 1993/04/08 14:02:02 1.6 +++ src/share/mk/bsd.prog.mk 1993/08/15 19:37:10 1.25 @@ -1,26 +1,29 @@ -# @(#)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.25 1993/08/15 19:37:10 mycroft 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} +CFLAGS+= ${COPTS} -STRIP?= -s +STRIP?= -s BINGRP?= bin BINOWN?= bin BINMODE?= 555 - LIBCRT0?= /usr/lib/crt0.o LIBC?= /usr/lib/libc.a LIBCOMPAT?= /usr/lib/libcompat.a +.ifndef EXPORTABLE_SYSTEM +LIBCRYPT?= /usr/lib/libcrypt.a +.endif LIBCURSES?= /usr/lib/libcurses.a LIBDBM?= /usr/lib/libdbm.a LIBDES?= /usr/lib/libdes.a @@ -33,6 +36,7 @@ LIBPC?= /usr/lib/libpc.a LIBPLOT?= /usr/lib/libplot.a LIBRESOLV?= /usr/lib/libresolv.a LIBRPC?= /usr/lib/librpc.a +LIBRPCSVC?= /usr/lib/librpcsvc.a LIBTERM?= /usr/lib/libterm.a LIBUTIL?= /usr/lib/libutil.a @@ -42,12 +46,22 @@ 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} + +.C.o: + ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c - + @mv -f x.c x.C + @${CXX} ${CXXFLAGS} -c x.C -o ${.TARGET} .endif .if defined(PROG) .if defined(SRCS) -OBJS+= ${SRCS:R:S/$/.o/g} +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if defined(LDONLY) @@ -66,7 +80,7 @@ ${PROG}: ${OBJS} ${LIBC} ${DPADD} SRCS= ${PROG}.c ${PROG}: ${SRCS} ${LIBC} ${DPADD} - ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} + ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} MKDEP= -p @@ -74,11 +88,14 @@ 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 + +.if !defined(NOMAN) MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} +.endif _PROGSUBDIR: .USE .if defined(SUBDIR) && !empty(SUBDIR) @@ -99,49 +116,42 @@ all: ${PROG} ${MANALL} _PROGSUBDIR .if !target(clean) clean: _PROGSUBDIR rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} - rm -f .depend ${MANALL} .endif .if !target(cleandir) cleandir: _PROGSUBDIR - rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} ${MANALL} + rm -f a.out [Ee]rrs mklog core ${PROG} ${OBJS} ${CLEANFILES} rm -f .depend ${MANALL} .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 +.include +depend: _PROGSUBDIR .if !target(install) .if !target(beforeinstall) beforeinstall: - @if [ ! -d ${DESTDIR}${BINDIR} ]; then \ - /bin/rm ${DESTDIR}${BINDIR} ; \ - mkdir -p ${DESTDIR}${BINDIR} ; \ - chown root.wheel ${DESTDIR}${BINDIR} ; \ - chmod 755 ${DESTDIR}${BINDIR} ; \ - else \ - true ; \ - fi +.if defined(DESTDIR) || defined(BINDIR) + @install -d -o root -g wheel -m 755 ${DESTDIR}${BINDIR} +.endif .endif .if !target(afterinstall) afterinstall: .endif +.if !target(realinstall) realinstall: _PROGSUBDIR .if defined(PROG) - install -c ${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 .if defined(LINKS) && !empty(LINKS) @set ${LINKS}; \ while test $$# -ge 2; do \ @@ -155,7 +165,6 @@ realinstall: _PROGSUBDIR done; true .endif -install: maninstall maninstall: afterinstall afterinstall: realinstall realinstall: beforeinstall @@ -168,32 +177,6 @@ lint: ${SRCS} _PROGSUBDIR .endif .endif -.if !target(obj) -.if defined(NOOBJ) -obj: _PROGSUBDIR -.else -obj: _PROGSUBDIR - @cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \ - here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \ - if test $$here != $$subdir ; then \ - 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 ; \ - 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) @@ -205,3 +188,6 @@ tags: ${SRCS} _PROGSUBDIR .if !defined(NOMAN) .include .endif + +.include +obj: _PROGSUBDIR