diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-10-13 16:47:51 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-10-13 16:47:51 +0000 |
commit | d0f9c6c45637daa9cb66a59e59d0a059a0831915 (patch) | |
tree | 1163f31b17b216d3422c70bc6e5299754197fd8a | |
parent | 35a205f725182dd70f2ffd62b0879670e8684bcf (diff) |
indent in a more readable way.
check SRCS files for C++ and invoke g++ accordingly.
Don't link from scratch with DESTDIR, but use -B instead.
okay millert@
-rw-r--r-- | share/mk/bsd.prog.mk | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 1e00e2d4855..c3247aeee78 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.prog.mk,v 1.39 2004/06/03 20:51:07 miod Exp $ +# $OpenBSD: bsd.prog.mk,v 1.40 2004/10/13 16:47:50 espie Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 @@ -106,28 +106,24 @@ CLEANFILES+=strings .if defined(PROG) SRCS?= ${PROG}.c -.if !empty(SRCS:N*.h:N*.sh) +. if !empty(SRCS:N*.h:N*.sh) OBJS+= ${SRCS:N*.h:N*.sh:R:S/$/.o/g} LOBJS+= ${LSRCS:.c=.ln} ${SRCS:M*.c:.c=.ln} -.endif - -.if defined(OBJS) && !empty(OBJS) -.if defined(DESTDIR) +. endif +. if defined(OBJS) && !empty(OBJS) +. if !empty(SRCS:M*.C) || !empty(SRCS:M*.cc) || !empty(SRCS:M*.cxx) ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} - ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -nostdlib -L${DESTDIR}/usr/lib ${LIBCRT0} ${CRTBEGIN} ${OBJS} ${LDADD} -lgcc -lc -lgcc ${CRTEND} - -.else - + ${CXX} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -B${DESTDIR}/usr/lib ${OBJS} ${LDADD} +. else ${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD} - ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD} - -.endif # defined(DESTDIR) -.endif # defined(OBJS) && !empty(OBJS) + ${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} -B${DESTDIR}/usr/lib ${OBJS} ${LDADD} +. endif +. endif # defined(OBJS) && !empty(OBJS) -.if !defined(MAN) +. if !defined(MAN) MAN= ${PROG}.1 -.endif # !defined(MAN) +. endif # !defined(MAN) .endif # defined(PROG) .MAIN: all |