summaryrefslogtreecommitdiff
path: root/share/mk/bsd.prog.mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk/bsd.prog.mk')
-rw-r--r--share/mk/bsd.prog.mk26
1 files changed, 11 insertions, 15 deletions
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index d2af24656d2..c5e08b8121d 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.prog.mk,v 1.41 2004/10/18 10:07:09 espie Exp $
+# $OpenBSD: bsd.prog.mk,v 1.42 2004/10/20 09:28:17 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} ${OBJS} ${LDADD}
+. else
${PROG}: ${LIBCRT0} ${OBJS} ${LIBC} ${CRTBEGIN} ${CRTEND} ${DPADD}
${CC} ${LDFLAGS} ${LDSTATIC} -o ${.TARGET} ${OBJS} ${LDADD}
+. endif
+. endif # defined(OBJS) && !empty(OBJS)
-.endif # defined(DESTDIR)
-.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