From 8ed4d7e8ddbb28ce53740ce9510aa172747e8d00 Mon Sep 17 00:00:00 2001 From: ru Date: Fri, 12 Apr 2002 16:25:13 +0000 Subject: Back out second part of the previous change. While this was indeed a good change, I shouldn't have made it after testing with the -DNOCLEAN buildworld. There are far too many users of this misfeature under sys/boot/. I will reapply the change after I fix these. This change has been tested with the clean buildworld. --- share/mk/bsd.prog.mk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 90d1b90..883159c 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -25,7 +25,6 @@ PROG= ${PROG_CXX} .endif .if defined(PROG) -.if !target(${PROG}) .if defined(SRCS) # If there are Objective C sources, link with Objective C libraries. @@ -36,8 +35,16 @@ LDADD+= ${OBJCLIBS} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} +${PROG}: ${OBJS} +.if defined(PROG_CXX) + ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} +.else + ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} +.endif + .else !defined(SRCS) +.if !target(${PROG}) .if defined(PROG_CXX) SRCS= ${PROG}.cc .else @@ -50,7 +57,6 @@ SRCS= ${PROG}.c # the name of a variable temporary object. # - it's useful to keep objects around for crunching. OBJS= ${PROG}.o -.endif ${PROG}: ${OBJS} .if defined(PROG_CXX) @@ -58,6 +64,7 @@ ${PROG}: ${OBJS} .else ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .endif +.endif .endif -- cgit v1.1