diff options
author | wollman <wollman@FreeBSD.org> | 1994-08-04 21:09:27 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-08-04 21:09:27 +0000 |
commit | 5a93a2fdb90e2b13fedd3c7d32d219deffe615e8 (patch) | |
tree | b2dfafb898b6f3696ee37301ecd72e960dfe84d3 /share/mk/bsd.prog.mk | |
parent | a7daa1ed08a69dce4526d89b31a0eaafdcee36e2 (diff) | |
download | FreeBSD-src-5a93a2fdb90e2b13fedd3c7d32d219deffe615e8.zip FreeBSD-src-5a93a2fdb90e2b13fedd3c7d32d219deffe615e8.tar.gz |
Spplat our 1.1.5 `mk' ifiles over the top of the 4.4 ones. So far
as I can tell, this is ts the right thing to do.
Diffstat (limited to 'share/mk/bsd.prog.mk')
-rw-r--r-- | share/mk/bsd.prog.mk | 153 |
1 files changed, 94 insertions, 59 deletions
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index a27f616..8a24d4d 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,15 +1,17 @@ -# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 +# from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 +# $Id: bsd.prog.mk,v 1.28 1994/06/15 10:14:41 ache Exp $ -.if !defined(NOINCLUDE) && exists(${.CURDIR}/../Makefile.inc) +.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 - -.8.0 .7.0 .6.0 .5.0 .4.0 .3.0 .2.0 .1.0: - nroff -man ${.IMPSRC} > ${.TARGET} +.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S CFLAGS+=${COPTS} +.if defined(DESTDIR) +CFLAGS+= -I${DESTDIR}/usr/include +CXXINCLUDES+= -I${DESTDIR}/usr/include/${CXX} +.endif STRIP?= -s @@ -17,23 +19,59 @@ BINGRP?= bin BINOWN?= bin BINMODE?= 555 +INSTALL?= install +.if !defined(DESTDIR) +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 +LIBGNUMALLOC?= /usr/lib/libgnumalloc.a +LIBGNUREGEX?= /usr/lib/libgnuregex.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 +LIBREADLINE?= /usr/lib/libreadline.a LIBRESOLV?= /usr/lib/libresolv.a -LIBRPC?= /usr/lib/sunrpc.a -LIBTERM?= /usr/lib/libterm.a +LIBRPCSVC?= /usr/lib/librpcsvc.a +LIBSKEY?= /usr/lib/libskey.a +LIBTELNET?= /usr/lib/libtelnet.a +LIBTERM?= /usr/lib/libtermcap.a LIBUTIL?= /usr/lib/libutil.a +.else +LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o +LIBC?= ${DESTDIR}/usr/lib/libc.a +LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a +LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a +LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a +LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a +LIBDES?= ${DESTDIR}/usr/lib/libdes.a +LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a +LIBGNUREGEX?= ${DESTDIR}/usr/lib/libgnuregex.a +LIBL?= ${DESTDIR}/usr/lib/libl.a +LIBKDB?= ${DESTDIR}/usr/lib/libkdb.a +LIBKRB?= ${DESTDIR}/usr/lib/libkrb.a +LIBM?= ${DESTDIR}/usr/lib/libm.a +LIBMP?= ${DESTDIR}/usr/lib/libmp.a +LIBPC?= ${DESTDIR}/usr/lib/libpc.a +LIBPLOT?= ${DESTDIR}/usr/lib/libplot.a +LIBREADLINE?= ${DESTDIR}/usr/lib/libreadline.a +LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a +LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a +LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a +LIBTELNET?= ${DESTDIR}/usr/lib/libtelnet.a +LIBTERM?= ${DESTDIR}/usr/lib/libtermcap.a +LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a +.endif +.if defined(NOSHARED) +LDFLAGS+= -static +.endif .if defined(SHAREDSTRINGS) CLEANFILES+=strings @@ -41,22 +79,44 @@ CLEANFILES+=strings ${CC} -E ${CFLAGS} ${.IMPSRC} | xstr -c - @${CC} ${CFLAGS} -c x.c -o ${.TARGET} @rm -f x.c + +.cc.o .cxx.o .C.o: + ${CXX} -E ${CXXFLAGS} ${.IMPSRC} | xstr -c - + @mv -f x.c x.cc + @${CXX} ${CXXFLAGS} -c x.cc -o ${.TARGET} + +.endif + +.if defined(DESTDIR) +LDDESTDIR?= -L${DESTDIR}/usr/lib .endif .if defined(PROG) .if defined(SRCS) -OBJS+= ${SRCS:R:S/$/.o/g} +DPSRCS+= ${SRCS:M*.h} +OBJS+= ${SRCS:N*.h:R:S/$/.o/g} + +.if defined(LDONLY) -${PROG}: ${OBJS} ${LIBC} ${DPADD} - ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} +${PROG}: ${LIBCRT0} ${LIBC} ${DPSRCS} ${OBJS} ${DPADD} + ${LD} ${LDFLAGS} -o ${.TARGET} ${LIBCRT0} ${OBJS} ${LIBC} ${LDDESTDR} \ + ${LDADD} -.else defined(SRCS) +.else defined(LDONLY) + +${PROG}: ${DPSRCS} ${OBJS} ${LIBC} ${DPADD} + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD} + +.endif + +.else defined(PROG) SRCS= ${PROG}.c -${PROG}: ${SRCS} ${LIBC} ${DPADD} - ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} ${LDADD} +${PROG}: ${DPSRCS} ${SRCS} ${LIBC} ${DPADD} + ${CC} ${LDFLAGS} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${SRCS} \ + ${LDDESTDIR} ${LDADD} MKDEP= -p @@ -65,15 +125,9 @@ MKDEP= -p .if !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ !defined(MAN7) && !defined(MAN8) && !defined(NOMAN) -MAN1= ${PROG}.0 +MAN1= ${PROG}.1 .endif .endif -.if !defined(NOMAN) -MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN4} ${MAN5} ${MAN6} ${MAN7} ${MAN8} -.else -MANALL= -.endif -manpages: ${MANALL} _PROGSUBDIR: .USE .if defined(SUBDIR) && !empty(SUBDIR) @@ -88,29 +142,19 @@ _PROGSUBDIR: .USE done .endif -.if !target(all) .MAIN: all -all: ${PROG} ${MANALL} _PROGSUBDIR -.endif +all: ${PROG} _PROGSUBDIR .if !target(clean) clean: _PROGSUBDIR - rm -f a.out [Ee]rrs mklog ${PROG}.core ${PROG} ${OBJS} ${CLEANFILES} + rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES} .endif .if !target(cleandir) cleandir: _PROGSUBDIR - rm -f a.out [Ee]rrs mklog ${PROG}.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 + rm -f a.out [Ee]rrs mklog ${PROG} ${OBJS} ${CLEANFILES} + rm -f ${.CURDIR}/tags .depend + cd ${.CURDIR}; rm -rf obj; .endif .if !target(install) @@ -123,8 +167,8 @@ afterinstall: realinstall: _PROGSUBDIR .if defined(PROG) - install ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR} + ${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}; \ @@ -143,8 +187,12 @@ realinstall: _PROGSUBDIR done; true .endif -install: afterinstall maninstall +install: afterinstall +.if !defined(NOMAN) +afterinstall: realinstall maninstall +.else afterinstall: realinstall +.endif realinstall: beforeinstall .endif @@ -161,7 +209,7 @@ obj: _PROGSUBDIR .else obj: _PROGSUBDIR @cd ${.CURDIR}; rm -rf obj; \ - here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \ + here=`pwd`; dest=/usr/obj`echo $$here | sed 's,^/usr/src,,'`; \ echo "$$here -> $$dest"; ln -s $$dest obj; \ if test -d /usr/obj -a ! -d $$dest; then \ mkdir -p $$dest; \ @@ -171,31 +219,18 @@ obj: _PROGSUBDIR .endif .endif -.if !target(objdir) -.if defined(NOOBJ) -objdir: _PROGSUBDIR -.else -objdir: _PROGSUBDIR - @cd ${.CURDIR}; \ - here=`pwd`; dest=/usr/obj/`echo $$here | sed 's,/usr/src/,,'`; \ - if test -d /usr/obj -a ! -d $$dest; then \ - mkdir -p $$dest; \ - else \ - true; \ - fi; -.endif -.endif - .if !target(tags) tags: ${SRCS} _PROGSUBDIR .if defined(PROG) - -ctags -f /dev/stdout ${.ALLSRC} | \ - sed "s;${.CURDIR}/;;" > ${.CURDIR}/tags + -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC} | \ + sed "s;\${.CURDIR}/;;" > tags .endif .endif .if !defined(NOMAN) .include <bsd.man.mk> -.else +.elif !target(maninstall) maninstall: .endif + +.include <bsd.dep.mk> |